-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
| [![PR App][icn]][demo] | Fix RM-9179 | | :--------------------: | :---------: | ## 🧰 Changes TOC!!1!1 The old TOC worked by parsing the `mdast` for `heading` via `mdast-util-toc`. This produces an `mdast` suitable for rendering via the `TableOfContents` component. The package `remark-slug` appears to be abandoned, and the [mdx maintainers](https://github.com/orgs/mdx-js/discussions/2085) recommend using `rehype-slug` and `rehype-extract-oc`. `rehype-extract-toc` generates a POJO that represent the TOC, and it doesn't appear to have any functions for parsing component imports. So, I've implemented a plugin that parses the main doc and it's components `hast`'s during the `compile` step. Then it can be rendered in the `TableOfContents` during the `run` step. This changes the return signatures to be an object instead of a single component, to prevent requiring 2 separate compile and run steps when rendering. Other notable changes: - Refactored `run`, `compile`, `mdx`, `astProcessor` into their own files under `./lib` - Deleted the `Style` component. - Deleted some tests (maybe not a great idea?). - Added `execute` test helper. ## 🧬 QA & Testing - [Broken on production][prod]. - [Working in this PR app][demo]. [demo]: https://markdown-pr-PR_NUMBER.herokuapp.com [prod]: https://SUBDOMAIN.readme.io [icn]: https://user-images.githubusercontent.com/886627/160426047-1bee9488-305a-4145-bb2b-09d8b757d38a.svg --------- Co-authored-by: Rafe Goldberg <[email protected]>
- Loading branch information
1 parent
f8d3589
commit ef8f9a1
Showing
41 changed files
with
1,200 additions
and
939 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ example/demo.js* | |
example/demo.css | ||
|
||
dist | ||
|
||
.env |
Binary file modified
BIN
+0 Bytes
(100%)
...regression-tests-rdmd-syntax-renders-callout-tests-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.24 KB
(110%)
...ression-tests-rdmd-syntax-renders-code-block-tests-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.2 KB
(110%)
...l-regression-tests-rdmd-syntax-renders-code-blocks-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+121 KB
(230%)
...visual-regression-tests-rdmd-syntax-renders-embeds-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.2 KB
(120%)
...al-regression-tests-rdmd-syntax-renders-html-tests-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.66 KB
(100%)
...visual-regression-tests-rdmd-syntax-renders-images-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.03 KB
(110%)
...egression-tests-rdmd-syntax-renders-mdx-components-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.15 KB
(110%)
...visual-regression-tests-rdmd-syntax-renders-tables-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.77 KB
(120%)
...ual-regression-tests-rdmd-syntax-renders-vars-test-without-surprises-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.