diff --git a/v2/docs/foo/bar.md b/v2/docs/foo/bar.md deleted file mode 100644 index 087b4b9ca2..0000000000 --- a/v2/docs/foo/bar.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: bar -title: My Title ---- - -# Remarkable - -> Experience real-time editing with Remarkable! - -Click the `clear` link to start with a clean slate, or get the `permalink` to share or save your results. - -*** - -# h1 Heading -## h2 Heading -### h3 Heading -#### h4 Heading -##### h5 Heading -###### h6 Heading - - -## Horizontal Rules - -This is horizontal rule - -___ - -*** - -*** - - -## Emphasis - -**This is bold text** - -__This is bold text__ - -*This is italic text* - -_This is italic text_ - -~~Deleted text~~ - -Superscript: 19^th^ - -Subscript: H~2~O - -++Inserted text++ - -==Marked text== diff --git a/v2/docs/foo/baz.md b/v2/docs/foo/baz.md deleted file mode 100644 index 9737bc2d57..0000000000 --- a/v2/docs/foo/baz.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -id: baz -title: Markdown ---- - -## Images - -![Sakura](/img/sakura.png) - -Like links, Images also have a footnote style syntax - -![Alt text][id] - -With a reference later in the document defining the URL location: - -## Links - -[link text](http://dev.nodeca.com) - -[link with title](http://nodeca.github.io/pica/demo/ 'title text!') - -Autoconverted link https://github.com/nodeca/pica (enable linkify to see) - -## Footnotes - -Footnote 1 link[^first]. - -Footnote 2 link[^second]. - -Inline footnote^[Text of inline footnote] definition. - -Duplicated footnote reference[^second]. - -[^first]: Footnote **can have markup** - - and multiple paragraphs. - -[^second]: Footnote text. - -## Definition lists - -Term 1 - -: Definition 1 with lazy continuation. - -Term 2 with _inline markup_ - -: Definition 2 - - { some code, part of Definition 2 } - - Third paragraph of definition 2. - -_Compact style:_ - -Term 1 ~ Definition 1 - -Term 2 ~ Definition 2a ~ Definition 2b - -## Abbreviations - -This is HTML abbreviation example. - -It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on. - -\*[HTML]: Hyper Text Markup Language diff --git a/v2/docs/hello.md b/v2/docs/hello.md deleted file mode 100644 index 06ef69483e..0000000000 --- a/v2/docs/hello.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -id: hello -title: Hello, World! ---- - -## Relative links - -Replace this [highlight](highlight.md) [docusaurus](docusaurus.md) - -Can't replace this [file](file.md) - -Do not replace below - -``` -[highlight](highlight.md) [docusaurus](docusaurus.md) -``` - -## Blockquotes - -> Blockquotes can also be nested... -> -> > ...by using additional greater-than signs right next to each other... -> > -> > > ...or with spaces between arrows. - -## Lists - -Unordered - -- Create a list by starting a line with `+`, `-`, or `*` -- Sub-lists are made by indenting 2 spaces: - - Marker character change forces new list start: - - Ac tristique libero volutpat at - * Facilisis in pretium nisl aliquet - - Nulla volutpat aliquam velit -- Very easy! - -Ordered - -1. Lorem ipsum dolor sit amet -2. Consectetur adipiscing elit -3. Integer molestie lorem at massa - -1) You can use sequential numbers... -1) ...or keep all the numbers as `1.` - -Start numbering with offset: - -57. foo -1. bar diff --git a/v2/docs/highlight.md b/v2/docs/highlight.md deleted file mode 100644 index e6f8013f03..0000000000 --- a/v2/docs/highlight.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -id: code -title: Code ---- - -```cpp -#include -using namespace std; - -int main() { - cout << "Hello world\n"; - return 0; -} -``` - -```cpp -#include -using namespace std; - -int main() -{ - int n, i; - bool isPrime = true; - - cout << "Enter a positive integer: "; - cin >> n; - - for(i = 2; i <= n / 2; ++i) - { - if(n % i == 0) - { - isPrime = false; - break; - } - } - if (isPrime) - cout << "This is a prime number"; - else - cout << "This is not a prime number"; - - return 0; -} -``` diff --git a/v2/docs/intro.md b/v2/docs/intro.md deleted file mode 100644 index f31b9121b2..0000000000 --- a/v2/docs/intro.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: intro -title: Introduction ---- - -

-

Docusaurus

- Docusaurus -

- -

- npm version - CircleCI Status - PRs Welcome - Chat - code style: prettier - Tested with Jest -

