about summary refs log tree commit diff
path: root/src/librustdoc/markdown.rs
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2024-02-06 10:22:24 -0700
committerMichael Howell <michael@notriddle.com>2024-08-20 16:27:42 -0700
commit1aebff96ade6518038e0f7522d3304bd0f9bf891 (patch)
tree5ddd0be347cd48d3a4797c0d7e7481c89c46544b /src/librustdoc/markdown.rs
parent5aea14073eee9e403c3bb857490cd6aa4a395531 (diff)
downloadrust-1aebff96ade6518038e0f7522d3304bd0f9bf891.tar.gz
rust-1aebff96ade6518038e0f7522d3304bd0f9bf891.zip
Add Top TOC support to rustdoc
This commit adds the headers for the top level documentation to
rustdoc's existing table of contents, along with associated items.

It only show two levels of headers. Going further would require the
sidebar to be wider, and that seems unnecessary (the crates that
have manually-built TOCs usually don't need deeply nested headers).
Diffstat (limited to 'src/librustdoc/markdown.rs')
-rw-r--r--src/librustdoc/markdown.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs
index a98f81d011e..581ebbbe58d 100644
--- a/src/librustdoc/markdown.rs
+++ b/src/librustdoc/markdown.rs
@@ -72,6 +72,7 @@ pub(crate) fn render<P: AsRef<Path>>(
     let text = if !options.markdown_no_toc {
         MarkdownWithToc {
             content: text,
+            links: &[],
             ids: &mut ids,
             error_codes,
             edition,