phryneas / remark-typescript-tools

MIT License
129 stars 7 forks source link

Feature request: Add ability to include @example metadata to translate into a snippet title #2

Closed Shrugsy closed 3 years ago

Shrugsy commented 3 years ago

Docusaurus supports code titles by including a title alongside the specified language on a code snippet: https://docusaurus.io/docs/next/markdown-features/code-blocks#code-title

However doing so within a tsdoc @example tag breaks the language detection when hovering in vscode. It would be nice if a method existed to keep the syntax highlighting and translate the title across.

Example of current behaviour

image

image

Feasibility

Trying to put metadata nearby for the @example tag seems to break syntax highlighting even more.

image

A potential option could be a 'title' language snippet like so
image

This option retains syntax highlighting on hover, and seems theoretically plausible to parse the 'title' from.