Skip to content

Conversation

@mishig25
Copy link
Contributor

@mishig25 mishig25 commented Oct 3, 2023

Description

Like #401, instead of having custom python regexes to deal with markdown headings, with this PR, we start using remark's already parsed tree for handling markdown headings. For the context, we do two transformations on markdown headings:

  1. Replace markdown headings with custom svelte components so that they look nicer and have copy hashlink button
  2. Collect markdown into frontmatter for rendering right naivgation menu on hf.co/docs pages

Issues being solved

Closes #343
Closes #193
Solved issue: render right side menu for non-english translated pages
Solved issue: support char { inside headings
Solved issue: Fixes failing TRL doc build
Solved issue: strictly needing extra newline after heading

Performance

Besides solving the parsing issues, the build speed is faster since we are removing extra regex searches on python doc-builder side

@mishig25 mishig25 marked this pull request as draft October 3, 2023 13:24
mishig25 added a commit to huggingface/transformers that referenced this pull request Oct 4, 2023
mishig25 pushed a commit to mishig25/trl that referenced this pull request Oct 4, 2023
@mishig25 mishig25 marked this pull request as ready for review October 4, 2023 09:31
@mishig25 mishig25 merged commit 724a5b5 into main Oct 4, 2023
@mishig25 mishig25 deleted the toctree_headings_rework branch October 4, 2023 09:35
@stevhliu stevhliu mentioned this pull request Oct 4, 2023
6 tasks
@lhoestq
Copy link
Member

lhoestq commented Oct 11, 2023

This could be responsible for docs CI job failing in datasets: https://github.com/huggingface/datasets/actions/runs/6371568866/job/17597935292?pr=6268

We have a title with parenthesis in it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse issue in metadata when " inside markdown heading Right sidebar of docs have some HTML artifacts

3 participants