Ask HN: Tool to convert JavaScript code comments into Markdown?
2 comments
I don’t know the library responsible but VS Code does this automatically for TypeScript code. Simply apply a block comment immediately prior to a type definition or the application of a type definition and that comment becomes rendered markdown in the tooltip elsewhere the code is called.
Why not delete the first line and replace the rest of the comment symbols with triple back ticks? Seems good enough for jazz to me.
sed -e 's/\/\*/```/g' -e 's/\*\//```/g' -e '1d' <yourfile>
For example if I have this in a javascript file:
I would like the resulting markdown to be:
Does anyone know of a tool which will do this?