- -## Introduction - -Docusaurus is a project for easily building, deploying, and maintaining open source project websites. - -- **Simple to Start** Docusaurus is built to be easy to [get up and running](https://docusaurus.io/docs/en/installation.html) in as little time possible. We've built Docusaurus to handle the website build process so you can focus on your project. -- **Localizable** Docusaurus ships with [localization support](https://docusaurus.io/docs/en/translation.html) via CrowdIn. Empower and grow your international community by translating your documentation. -- **Customizable** While Docusaurus ships with the key pages and sections you need to get started, including a home page, a docs section, a [blog](https://docusaurus.io/docs/en/blog.html), and additional support pages, it is also [customizable](https://docusaurus.io/docs/en/custom-pages.html) as well to ensure you have a site that is [uniquely yours](https://docusaurus.io/docs/en/api-pages.html). diff --git a/v2/lib/commands/build.js b/v2/lib/commands/build.js index 1d06e681e4..a1c06b994a 100644 --- a/v2/lib/commands/build.js +++ b/v2/lib/commands/build.js @@ -30,10 +30,9 @@ function compile(config) { }); } -module.exports = async function build(siteDir, cliOptions = {}) { +module.exports = async function build(siteDir) { process.env.NODE_ENV = 'production'; console.log('Build command invoked ...'); - console.log(cliOptions); const props = await load(siteDir); diff --git a/v2/lib/commands/start.js b/v2/lib/commands/start.js index 734523f5e8..581eee8445 100644 --- a/v2/lib/commands/start.js +++ b/v2/lib/commands/start.js @@ -27,7 +27,6 @@ async function getPort(reqPort) { module.exports = async function start(siteDir, cliOptions = {}) { console.log('Start command invoked ...'); - console.log(cliOptions); // Process all related files as a prop const props = await load(siteDir); diff --git a/v2/lib/theme/Doc/index.js b/v2/lib/theme/Doc/index.js index f978167e19..8844f49efb 100644 --- a/v2/lib/theme/Doc/index.js +++ b/v2/lib/theme/Doc/index.js @@ -38,7 +38,10 @@ class Doc extends React.Component { />
-
{this.props.children}
+
+

{metadata.title}

+ {this.props.children} +
- {/* This is for v2 development only to know which are the available routes */} + {/* This is for v2 development only to know which are the available page */}

Pages

    @@ -80,19 +80,6 @@ function Footer(props) { ))}
-
-

Docs

-
    - {Object.values(props.docsMetadatas).map(metadata => ( -
  • - - {metadata.title} - -
  • - ))} -
-
- {/* Remove above when launching v2 */}
Copyright © {new Date().getFullYear()} Facebook Inc. diff --git a/v2/lib/theme/Navbar/index.js b/v2/lib/theme/Navbar/index.js index 86fc96b390..d8acc3fe75 100644 --- a/v2/lib/theme/Navbar/index.js +++ b/v2/lib/theme/Navbar/index.js @@ -3,7 +3,7 @@ import {NavLink} from 'react-router-dom'; import styles from './styles.css'; -function Navbar(props) { +function Navbar() { return ( diff --git a/v2/lib/webpack/base.js b/v2/lib/webpack/base.js index 865d0d19d9..2ec8d72829 100644 --- a/v2/lib/webpack/base.js +++ b/v2/lib/webpack/base.js @@ -43,6 +43,12 @@ module.exports = function createBaseConfig(props, isServer) { .set('@build', outDir) .set('@generated', path.resolve(__dirname, '../core/generated')) .set('@core', path.resolve(__dirname, '../core')) + // For loading docs from custom paths where React is not available. + // TODO(yangshun): Change loader to convert return HTML instead of React component. + .set( + 'DOCUSAURUS_NODE_MODULES_PATH_DO_NOT_USE_OR_YOU_WILL_BE_FIRED', + path.resolve(__dirname, '../../node_modules/'), + ) .end(); function applyBabel(rule) { diff --git a/v2/lib/webpack/loader/markdown.js b/v2/lib/webpack/loader/markdown.js index 244205bf7b..c38777a15c 100644 --- a/v2/lib/webpack/loader/markdown.js +++ b/v2/lib/webpack/loader/markdown.js @@ -65,13 +65,12 @@ module.exports = function(fileString) { } /* Return a React component */ - return ( - `import React from 'react';\n` + - `import Markdown from '@theme/Markdown'\n` + - `export default () => ( - - {${JSON.stringify(content)}} - - );` - ); + return ` +import React from 'DOCUSAURUS_NODE_MODULES_PATH_DO_NOT_USE_OR_YOU_WILL_BE_FIRED/react'; +import Markdown from '@theme/Markdown'; +export default () => ( + + {${JSON.stringify(content)}} + +);`; }; diff --git a/v2/website/sidebars.json b/v2/website/sidebars.json index 2f65984190..da7246cf9a 100644 --- a/v2/website/sidebars.json +++ b/v2/website/sidebars.json @@ -1,9 +1,20 @@ { "docs": { - "Category 1": { - "Subcategory 1": ["foo/bar", "foo/baz"], - "Subcategory 2": ["hello"] - }, - "Category 2": ["intro", "code"] + "Getting Started": [ + "installation", + "site-preparation", + "site-creation", + "publishing", + "docker" + ], + "Guides": [ + "adding-blog", + "custom-pages", + "search", + "navigation", + "translation", + "versioning" + ], + "API": ["commands", "doc-markdown", "api-pages", "site-config"] } } diff --git a/v2/website/siteConfig.js b/v2/website/siteConfig.js index 4c1f06bce3..cc746896ca 100644 --- a/v2/website/siteConfig.js +++ b/v2/website/siteConfig.js @@ -4,4 +4,5 @@ module.exports = { organizationName: 'facebook', projectName: 'docusaurus', baseUrl: '/', + customDocsPath: '../docs', }; diff --git a/v2/website/static/img/sakura.png b/v2/website/static/img/sakura.png deleted file mode 100644 index e10909398b..0000000000 Binary files a/v2/website/static/img/sakura.png and /dev/null differ