graycoreio / daffodil

Angular Ecommerce PWA Framework
https://next.daff.io
MIT License
156 stars 31 forks source link

[BUG] Docs table of contents sidebar generates code block as back tick marks #2741

Open xelaint opened 8 months ago

xelaint commented 8 months ago

:bug: Bug report

Current Behavior

Docs table of contents sidebar generates code as back tick marks. The styling of code blocks in heading tags also need to be updated.

  1. Should we be using code blocks in markdown headings?
  2. If we are going to, how do we fix this in doc gen?
Screen Shot 2024-01-30 at 8 55 14 AM

Expected Behavior

Docs TOC should not display the code block back tick marks.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Daffodil version: X.Y.Z
Angular version: X.Y.Z 


For Tooling issues:
- Node version: XX  
- Platform:  

Others:

xelaint commented 7 months ago

@damienwebdev @griest024 since you guys prefer to use code blocks in headings, how do we handle how it's rendered in the table of contents?

damienwebdev commented 7 months ago

Angular has an example here: https://angular.io/tutorial/first-app#step-1---identify-the-version-of-nodejs-that-angular-requires with the word node.js interestingly, it's different on mobile versus desktop.

I don't mind this style: Screenshot_20240228-091346.png

xelaint commented 7 months ago

@damienwebdev yea the styling is easy to update, but how do we get the code block to render as styled code blocks instead of what it currently looks like (screenshot shows back tick marks in the toc)?

damienwebdev commented 7 months ago

We use https://github.com/jonschlinkert/markdown-toc to generate these here: https://github.com/graycoreio/daffodil/blob/develop/tools%2Fdgeni%2Fsrc%2Ftransforms%2Fdaffodil-guides-package%2Freader%2Fguide-file.reader.ts

We would have to play around with markdown-toc to see if we can make it escape this content.