Skip to content

Commit

Permalink
docs: various enhancements across /docs workspace (apache#31921)
Browse files Browse the repository at this point in the history
Signed-off-by: hainenber <[email protected]>
  • Loading branch information
hainenber authored Feb 20, 2025
1 parent f9a4392 commit 2d88929
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 98 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ under the License.
-->

This is the public documentation site for Superset, built using
[Docusaurus 2](https://docusaurus.io/). See
[Docusaurus 3](https://docusaurus.io/). See
[CONTRIBUTING.md](../CONTRIBUTING.md#documentation) for documentation on
contributing to documentation.
1 change: 0 additions & 1 deletion docs/docs/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ hide_title: true
sidebar_position: 10
---

import { Buffer } from 'buffer/index.js';
import SwaggerUI from 'swagger-ui-react';
import openapi from '/resources/openapi.json';
import 'swagger-ui-react/swagger-ui.css';
Expand Down
6 changes: 0 additions & 6 deletions docs/docs/configuration/setup-ssh-tunneling.mdx

This file was deleted.

8 changes: 4 additions & 4 deletions docs/docs/contributing/howtos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version: 1

The latest documentation and tutorial are available at https://superset.apache.org/.

The documentation site is built using [Docusaurus 2](https://docusaurus.io/), a modern
The documentation site is built using [Docusaurus 3](https://docusaurus.io/), a modern
static website generator, the source for which resides in `./docs`.

### Local Development
Expand Down Expand Up @@ -223,9 +223,9 @@ To run a single test file:
npm run test -- path/to/file.js
```
### e2e Integration Testing
### E2E Integration Testing
For e2e testing, we recommend that you use a `docker compose` backend
For E2E testing, we recommend that you use a `docker compose` backend
```bash
CYPRESS_CONFIG=true docker compose up --build
Expand Down Expand Up @@ -411,7 +411,7 @@ See [set capabilities for a container](https://kubernetes.io/docs/tasks/configur
Once the pod is running as root and has the `SYS_PTRACE` capability it will be able to debug the Flask app.
You can follow the same instructions as in `docker compose`. Enter the pod and install the required library and packages; gdb, netstat and debugpy.
You can follow the same instructions as in `docker compose`. Enter the pod and install the required library and packages: gdb, netstat and debugpy.
Often in a Kubernetes environment nodes are not addressable from outside the cluster. VSCode will thus be unable to remotely connect to port 5678 on a Kubernetes node. In order to do this you need to create a tunnel that port forwards 5678 to your local machine.
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/contributing/misc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ sidebar_position: 6
version: 1
---

# Misc.
# Miscellaneous

## Reporting a Security Vulnerability

Please report security vulnerabilities to [email protected].

In the event a community member discovers a security flaw in Superset, it is important to follow the [Apache Security Guidelines](https://www.apache.org/security/committers.html) and release a fix as quickly as possible before public disclosure. Reporting security vulnerabilities through the usual GitHub Issues channel is not ideal as it will publicize the flaw before a fix can be applied.

### SQL Lab Async
## SQL Lab Async

It's possible to configure a local database to operate in `async` mode,
to work on `async` related features.
Expand Down Expand Up @@ -46,7 +46,7 @@ Note that:
to your production environment, and use the similar broker as well as
results backend configuration

### Async Chart Queries
## Async Chart Queries

It's possible to configure database queries for charts to operate in `async` mode. This is especially useful for dashboards with many charts that may otherwise be affected by browser connection limits. To enable async queries for dashboards and Explore, the following dependencies are required:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ value in milliseconds in the JSON Metadata field:
Here, the entire dashboard will refresh at once if periodic refresh is on. The stagger time of 2.5
seconds is ignored.

**Why does ‘flask fab’ or superset freezed/hung/not responding when started (my home directory is
**Why does ‘flask fab’ or superset freeze/hang/not responding when started (my home directory is
NFS mounted)?**

By default, Superset creates and uses an SQLite database at `~/.superset/superset.db`. SQLite is
Expand Down
32 changes: 15 additions & 17 deletions docs/docusaurus.config.js → docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
* under the License.
*/

// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
import type {Config} from '@docusaurus/types'
import type { Options, ThemeConfig } from '@docusaurus/preset-classic';
import { themes } from 'prism-react-renderer'

const lightCodeTheme = require("prism-react-renderer").themes.github;
const darkCodeTheme = require("prism-react-renderer").themes.vsDark;
const { github: lightCodeTheme, vsDark: darkCodeTheme } = themes;

/** @type {import('@docusaurus/types').Config} */
const config = {
const config: Config = {
title: 'Superset',
tagline:
'Apache Superset is a modern data exploration and visualization platform',
Expand All @@ -33,8 +32,8 @@ const config = {
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: '/img/favicon.ico',
organizationName: 'apache', // Usually your GitHub org/user name.
projectName: 'superset', // Usually your repo name.
organizationName: 'apache',
projectName: 'superset',
themes: ['@saucelabs/theme-github-codeblock'],
plugins: [
[
Expand Down Expand Up @@ -199,8 +198,7 @@ const config = {
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
Expand All @@ -219,16 +217,16 @@ const config = {
theme: {
customCss: require.resolve('./src/styles/custom.css'),
},
}),
} satisfies Options,
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
{
colorMode: {
defaultMode: 'light',
disableSwitch: true,
defaultMode: 'dark',
disableSwitch: false,
respectPrefersColorScheme: true,
},
algolia: {
appId: 'WR5FASX5ED',
Expand Down Expand Up @@ -330,7 +328,7 @@ const config = {
hideable: true,
}
},
}),
} satisfies ThemeConfig,
scripts: [
'/script/matomo.js',
// {
Expand All @@ -340,4 +338,4 @@ const config = {
],
};

module.exports = config;
export default config;
12 changes: 1 addition & 11 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,23 @@
"typecheck": "tsc"
},
"dependencies": {
"@algolia/client-search": "^5.18.0",
"@ant-design/icons": "^5.5.2",
"@docsearch/react": "^3.8.2",
"@docusaurus/core": "^3.5.2",
"@docusaurus/plugin-client-redirects": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
"@emotion/core": "^10.1.1",
"@emotion/styled": "^10.0.27",
"@mdx-js/react": "^3.1.0",
"@saucelabs/theme-github-codeblock": "^0.3.0",
"@superset-ui/style": "^0.14.23",
"@svgr/webpack": "^8.1.0",
"antd": "^5.22.7",
"buffer": "^6.0.3",
"clsx": "^2.1.1",
"docusaurus-plugin-less": "^2.0.2",
"file-loader": "^6.2.0",
"less": "^4.2.2",
"less-loader": "^11.0.0",
"prism-react-renderer": "^2.4.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-github-btn": "^1.4.0",
"react-svg-pan-zoom": "^3.13.1",
"stream": "^0.0.3",
"swagger-ui-react": "^5.18.2",
"url-loader": "^4.1.1"
"swagger-ui-react": "^5.18.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.7.0",
Expand Down
24 changes: 4 additions & 20 deletions docs/src/pages/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const communityLinks = [
];

const StyledJoinCommunity = styled('section')`
background-color: var(--ifm-off-section-background);
background-color: var(--ifm-background-color);
border-bottom: 1px solid var(--ifm-border-color);
.list {
max-width: 540px;
Expand Down Expand Up @@ -118,7 +118,7 @@ const StyledJoinCommunity = styled('section')`
.description {
font-size: 14px;
line-height: 20px;
color: var(--ifm-secondary-text);
color: var(--ifm-font-base-color);
margin-top: -8px;
margin-bottom: 23px;
${mq[1]} {
Expand All @@ -143,22 +143,6 @@ const StyledCalendarIframe = styled('iframe')`
}
`;

const StyledNewsletterIframe = styled('iframe')`
display: block;
max-width: 1080px;
width: calc(100% - 40px);
height: 285px;
margin: 30px auto 20px;
border: 0;
@media (max-width: 1200px) {
height: 380px;
}
@media (max-width: 679px) {
height: 680px;
margin-top: 15px;
}
`;

const StyledLink = styled('a')`
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -224,8 +208,8 @@ const Community = () => {
</a>
}
title={
<a className="title" href={url} target="_blank">
{title}
<a href={url} target="_blank">
<p className="title" style={{marginBottom: 0}}>{title}</p>
</a>
}
description={<p className="description">{description}</p>}
Expand Down
3 changes: 0 additions & 3 deletions docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ const StyledFeaturesList = styled('ul')`
.item {
text-align: left;
border: 1px solid var(--ifm-border-color);
background-color: #ffffff;
border-radius: 10px;
overflow: hidden;
display: flex;
Expand All @@ -230,7 +229,6 @@ const StyledFeaturesList = styled('ul')`
}
.title {
font-size: 24px;
color: var(--ifm-primary-text);
margin: 10px 0 0;
${mq[1]} {
font-size: 23px;
Expand All @@ -240,7 +238,6 @@ const StyledFeaturesList = styled('ul')`
.description {
font-size: 17px;
line-height: 23px;
color: var(--ifm-secondary-text);
margin: 5px 0 0;
${mq[1]} {
font-size: 16px;
Expand Down
12 changes: 12 additions & 0 deletions docs/src/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,15 @@ ul.dropdown__menu svg {
--ifm-code-padding-vertical: 3px;
--ifm-code-padding-horizontal: 5px;
}

[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
--ifm-font-base-color: #bbb5ac;
--ifm-border-color: #797063;
}
3 changes: 1 addition & 2 deletions docs/src/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ a > span > svg {
.navbar {
font-size: 14px;
font-weight: 400;
background-color: #fff;
transition: all 0.5s;

.get-started-button {
Expand Down Expand Up @@ -190,7 +189,7 @@ a > span > svg {
.navbar .DocSearch {
--docsearch-text-color: #187384;
--docsearch-muted-color: #187384;
--docsearch-searchbox-background: #fff;
--docsearch-searchbox-background: var(--ifm-navbar-background-color);
border: 1px solid #187384;
border-radius: 10px;

Expand Down
2 changes: 0 additions & 2 deletions docs/static/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,5 @@ RewriteRule ^docs/installation/event-logging/$ /docs/configuration/event-logging

RewriteRule ^docs/databases.*$ /docs/configuration/databases [R=301,L]

RewriteRule ^docs/configuration/setup-ssh-tunneling$ /docs/configuration/networking-settings [R=301,L]

# pre-commit hooks documentation
RewriteRule ^docs/contributing/hooks-and-linting/$ /docs/contributing/development/#git-hooks-1
2 changes: 1 addition & 1 deletion docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@docusaurus/tsconfig/tsconfig.json",
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
},
Expand Down
Loading

0 comments on commit 2d88929

Please sign in to comment.