Skip to content

[FEATURE REQUEST] Folder option for SUMMARY.md #1538

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

Closed
VaZark opened this issue May 17, 2021 · 2 comments
Closed

[FEATURE REQUEST] Folder option for SUMMARY.md #1538

VaZark opened this issue May 17, 2021 · 2 comments

Comments

@VaZark
Copy link

VaZark commented May 17, 2021

Is there a standard way to create a Chapter without content or an associated page? Draft chapters assume that the content is not added yet and show a disabled/greyed out text on the sidebar.

What this issue is seeking to address is that while Chapters support a foldable structure but there is no way to use it exclusively as a folder object.

Is it possible to extend the current parser to extract a non-hyperlinked list element as a folder that doesn't have an index and used solely for organisation in the sidebar and the slug? Or conversely, allow Part Title to be a foldable object?

Ex: https://vazark.gitlab.io/til/python/basics/Cheatsheet.html

@joshrotenberg
Copy link
Contributor

Just thinking out loud here, I've only briefly looked at the summary parsing code, but I wonder if this would be possible by making a non-link chapter, so something like this (using the mdbook guide SUMMARY.md as an example):

Currently, the Format section has a top level that is just an index to the subsections:

Screen Shot 2021-06-04 at 10 19 02 AM

And the markdown in the SUMMARY.md:

...
- [Format](format/README.md)
    - [SUMMARY.md](format/summary.md)
        - [Draft chapter]()
...

Maybe the parser could support the following format in addition:

- Format
    - [SUMMARY.md](format/summary.md)
        - [Draft chapter]()

Here is the the parsed structure for the Format section currently:

            Link {
                name: "Format",
                location: Some(
                    "format/README.md",
                ),
                number: Some(
                    SectionNumber(
                        [
                            3,
                        ],
                    ),
                ),

So in theory, location: None could indicate this is an unlinked header. 🤷

What this means downstream for renderers is another question, though.

@ehuss
Copy link
Contributor

ehuss commented Jul 6, 2021

Thanks for the suggestion! I think this is a duplicate of #483, so closing in favor of that.

@ehuss ehuss closed this as completed Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants