diplodoc-platform / diplodoc-platform/cli

Auto toc

Open
#130 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
123
Forks
51
Avg merge
10h 50m
Merged PRs (30d)
38

Description

Currently, yfm builder requires it's users to create `toc.yaml` and keep it up to date to build anything. That's not fun and often can be a great obstacle for usage (especially for casual usage).

It would be great to drop that requirement, replacing toc.yaml with "virtual" TOC that auto generated on the fly using the file structure of the project (without producing real `toc.yaml` file in the process).

Page titles can be parsed from the first h1 tag (if it's present) or from the front-matter (if there is no h1 tag or user needs something custom).

This feature will make yfm great tool to quickly transform some boring folders with markdown texts into beautiful html documents, opening up opportunities to integrate with tools like Obsidian.md without additional overhead of composing toc.

This idea can be extended further in the future: for example, if I want to pin one page to the top of the sidebar but don't want to take the toll of keeping manual toc.yaml up to date just for that, maybe front-matter meta can be extended to include sidebar ordering priority too.

[relevant internal discussion](https://st.yandex-team.ru/DOCSTOOLS-802)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.