Skip to content

Commit

Permalink
docs: [skip ci] Clarify plugin usage in README.md (#13)
Browse files Browse the repository at this point in the history
- clarifies that `src` paths are relative to the `docusaurus.config.js` file
- clarifies that when `global: true` (as it is in the README example), then `useGlobalData` has to be used, not `useDynamicImport`, as shown in the README
  • Loading branch information
aergonaut committed Feb 12, 2023
1 parent 81a0f3b commit 8dd5202
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,31 @@ module.exports = {
Any pattern supported by [`fast-glob`](https://github.com/mrmlnc/fast-glob) is allowed here
(including negations).

`src` paths are relative to the location of your `docusaurus.config.js`. For example, if you
had a directory structure like:

```
.
├── LICENSE
├── README.md
├── package.json
├── src
...
├── website
│ ├── README.md
│ ├── babel.config.js
│ ├── blog
│ ├── docs
│ ├── docusaurus.config.js
| ...
│ ├── src
│ └── yarn.lock
└── yarn.lock
```

Then to document all of your JSX components in your `src/` directory, you would use this path:
`../src/**/*.jsx`.

## Reading Annotations

Using the default settings, annotations are stored inside of the `.docusaurus` directory. The
Expand Down Expand Up @@ -100,6 +125,9 @@ export const PropTable = ({ name }) => {
};
```

**N.b.** If you use `global: true`, then you must use the [`useGlobalData` hook](https://docusaurus.io/docs/docusaurus-core#useGlobalData)
to access the docgen data. You cannot use `useDynamicImport`.

## Options

| Name | Type | Required | Description |
Expand Down

0 comments on commit 8dd5202

Please sign in to comment.