Add classes to reference toc #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ref-toc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Before:
After:
I'm not sure about this—it seems like it'll overflow most user's vertical screen space if we get a few more classes, and it seems arbitrary to list classes but not other exports.
What might work is adding section headers to the doc templates and linking those, like on https://prosemirror.net/docs/ref/
Sure. Updated:
@ -59,7 +59,22 @@ function backToRoot(dir) {mapDir(join(base, "site"), join(base, "output"), (fullPath, name) => {I don't think
[\w\s]covers every character. And it seems like you don't need to involve the content and close tag at all here, and can just only replace the open tag.@ -59,7 +59,22 @@ function backToRoot(dir) {mapDir(join(base, "site"), join(base, "output"), (fullPath, name) => {I've changed
[\w\s]to[\S\s]which covers every charachter.I'm not sure what you had in mind with "it seems like you don't need to involve the content and close tag at all here, and can just only replace the open tag".
The purpose of lines 68 to 72 is to add ids to the section headers so that they can be targetted by anchor links. Yes, we only need to replace the open tag for this. However, I believe we still need to involve the header content (to figure out what the id should be) and end tag (to know where the content ends).
Before:
After:
Let me know if I'm missing something.
@ -59,7 +59,22 @@ function backToRoot(dir) {mapDir(join(base, "site"), join(base, "output"), (fullPath, name) => {Oh, right, you do indeed need the content.
Maybe replace
/\W+/with underscores in the id to avoid generating invalid anchors? And I think it'd make sense to simplify a little (as well as avoid hard-coding the id structure in two places) by directly adding the TOC entries from thereplacecallback.@ -59,7 +59,22 @@ function backToRoot(dir) {mapDir(join(base, "site"), join(base, "output"), (fullPath, name) => {Done
Thanks! I've rebuilt the ref guide and it's looking good.