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

docs: change angle brackets to backticks in comment #1726

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

mongodben
Copy link
Contributor

This change was done b/c the angle brackets break the compiler for typedoc-plugin-markdown, a library for converting Typedoc to markdown. It interprets the angle brackets as an HTML tag, whereas it's just being used for emphasis.

This issue occurred specifically when using docusaurus-plugin-typedoc. More details about this problem can be found here - typedoc2md/typedoc-plugin-markdown#276

This change fixes the issues by replacing the backticks (< and >) with markdown backticks to highlight the word and achieve the same desired emphasis without breaking the markdown parser.

i was able to validate that this works in my local environment.

This change was done b/c the angle brackets break the compiler for [typedoc-plugin-markdown](https://github.com/tgreyuk/typedoc-plugin-markdown), a library for converting Typedoc to markdown. It interprets the angle brackets as an HTML tag, whereas it's just being used for emphasis.

This issue occurred specifically when using [docusaurus-plugin-typedoc](https://www.npmjs.com/package/docusaurus-plugin-typedoc). More details about this problem can be found here - typedoc2md/typedoc-plugin-markdown#276

This change fixes the issues by replacing the backticks (`<` and `>`) with markdown backticks to highlight the word and achieve the same desired emphasis without breaking the markdown parser.

i was able to validate that this works in my local environment.
@bd82 bd82 changed the title Fix: change angle brackets to backticks in comment docs: change angle brackets to backticks in comment Dec 22, 2021
@bd82
Copy link
Member

bd82 commented Dec 22, 2021

Thanks @mongodben That is probably some historic comment before I learned to use markdown better 😄

Could you provide information on the scenario you are processing the api.d.ts of Chevrotain?
Could this typcdoc-plugin-markdown be used to provide a better documentation page for the APIs?

I am using VuePress for the website, so perhaps if I convert the d.ts to markdown I could
display it as part of the vuePress website instead of an external website?

Thanks in advance.
Shahar.

@bd82 bd82 merged commit 9b472d4 into Chevrotain:master Dec 22, 2021
@bd82
Copy link
Member

bd82 commented Dec 22, 2021

It may take a while to release a new version with this change included.

  • as the master branch has some breaking changes and other work waiting for my attention...

I recommend that you use a "hot patch" tool such as https://github.com/ds300/patch-package
if you need it immediately.

@mongodben
Copy link
Contributor Author

thanks shahar,

to answer your questions:

  • we're processing api.d.ts as part of the ts-docs generation for an open source package called Bluehawk, which if for processing code files to create documentation code snippets. i'm not 100% sure why your file is processed in the generated docs, though the project does make extensive use of Chevrotain. you can see a prototype of the docs here - https://mongodben.github.io/Bluehawk/
  • yes this plugin helps create better API documentation. basically it parses your typedocs and turns them into markdown files that work well with your documentation site generator. so instead of hosting the typedocs at a separate url, you can keep them within the same website as the rest of your docs.
  • i'm not personally familiar with Vuepress so i can't speak to this question with detail, but i see that there is a similar package to the one that i used with docusaurus for vuepress - vuepress-plugin-typedoc. worth an investigation i think!

please let me know if any questions. happy to be of further assistance!

@bd82
Copy link
Member

bd82 commented Dec 23, 2021

i'm not 100% sure why your file is processed in the generated docs, though the project does make extensive use of Chevrotain.

Hmm, sounds like some kind of transitive dependency.

so instead of hosting the typedocs at a separate url, you can keep them within the same website as the rest of your docs.

Hmm sounds like a plan 😄

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.

None yet

2 participants