rust-lang / rust-lang/mdBook

Document toc.md and toc.html and make toc.md a reserved file

Open
#3,090 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-enhancement
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Problem

In normal circumstances mdbook will generate a file called toc.html that will contain the Table of Contents`. It is used as the TOC for people (and bots) who don't run JavaScript.

If the user creates a file called src/toc.md and references it in SUMMARY.md then mdbook will use it to generated the toc.html file replacing the normally generated one.

Proposed Solution

IMHO this should be avoided.

  1. If there is a an toc.md file the build process should stop with an error toc.md is reserved for internal use.
  2. Regardless of 1. being implemented or not, the behaviour should be described in the documentation so people can search for either toc.html , toc.md or toc and find it.
Notes

See also #3047

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the build handling for src/toc.md and the SUMMARY.md entry that can cause toc.html to be replaced. Review issue #3047 and the existing documentation for toc.html, toc.md, and toc, then add the reserved-file error and document the behavior. Done means the conflict is rejected and users can find the behavior in the documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.