Commit 15dc2485 authored by fmerg's avatar fmerg
Browse files

Textual changes

parent 4ad40578
......@@ -9,14 +9,15 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
This plugin parses docs in two ways:
1. Parses all markdown files and replaces a specific pattern with a React
component which supports a tooltip functionality (more information below)
2. Parses all markdown files and generates a glossary page with all the
pattern terms found in the `.md` files
1. Parses all `*.mdx` files under `docs/` and replaces each pattern with an
appropriate React component supporting a tooltip functionality (see below)
2. Generates a glossary with all terms corresponding to the `*.md` files under `docs/terms/`.
## Replace all patterns with tooltip information
Parses all markdown files and generates a glossary page with all the pattern terms found in the .md files
When writing documentation, you can use the following syntax:
## Replace patterns with dynamical elements
When writing docs, in order to refer to a term, you may use the following syntax:
```
%%term_text|term_name%%
......@@ -27,10 +28,11 @@ where:
page
- `term_name`: The filename of the term file, which resides under `./docs/terms` directory.
After the successful run of the script, the output of this functionality will be
a React Component, which will render the `term_text` as a link, directing to
the term page (which will be generated from the `term_name` attribute), and
when the user *hovers* the `term_text` it will show a brief summary of the term.
inside `docs/*.mdx` files. After successfully running the script, the above occurrence
will be replaced by a React component, which will render `term_text` as a link to the
corresponding term page, which is in turn generated from the `term_name` attribute;
furthermore, *hovering* over `term_text` displays a term summary, as extracted from the
corresponding term page.
### Example usage
......@@ -75,8 +77,8 @@ content here
### Running the script
When you are finished referencing terms and generating term pages, you can test
this locally by running the following command:
When you are finished referencing terms and have written corresponding term pages,
you can test this locally by running the following command:
```.shell script
$ yarn parse
......@@ -86,8 +88,8 @@ Replacing patterns with <Term />
Done in 1.41s.
```
This will replace all `%%term_text|term_name%%` occurrences everywhere with the
React component to support the functionality above.
This will replace all `%%term_text|term_name%%` occurrences with the React component
supporting the required functionality.
Here's an example where the terms have been replaced. When the project is up
and running, you can visit the test example on the `/docs/replacement-test` page:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment