Skip to content

Commit

Permalink
add initial docusaurus build
Browse files Browse the repository at this point in the history
  • Loading branch information
PedramNavid committed Aug 10, 2024
1 parent a95f0d6 commit 8c14773
Show file tree
Hide file tree
Showing 22 changed files with 3,040 additions and 222 deletions.
4 changes: 4 additions & 0 deletions docs/docs-next/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.docusaurus
build/
docs/
3 changes: 3 additions & 0 deletions docs/docs-next/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
}
5 changes: 2 additions & 3 deletions docs/docs-next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
### Installation

```
$ pnpm install
$ pnpm install
```

### Local Development
Expand All @@ -14,7 +14,7 @@ $ pnpm install
$ pnpm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the serverta

### Build

Expand All @@ -26,7 +26,6 @@ This command generates static content into the `build` directory and can be serv

### Deployment


```
pnpm deploy
```
2 changes: 1 addition & 1 deletion docs/docs-next/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
};
Empty file added docs/docs-next/docs/api.md
Empty file.
12 changes: 6 additions & 6 deletions docs/docs-next/docs/tutorial-basics/create-a-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Add metadata to customize the sidebar label and position:

```md title="docs/hello.md" {1-4}
---
sidebar_label: 'Hi!'
sidebar_label: "Hi!"
sidebar_position: 3
---

Expand All @@ -44,13 +44,13 @@ It is also possible to create your sidebar explicitly in `sidebars.js`:
```js title="sidebars.js"
export default {
tutorialSidebar: [
'intro',
"intro",
// highlight-next-line
'hello',
"hello",
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
type: "category",
label: "Tutorial",
items: ["tutorial-basics/create-a-document"],
},
],
};
Expand Down
4 changes: 2 additions & 2 deletions docs/docs-next/docs/tutorial-basics/create-a-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Add **Markdown or React** files to `src/pages` to create a **standalone page**:
Create a file at `src/pages/my-react-page.js`:

```jsx title="src/pages/my-react-page.js"
import React from 'react';
import Layout from '@theme/Layout';
import React from "react";
import Layout from "@theme/Layout";

export default function MyReactPage() {
return (
Expand Down
13 changes: 7 additions & 6 deletions docs/docs-next/docs/tutorial-basics/markdown-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,19 @@ This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
This is <Highlight color="#1877F2">Facebook blue</Highlight> !
```

export const Highlight = ({children, color}) => (
export const Highlight = ({ children, color }) => (
<span
style={{
backgroundColor: color,
borderRadius: '20px',
color: '#fff',
padding: '10px',
cursor: 'pointer',
borderRadius: "20px",
color: "#fff",
padding: "10px",
cursor: "pointer",
}}
onClick={() => {
alert(`You clicked the color ${color} with label ${children}`);
}}>
}}
>
{children}
</span>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
items: [
// highlight-start
{
type: 'docsVersionDropdown',
type: "docsVersionDropdown",
},
// highlight-end
],
Expand Down
6 changes: 3 additions & 3 deletions docs/docs-next/docs/tutorial-extras/translate-your-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Modify `docusaurus.config.js` to add support for the `fr` locale:
```js title="docusaurus.config.js"
export default {
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
defaultLocale: "en",
locales: ["en", "fr"],
},
};
```
Expand Down Expand Up @@ -60,7 +60,7 @@ export default {
items: [
// highlight-start
{
type: 'localeDropdown',
type: "localeDropdown",
},
// highlight-end
],
Expand Down
182 changes: 97 additions & 85 deletions docs/docs-next/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,128 +1,140 @@
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import { themes as prismThemes } from "prism-react-renderer";
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";

const config: Config = {
title: 'My Site',
tagline: 'Dinosaurs are cool',
favicon: 'img/favicon.ico',
title: "Dagster Docs - Beta",
tagline:
"Dagster is a Python framework for building production-grade data platforms.",
url: "https://docs.dagster.io",
favicon: "img/favicon.ico",

// Set the production url of your site here
url: 'https://your-docusaurus-site.example.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
organizationName: "dagster",
projectName: "dagster",
markdown: {
mermaid: true,
},

presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
routeBasePath: '/',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
blog: false,
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],

themes: ["@docusaurus/theme-mermaid"],
i18n: { defaultLocale: "en", locales: ["en"] },
plugins: ["docusaurus-plugin-sass"],
themeConfig: {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
colorMode: {
defaultMode: "dark",
disableSwitch: false,
respectPrefersColorScheme: true,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ["diff", "json"],
},
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 4,
},
navbar: {
title: 'My Site',
title: "Dagster Docs - Beta",
style: "dark",
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
alt: "Dagster Logo",
src: "img/logo.svg",
href: "/",
},
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Tutorial',
label: "Docs",
type: "doc",
docId: "intro",
position: "left",
},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
position: 'right',
label: "API",
type: "doc",
docId: "api",
position: "left",
},
{
href: "https://github.com/dagster-io/dagster",
label: "GitHub",
position: "right",
},
],
},
image: "img/docusaurus-social-card.jpg",
docs: {
sidebar: {
autoCollapseCategories: false,
},
},

footer: {
style: 'dark',
style: "dark",
logo: {
alt: "Dagster Logo",
src: "img/logo.svg",
href: "/",
},
links: [
{
title: 'Docs',
title: "Docs",
items: [
{
label: 'Tutorial',
to: '/docs/intro',
label: "Tutorial",
to: "/intro",
},
],
},
{
title: 'Community',
title: "Community",
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
label: "Stack Overflow",
href: "https://stackoverflow.com/questions/tagged/dagster",
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
label: "Twitter",
href: "https://twitter.com/dagster",
},
],
},
{
title: 'More',
title: "More",
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
label: "GitHub",
href: "https://github.com/dagster-io/dagster",
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
copyright: `Copyright © ${new Date().getFullYear()} Dagster Labs.`,
},
} satisfies Preset.ThemeConfig,
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: "./sidebars.ts",
routeBasePath: "/",
editUrl:
"https://github.com/dagster-io/dagster/tree/main/docs/docs-next",
},
blog: false,
theme: {
customCss: [
require.resolve(
"./node_modules/modern-normalize/modern-normalize.css"
),
require.resolve("./src/styles/custom.scss"),
],
},
} satisfies Preset.Options,
],
],
};

export default config;
17 changes: 17 additions & 0 deletions docs/docs-next/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";

export default [
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
rules: {
"react/react-in-jsx-scope": "off",
},
},
];
Loading

0 comments on commit 8c14773

Please sign in to comment.