Skip to content
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

Add function to generate TOC from document headings #474

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

microbouji
Copy link
Contributor

@microbouji microbouji commented Feb 27, 2018

Motivation

Adresses #344.

I separated this into two PRs. This one only adds the function to extract a table of contents out of a markdown document's header tags. The table of content only has two levels at most. By default h2 tags are used for top level headings and h3 for subheadings. This can be customized, and the idea is to allow users to choose the tags to be used as top level and sub headings from siteConfig. More info about that in the other PR.

Test Plan

This function is pretty self-contained and should work from anywhere. Document markdown in => table of contents out.

Related PRs

#475

@JoelMarcey
Copy link
Contributor

@microbouji Awesome. Thanks!

Copy link
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@JoelMarcey JoelMarcey merged commit 6eb6580 into facebook:master Feb 28, 2018
@microbouji microbouji deleted the on-page-nav branch March 24, 2018 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants