mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Please allow table of contents entries that don't have markdown pages.

Open Lokathor opened this issue 5 years ago • 5 comments

eg:

# Summary

- [Toolchain Setup](toolchain_setup.md)
- [Project Setup](project_setup.md)
- [Volatile](volatile.md)
- [Bit Packing](bit_packing.md)
- Video
  - [Display Control](display_control.md)

This would allow for better TOC organization without having to have useless blank pages.

Lokathor avatar Sep 27 '20 20:09 Lokathor

@Lokathor

I believe you can obtain what you want with a Part Title (it took me a while to understand that the # was not parsed as markdown:

- [Bit Packing](bit_packing.md)
# Video
  - [Display Control](display_control.md)

marco-m-pix4d avatar Oct 22 '20 14:10 marco-m-pix4d

Very neat, I didn't know a person could do that.

However, it seems that style makes the numbering not include the part entries.

Lokathor avatar Oct 22 '20 18:10 Lokathor

However, it seems that style makes the numbering not include the part entries.

Yes. I think that the only way to have subnumbering is to use a blank page as you mention.

To help people stumbling on this thread:

Approach 1 (requires blank page)

- [Bit Packing](bit_packing.md)
- [Video](blank.md)
  - [Display Control](display_control.md)
  - [Foo](foo.md)

Generates:

1. Bit Packing
2. Video
   2.1 Display Control
   2.2 Foo

Approach 2 (no blank page)

- [Bit Packing](bit_packing.md)
# Video
  - [Display Control](display_control.md)
  - [Foo](foo.md)

Generates:

1. Bit Packing
Video
2. Display Control
3. Foo

marco-m-pix4d avatar Oct 23 '20 06:10 marco-m-pix4d

It's a hack, but seems like you could use draft pages to achieve this?

- [Video]()
  - [Display Control](display_control.md)
  - [Foo](foo.md)

Then Video will be greyed out, but not require a blank page.

shonfeder avatar Jan 08 '21 14:01 shonfeder

This was discussed in #1820 as well (the PR closed just above). See https://github.com/rust-lang/mdBook/pull/1820#issuecomment-1255663374 for a rationale against using draft chapters for this. Special syntax (just an entry without a link?) would thus be warranted, and IMO make more sense.

ISSOtm avatar Feb 26 '24 23:02 ISSOtm