Skip to content

Commit

Permalink
Merge branch 'master' into tipsi-stripe
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun authored May 16, 2019
2 parents 6efd638 + 6767f8e commit fd51a0c
Show file tree
Hide file tree
Showing 245 changed files with 4,735 additions and 6,984 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ website/
scripts
packages/docusaurus-1.x/lib/core/metadata.js
packages/docusaurus-1.x/lib/core/MetadataBlog.js
packages/docusaurus-1.x/lib/core/__tests__/split-tab.test.js
10 changes: 7 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ module.exports = {
rules: {
'class-methods-use-this': OFF, // It's a way of allowing private variables.
'func-names': OFF,
'import/no-unresolved': WARNING, // Because it couldn't resolve webpack alias.
// Ignore certain webpack alias because it can't be resolved
'import/no-unresolved': [
ERROR,
{ignore: ['^@theme', '^@docusaurus', '^@generated']},
],
'header/header': [
ERROR,
'block',
Expand All @@ -42,8 +46,8 @@ module.exports = {
' ',
],
],
'jsx-a11y/click-events-have-key-events': OFF, // Revisit in future™
'jsx-a11y/no-noninteractive-element-interactions': OFF, // Revisit in future™
'jsx-a11y/click-events-have-key-events': WARNING,
'jsx-a11y/no-noninteractive-element-interactions': WARNING,
'no-console': OFF,
'no-underscore-dangle': OFF,
'react/jsx-closing-bracket-location': OFF, // Conflicts with Prettier.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ yarn-error.log
build
.docusaurus
.cache-loader

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist
node_modules
build
.docusaurus
.docusaurus
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ N/A
- Blog
- Documentation

[unreleased]: https://github.com/facebook/Docusaurus/compare/v1.8.0...HEAD
[unreleased]: https://github.com/facebook/Docusaurus/compare/v1.9.0...HEAD
[1.9.0]: https://github.com/facebook/Docusaurus/compare/v1.8.1...v1.9.0
[1.8.1]: https://github.com/facebook/Docusaurus/compare/v1.8.0...v1.8.1
[1.8.0]: https://github.com/facebook/Docusaurus/compare/v1.7.3...v1.8.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ We have also released the [`docusaurus-init` package](https://www.npmjs.com/pack

## Contributing

We've released Docusaurus because it helps us better scale and support the many OSS projects at Facebook. We hope that other organizations can benefit from the project. We are thankful for any contributions from the community.
We've released Docusaurus because it helps us better scale and supports the many OSS projects at Facebook. We hope that other organizations can benefit from the project. We are thankful for any contributions from the community.

### [Code of Conduct](https://code.fb.com/codeofconduct)

Expand Down
12 changes: 11 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
*/

module.exports = {
presets: ['@babel/env', '@babel/react'],
presets: [
[
'@babel/env',
{
targets: {
node: 'current',
},
},
],
'@babel/react',
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
Expand Down
6 changes: 5 additions & 1 deletion docs/api-site-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The default version for the site to be shown. If this is not set, the latest ver

#### `docsUrl` [string]

The base url for all docs file. Set this field to `''` to remove the `docs` prefix of the documentation URL.
The base url for all docs file. Set this field to `''` to remove the `docs` prefix of the documentation URL.
If unset, it is defaulted to `docs`.

#### `disableHeaderTitle` [boolean]
Expand Down Expand Up @@ -247,6 +247,10 @@ Hostname of your server. Useful if you are using GitHub Enterprise.

Path to your web app manifest (e.g., `manifest.json`). This will add a `<link>` tag to `<head>` with `rel` as `"manifest"` and `href` as the provided path.

#### `markdownOptions` [object]

Override default [Remarkable options](https://github.com/jonschlinkert/remarkable#options) that will be used to render markdown.

#### `markdownPlugins` [array]

An array of plugins to be loaded by Remarkable, the markdown parser and renderer used by Docusaurus. The plugin will receive a reference to the Remarkable instance, allowing custom parsing and rendering rules to be defined.
Expand Down
29 changes: 18 additions & 11 deletions docs/tutorial-create-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ module.exports = HelloWorld;
```

2. Go to http://localhost:3000/hello-world and you should be able to see the new page.
1. Change the text within the `<p>...</p>` to "I'm at F8!". The browser should refresh automatically to reflect the changes.
1. Change the text within the `<p>...</p>` to "I can write JSX here!". The browser should refresh automatically to reflect the changes.

```diff
- <p>This is my first page!</p>
+ <p>I'm at F8!</p>
+ <p>I can write JSX here!</p>
```

React is being used as a templating engine for rendering static markup. You can leverage on the expressability of React to build rich web content. Learn more about creating pages [here](custom-pages).
Expand All @@ -47,30 +47,37 @@ React is being used as a templating engine for rendering static markup. You can

## Create a Documentation Page

1. Create a new file in the `docs` folder called `f8.md`.
1. Create a new file in the `docs` folder called `doc4.md`.
1. Paste the following contents:

```
---
id: f8
title: Hello F8
id: doc4
title: This is Doc 4
---
Hello F8! I'm at the Docusaurus classroom session!
I can write content using [GitHub-flavored Markdown syntax](https://github.github.com/gfm/).
## Using Docusaurus to Create Open Source Websites
## Markdown Syntax
In this session, we learned how Docusaurus makes it really simple to create a website for open source project documentation and get hands on by creating a Docusaurus website.
**Bold** _italic_ `code` [Links](#url)
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
* Hey
* Ho
* Let's Go
```

3. Go to `sidebars.json` and add `"f8"` after `"doc1"`. This ID should be the same one as in the Markdown file above.
3. Go to `sidebars.json` and add `"doc4"` after `"doc1"`. This ID should be the same one as in the Markdown file above.

```diff
{
"docs": {
"Docusaurus": [
"doc1",
+ "f8"
+ "doc4"
],
"First Category": ["doc2"],
"Second Category": ["doc3"]
Expand All @@ -82,7 +89,7 @@ In this session, we learned how Docusaurus makes it really simple to create a we
```

4. Kill your webserver (<kbd>Cmd</kbd> + <kbd>C</kbd> or <kbd>Ctrl</kbd> + <kbd>C</kbd>) and restart it (with `npm run start`) because a server restart is needed for sidebar changes.
5. Navigate to http://localhost:3000/docs/f8.
5. Navigate to http://localhost:3000/docs/doc4.

You've created your first documentation page on Docusaurus! The `sidebars.json` is where you specify the order of your documentation pages and in the front matter of the Markdown file is where you provide metadata about that page.

Expand Down
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ module.exports = {
verbose: true,
testURL: 'http://localhost/',
testEnvironment: 'node',
moduleNameMapper: {
'^@lib/(.*)$': '<rootDir>/packages/docusaurus/lib/$1',
},
testPathIgnorePatterns: ['/node_modules/', '__fixtures__'],
transform: {
'^.+\\.js$': '<rootDir>/jest.transform.js',
'^.+\\.js$': 'babel-jest',
},
};
4 changes: 2 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.13.1",
"version": "2.0.0-alpha.12",
"lerna": "3.14.1",
"version": "2.0.0-alpha.16",
"npmClient": "yarn",
"useWorkspaces": true
}
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
"test": "jest"
},
"devDependencies": {
"babel-core": "^7.0.0-0",
"@babel/core": "^7.4.4",
"babel-eslint": "8",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.1",
"eslint": "4.x",
"eslint-config-airbnb": "17.1.0",
"eslint-config-prettier": "^2.9.0",
Expand All @@ -27,13 +29,13 @@
"front-matter": "^2.3.0",
"glob-promise": "^3.3.0",
"husky": "^1.3.1",
"jest": "^24.1.0",
"lerna": "^3.13.1",
"jest": "^24.6.0",
"lerna": "^3.14.1",
"lint-staged": "^7.2.0",
"prettier": "^1.13.7",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"rimraf": "^2.6.2"
"rimraf": "^2.6.3"
},
"lint-staged": {
"linters": {
Expand Down
Loading

0 comments on commit fd51a0c

Please sign in to comment.