Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(v2): minor tweaks #4981

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions website/docs/api/plugins/plugin-content-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ module.exports = {
*/
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
/**
* For advanced cases, compute the edit url for each markdown file yourself.
* For advanced cases, compute the edit url for each Markdown file yourself.
*/
editUrl: ({locale, blogDirPath, blogPath, permalink}) => {
return `https://github.com/facebook/docusaurus/edit/master/website/${blogDirPath}/${blogPath}`;
},
/**
* Useful if you commit localized files to git.
* When markdown files are localized, the edit url will target the localized file,
* When Markdown files are localized, the edit url will target the localized file,
* instead of the original unlocalized file.
* Note: this option is ignored when editUrl is a function
*/
Expand Down
4 changes: 2 additions & 2 deletions website/docs/api/plugins/plugin-content-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
*/
editUrl: 'https://github.com/facebook/docusaurus/edit/master/website/',
/**
* For advanced cases, compute the edit url for each markdown file yourself.
* For advanced cases, compute the edit url for each Markdown file yourself.
*/
editUrl: function ({
locale,
Expand All @@ -49,7 +49,7 @@ module.exports = {
},
/**
* Useful if you commit localized files to git.
* When markdown files are localized, the edit url will target the localized file,
* When Markdown files are localized, the edit url will target the localized file,
* instead of the original unlocalized file.
* Note: this option is ignored when editUrl is a function
*/
Expand Down
2 changes: 1 addition & 1 deletion website/docs/api/themes/theme-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ website/i18n/<locale>/docusaurus-theme-classic

### `useThemeContext` {#usethemecontext}

React hook to access theme context. This context contains functions for setting light and dark mode and boolean property, indicating which mode is currently in use.
React hook to access theme context. This context contains functions for setting light and dark mode and exposes boolean variable, indicating which mode is currently in use.

Usage example:

Expand Down
6 changes: 3 additions & 3 deletions website/docs/blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The only required field is `title`; however, we provide options to add author in
- `author_title`: A description of the author.
- `title`: The blog post title.
- `slug`: Allows to customize the blog post url (`/<routeBasePath>/<slug>`). Support multiple patterns: `slug: my-blog-post`, `slug: /my/path/to/blog/post`, slug: `/`.
- `date`: The blog post creation date. If not specified, this could be extracted from the file name, e.g, `2021-04-15-blog-post.mdx`. By default, it is the markdown file creation time.
- `date`: The blog post creation date. If not specified, this could be extracted from the file name, e.g, `2021-04-15-blog-post.mdx`. By default, it is the Markdown file creation time.
- `tags`: A list of strings or objects of two string fields `label` and `permalink` to tag to your post.
- `draft`: A boolean flag to indicate that the blog post is work-in-progress and therefore should not be published yet. However, draft blog posts will be displayed during development.
- `description`: The description of your post, which will become the `<meta name="description" content="..."/>` and `<meta property="og:description" content="..."/>` in `<head>`, used by search engines. If this field is not present, it will default to the first line of the contents.
Expand Down Expand Up @@ -145,7 +145,7 @@ https://{your-domain}/blog/atom.xml

You can run your Docusaurus 2 site without a landing page and instead have your blog's post list page as the index page. Set the `routeBasePath` to be `'/'` to indicate it's the root path.

```js {9} title="docusaurus.config.js"
```js {10} title="docusaurus.config.js"
module.exports = {
// ...
presets: [
Expand Down Expand Up @@ -180,7 +180,7 @@ module.exports = {
{
blog: {
blogTitle: 'Docusaurus blog!',
blogDescription: 'A docusaurus powered blog!',
blogDescription: 'A Docusaurus powered blog!',
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion website/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Please note that some functionality (for example, anchor links) will not work in

:::

#### Enabling HTTPS` {#enabling-https}
#### Enabling HTTPS {#enabling-https}

There are multiple ways to obtain a certificate. We will use [mkcert](https://github.com/FiloSottile/mkcert) as an example.

Expand Down
6 changes: 5 additions & 1 deletion website/docs/guides/docs/docs-create-doc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Create a Markdown Document
slug: /create-doc
---

Create a markdown file, `greeting.md`, and place it under the `docs` directory.
Create a Markdown file, `greeting.md`, and place it under the `docs` directory.

```bash
website # root directory of your site
Expand Down Expand Up @@ -76,4 +76,8 @@ The headers are well-spaced so that the hierarchy is clear.
- and you may nest them
- multiple times

<h3 id="custom-id">Custom id headers</h3>

With <code>{#custom-id}</code> syntax you can set your own header id.

</BrowserWindow>
2 changes: 1 addition & 1 deletion website/docs/guides/docs/docs-markdown-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Docusaurus Markdown features that are specific to the docs plugin
slug: /docs-markdown-features
---

Docs can use any [Markdown feature](../markdown-features/markdown-features-intro.mdx), and have a few additional Docs-specific markdown features.
Docs can use any [Markdown feature](../markdown-features/markdown-features-intro.mdx), and have a few additional docs-specific Markdown features.

## Markdown frontmatter {#markdown-frontmatter}

Expand Down
4 changes: 2 additions & 2 deletions website/docs/guides/docs/sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module.exports = {

## Using multiple sidebars {#using-multiple-sidebars}

You can create a sidebar for each **set of markdown files** that you want to **group together**.
You can create a sidebar for each **set of Markdown files** that you want to **group together**.

:::tip

Expand Down Expand Up @@ -496,7 +496,7 @@ docs

To make it **easier to adopt**, Docusaurus supports **multiple number prefix patterns**.

By default, Docusaurus will **remove the number prefix** from the doc id, title, label and url paths.
By default, Docusaurus will **remove the number prefix** from the doc id, title, label and URL paths.

:::caution

Expand Down
2 changes: 1 addition & 1 deletion website/docs/guides/docs/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ As a good rule of thumb, try to keep the number of your versions below 10. **It

### Use absolute import within the docs {#use-absolute-import-within-the-docs}

Don't use relative paths import within the docs. Because when we cut a version the paths no longer work (the nesting level is different, among other reasons). You can utilize the `@site` alias provided by docusaurus, that points to the `website` directory. Example:
Don't use relative paths import within the docs. Because when we cut a version the paths no longer work (the nesting level is different, among other reasons). You can utilize the `@site` alias provided by Docusaurus, that points to the `website` directory. Example:

```diff
- import Foo from '../src/components/Foo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Handling assets in Docusaurus Markdown
slug: /markdown-features/assets
---

Sometimes you want to link to static assets directly from Markdown files, and it is convenient to co-locate the asset next to the markdown file using it.
Sometimes you want to link to static assets directly from Markdown files, and it is convenient to co-locate the asset next to the Markdown file using it.

We have setup Webpack loaders to handle most common file types, so that when you import a file, you get its url, and the asset is automatically copied to the output folder.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /markdown-features/inline-toc

import BrowserWindow from '@site/src/components/BrowserWindow';

Each markdown document displays a tab of content on the top-right corner.
Each Markdown document displays a tab of content on the top-right corner.

But it is also possible to display an inline table of contents directly inside a markdown document, thanks to MDX.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ By default, tabs are rendered eagerly, but it is possible to load them lazily by

## Displaying a default tab

Set the `defaultValue` property in the `Tabs` component to the label value of your choice to show the matching tab by default.
Set the `defaultValue` prop in the `Tabs` component to the label value of your choice to show the matching tab by default.

For example, in the example above, `defaultValue="apple"` forces the `Apple` tab to be open by default.

If the `defaultValue` property is not provided or refers to an non-existing value, only the tab headings appear until the user clicks on a tab.
If the `defaultValue` prop is not provided or refers to an non-existing value, only the tab headings appear until the user clicks on a tab.

## Syncing tab choices {#syncing-tab-choices}

Expand Down
2 changes: 1 addition & 1 deletion website/docs/lifecycle-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ module.exports = function (context, options) {

## `extendCli(cli)` {#extendclicli}

Register an extra command to enhance the CLI of docusaurus. `cli` is [commander](https://www.npmjs.com/package/commander) object.
Register an extra command to enhance the CLI of Docusaurus. `cli` is [commander](https://www.npmjs.com/package/commander) object.

Example:

Expand Down
4 changes: 2 additions & 2 deletions website/docs/presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {

## Presets -> themes and plugins {#presets---themes-and-plugins}

Presets in some way are a shorthand function to add plugins and themes to your docusaurus config. For example, you can specify a preset that includes the following themes and plugins,
Presets in some way are a shorthand function to add plugins and themes to your Docusaurus config. For example, you can specify a preset that includes the following themes and plugins,

```js
module.exports = function preset(context, opts = {}) {
Expand Down Expand Up @@ -73,7 +73,7 @@ This is especially useful when some plugins and themes are intended to be used t

### `@docusaurus/preset-classic` {#docusauruspreset-classic}

The classic preset that is usually shipped by default to new docusaurus website. It is a set of plugins and themes.
The classic preset that is usually shipped by default to new Docusaurus website. It is a set of plugins and themes.

| Themes | Plugins |
| ---------------------------------- | ------------------------------------- |
Expand Down