Skip to content

Commit 0492ba5

Browse files
endilieyyangshun
authored andcommitted
v1.6.0 (#1133)
* v1.6.0 * nits changelog * typo
1 parent 61078e3 commit 0492ba5

File tree

9 files changed

+1356
-4
lines changed

9 files changed

+1356
-4
lines changed

CHANGELOG.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,49 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
## [1.6.0] - 2018-11-28
10+
11+
This releases includes few bug fixes and featurs. One notable feature allows user to change/remove `docs` prefix from the generated docusaurus URL.
12+
13+
Welcome to our newest users, [React-Slate](http://react-slate.surge.sh/), [Hemera](https://hemerajs.github.io/hemera/), [React-Redux](https://react-redux.js.org/), [Spectrum](https://libspectrum.io/), [TorchCraftAI](https://torchcraft.github.io/TorchCraftAI/), and [Haul](https://callstack.github.io/haul/).
14+
15+
Thank you to the following contributors who helped with this release:
16+
17+
- @yangshun
18+
- @endiliey
19+
- @JoelMarcey
20+
- @andrewShillito
21+
- @kahkhang
22+
- @domcorvasce
23+
- @ellereeeee
24+
- @maxaggedon
25+
- @gianlucadonato
26+
- @tsmrachel
27+
- @Shriram-Balaji
28+
- @noraj
29+
- @alexperez
30+
- @wgao19
31+
32+
### Fixed/Changed
33+
34+
- Live reload not working on second try ([#1103](https://github.com/facebook/Docusaurus/pull/1103))
35+
- Fix missing TOC on i18n pages ([#1119](https://github.com/facebook/Docusaurus/pull/1119))
36+
- Fix docusaurus-version not working for subcategory in sidebar ([#1124](https://github.com/facebook/Docusaurus/pull/1124))
37+
- Fix docusaurus-version to allow duplicate id in different subdirectory ([#1125](https://github.com/facebook/Docusaurus/pull/1125))
38+
39+
## Docs
40+
- Add guide on setting custom docs path ([#1098](https://github.com/facebook/Docusaurus/pull/1098))
41+
- Document that `website` folder can be renamed ([#1106](https://github.com/facebook/Docusaurus/pull/1106))
42+
- Specify markdown flavor ([#1118](https://github.com/facebook/Docusaurus/pull/1118))
43+
44+
### Added
45+
46+
- Allow modifying/removing `docs` route in generated url ([#914](https://github.com/facebook/Docusaurus/pull/914))
47+
- Use `sidebar_label` in addition to `title` for prev/next button ([#1122](https://github.com/facebook/Docusaurus/pull/1122))
48+
- Warn the users if any unresolved markdown links ([#1116](https://github.com/facebook/Docusaurus/pull/1116))
49+
- Customizable search placeholder ([#1126](https://github.com/facebook/Docusaurus/pull/1126))
50+
- New feature of displaying the last contributor to each document ([#980](https://github.com/facebook/Docusaurus/pull/980))
51+
952
## [1.5.1] - 2018-11-03
1053

1154
A release where we had many external contributors! Very excited to see the community being involved in the project.
@@ -836,7 +879,9 @@ N/A
836879
- Blog
837880
- Documentation
838881

839-
[unreleased]: https://github.com/facebook/Docusaurus/compare/v1.5.0...HEAD
882+
[unreleased]: https://github.com/facebook/Docusaurus/compare/v1.6.0...HEAD
883+
[1.6.0]: https://github.com/facebook/Docusaurus/compare/v1.5.1...v1.6.0
884+
[1.5.1]: https://github.com/facebook/Docusaurus/compare/v1.4.0...v1.5.1
840885
[1.5.0]: https://github.com/facebook/Docusaurus/compare/v1.4.0...v1.5.0
841886
[1.4.0]: https://github.com/facebook/Docusaurus/compare/v1.3.3...v1.4.0
842887
[1.3.3]: https://github.com/facebook/Docusaurus/compare/v1.3.2...v1.3.3

v1/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"name": "docusaurus",
33
"description": "Easy to Maintain Open Source Documentation Websites",
4-
"version": "1.5.1",
4+
"version": "1.6.0",
55
"license": "MIT",
6-
"keywords": ["documentation", "websites", "open source", "docusaurus"],
6+
"keywords": [
7+
"documentation",
8+
"websites",
9+
"open source",
10+
"docusaurus"
11+
],
712
"repository": {
813
"type": "git",
914
"url": "https://github.com/facebook/Docusaurus.git"
@@ -15,7 +20,11 @@
1520
"start": "cd website && yarn start"
1621
},
1722
"jest": {
18-
"testPathIgnorePatterns": ["/node_modules/", "__fixtures__", "v2"],
23+
"testPathIgnorePatterns": [
24+
"/node_modules/",
25+
"__fixtures__",
26+
"v2"
27+
],
1928
"testURL": "http://localhost/",
2029
"transform": {
2130
"^.+\\.js$": "<rootDir>/jest.transform.js"
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
---
2+
id: version-1.6.0-doc-markdown
3+
title: Markdown Features
4+
original_id: doc-markdown
5+
---
6+
7+
Docusaurus uses [GitHub Flavored Markdown (GFM)](https://guides.github.com/features/mastering-markdown/). Find out more about Docusaurus-specific fields when writing Markdown.
8+
9+
## Markdown Headers
10+
11+
### Documents
12+
13+
Documents use the following markdown header fields that are enclosed by a line `---` on either side:
14+
15+
`id`: A unique document id. If this field is not present, the document's `id` will default to its file name (without the extension).
16+
17+
`title`: The title of your document. If this field is not present, the document's `title` will default to its `id`.
18+
19+
`hide_title`: Whether to hide the title at the top of the doc.
20+
21+
`sidebar_label`: The text shown in the document sidebar and in the next/previous button for this document. If this field is not present, the document's `sidebar_label` will default to its `title`.
22+
23+
For example:
24+
25+
```yaml
26+
---
27+
id: doc1
28+
title: My Document
29+
sidebar_label: Document
30+
---
31+
```
32+
33+
Versioned documents have their ids altered to include the version number when they get copied. The new `id` is `version-${version}-${id}` where `${version}` is the version number of that document and `${id}` is the original `id`. Additionally, versioned documents get an added `original_id` field with the original document id.
34+
35+
For example:
36+
37+
```yaml
38+
---
39+
id: version-1.0.0-doc1
40+
title: My Document
41+
sidebar_label: Document
42+
original_id: doc1
43+
---
44+
```
45+
46+
`custom_edit_url`: The URL for editing this document. If this field is not present, the document's edit URL will fall back to `editUrl` from optional fields of `siteConfig.js`. See [siteConfig.js](site-config.md) docs for more information.
47+
48+
For example:
49+
50+
```yaml
51+
---
52+
id: doc-markdown
53+
title: Markdown Features
54+
custom_edit_url: https://github.com/facebook/Docusaurus/edit/master/docs/api-doc-markdown.md
55+
---
56+
```
57+
58+
### Blog Posts
59+
60+
Blog posts use the following markdown header fields that are enclosed by a line `---` on either side:
61+
62+
`title`: The title of this blog post.
63+
64+
`author`: The author of this blog post. If this field is omitted, no author name will be shown.
65+
66+
`authorURL`: A page to link to when a site user clicks the author's name. If this field is omitted, the author's name will not link to anything.
67+
68+
`authorFBID`: The author's Facebook id, used only to get the author's profile picture to display with the blog post. If this field is omitted, no author picture will be shown for the blog post.
69+
70+
For example:
71+
72+
```yaml
73+
---
74+
title: My First Blog Post
75+
author: Frank Li
76+
authorURL: http://twitter.com/franchementli
77+
authorFBID: 100002976521003
78+
---
79+
```
80+
81+
## Extra Features
82+
83+
Docusaurus supports some extra features when writing documentation in markdown.
84+
85+
### Linking other Documents
86+
87+
You can use relative URLs to other documentation files which will automatically get converted to the corresponding HTML links when they get rendered.
88+
89+
Example:
90+
91+
```md
92+
[This links to another document](other-document.md)
93+
```
94+
95+
This markdown will automatically get converted into a link to `/docs/other-document.html` (or the appropriately translated/versioned link) once it gets rendered.
96+
97+
This can help when you want to navigate through docs on GitHub since the links there will be functional links to other documents (still on GitHub), but the documents will have the correct HTML links when they get rendered.
98+
99+
### Linking to Images and Other Assets
100+
101+
Static assets can be linked to in the same way that documents are, using relative URLs. Static assets used in documents and blogs should go into `docs/assets` and `website/blog/assets`, respectively. The markdown will get converted into correct link paths so that these paths will work for documents of all languages and versions.
102+
103+
Example:
104+
105+
```md
106+
![alt-text](assets/doc-image.png)
107+
```
108+
109+
### Generating Table of Contents
110+
111+
You can make an auto-generated list of links, which can be useful as a table of contents for API docs.
112+
113+
In your markdown file, insert a line with the text `<AUTOGENERATED_TABLE_OF_CONTENTS>`. Write your documentation using `h3` headers for each function inside a code block. These will be found by Docusaurus and a list of links to these sections will inserted at the text `<AUTOGENERATED_TABLE_OF_CONTENTS>`.
114+
115+
Example:
116+
117+
```md
118+
### `docusaurus.function(a, b)`
119+
120+
Text describing my function
121+
122+
### `docdoc(file)`
123+
124+
Text describing my function
125+
```
126+
127+
will lead to a table of contents of the functions:
128+
129+
```md
130+
- `docusaurus.function(a, b)`
131+
- `docdoc(file)`
132+
```
133+
134+
and each function will link to their corresponding sections in the page.
135+
136+
## Syntax Highlighting
137+
138+
Syntax highlighting is enabled by default on fenced code blocks. The language should be detected automatically, but you can sometimes get better results by specifying the language. You can do so using an [info string](https://github.github.com/gfm/#example-111), following the three opening backticks. The following JavaScript example...
139+
140+
```js
141+
ReactDOM.render(<h1>Hello, world!</h1>, document.getElementById('root'));
142+
```
143+
144+
...would be rendered with syntax highlighting like so:
145+
146+
```js
147+
ReactDOM.render(<h1>Hello, world!</h1>, document.getElementById('root'));
148+
```
149+
150+
Highlighting is provided by [Highlight.js](https://highlightjs.org) using the theme specified in your `siteConfig.js` file as part of the `highlight` key:
151+
152+
```js
153+
{
154+
...
155+
highlight: {
156+
theme: 'default'
157+
}
158+
...
159+
}
160+
```
161+
162+
You can find the full list of supported themes in the Highlight.js [`styles`](https://github.com/isagalaev/highlight.js/tree/master/src/styles) directory.
163+
164+
### Registering additional languages
165+
166+
While Highlight.js provides support for [many popular languages out of the box](https://highlightjs.org/static/demo/), you may find the need to register additional language support. For these cases, we provide an escape valve by exposing the `hljs` constant as part of the `highlight` config key. This in turn allows you to call [`registerLanguage`](http://highlightjs.readthedocs.io/en/latest/api.html#registerlanguage-name-language):
167+
168+
```js
169+
{
170+
...
171+
highlight: {
172+
theme: 'default',
173+
hljs: function(hljs) {
174+
hljs.registerLanguage('galacticbasic', function(hljs) {
175+
// ...
176+
});
177+
}
178+
}
179+
}
180+
```
181+
182+
### Using Prism as additional syntax highlighter
183+
184+
You can also opt to use Prism to syntax highlight certain languages available in the list [here](https://github.com/PrismJS/prism/tree/master/components). Include those languages in `usePrism` field in your [siteConfig.js](api-site-config.md)
185+
186+
Example:
187+
188+
```
189+
// siteConfig.js
190+
usePrism: ['jsx']
191+
```
192+
193+
Notice that the code block below uses JSX syntax highlighting from Prism.
194+
195+
```jsx
196+
class Example extends React.Component {
197+
render() {
198+
return (
199+
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
200+
<Text>Docusaurus</Text>
201+
<Button
202+
title="Click me"
203+
onPress={() => this.props.navigation.push('Docusaurus')}
204+
/>
205+
</View>
206+
);
207+
}
208+
}
209+
```
210+
211+
### Adding Copy Code Buttons
212+
213+
Docusaurus allows for adding buttons to copy code within fenced code blocks. Please follow the instructions [here](https://gist.github.com/yangshun/55db997ed0f8f4e6527571fc3bee4675) to add "Copy" buttons to your code blocks.

0 commit comments

Comments
 (0)