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

fix: ToC generation when importing markdown (Docusaurus v2) #9682

Closed

Conversation

anatolykopyl
Copy link
Contributor

@anatolykopyl anatolykopyl commented Dec 29, 2023

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

This PR adapts the fix to ToC generation from shuding/nextra#2199 to the toc remark plugin in docusaurus-v2.

Test Plan

Now the title from _pagePartial.md is visible in the ToC of the /tests/pages page.

Also I've added a /tests/pages/partials-tests page for further demonstration.

Test links

Deploy preview: https://deploy-preview-9682--docusaurus-2.netlify.app/

Affected test page: https://deploy-preview-9682--docusaurus-2.netlify.app/tests/pages

New test page: https://deploy-preview-9682--docusaurus-2.netlify.app/tests/pages/partials-tests

Related issues/PRs

#3915

@facebook-github-bot
Copy link
Contributor

Hi @anatolykopyl!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@anatolykopyl anatolykopyl changed the base branch from main to docusaurus-v2 December 29, 2023 12:52
@anatolykopyl anatolykopyl changed the title Fix partials toc Fix partials ToC Dec 29, 2023
Copy link

netlify bot commented Dec 29, 2023

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit a5535b3
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/65902eaea57c450008520e09
😎 Deploy Preview https://deploy-preview-9682--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Dec 29, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 88 🟢 100 🟢 100 🟢 100 🟢 90 Report
/docs/installation 🟢 92 🟢 100 🟢 100 🟢 100 🟢 90 Report

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@anatolykopyl anatolykopyl marked this pull request as ready for review December 30, 2023 14:52
@anatolykopyl anatolykopyl changed the title Fix partials ToC fix: ToC generation when importing markdown Dec 30, 2023
@anatolykopyl anatolykopyl changed the title fix: ToC generation when importing markdown fix: ToC generation when importing markdown (Docusaurus v2) Dec 31, 2023
@anatolykopyl
Copy link
Contributor Author

I consider this PR done.
@slorber, could you please check it out? Any tips regarding how this can be improved are appreciated! I'd be glad to make changes to this PR if necessary.

@slorber
Copy link
Collaborator

slorber commented Jan 12, 2024

thanks for your work @anatolykopyl

However we don't merge new features and bugfixes to the v2 branch anymore, and will only handle critical security v2 issues until the end of January.

https://docusaurus.io/community/release-process#stable-version

I'll look at your v3 PR when I have time

@slorber slorber closed this Jan 12, 2024
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