1

I am using the Guides feature of JSDuck where I specify README.md files in the guides.json file.

The problem I have is that I can't specify an anchor in a README.md file in guides.json.

For example, my README.md file has an H1 Head, then 5 H2 heads. Assume above each H2 header, I put an anchor--e.g, <a name="h2_1">, <a name="h2_2">, <a name="h2_3">, etc.

I want the title: (param) I enter in the guides.json to appear in the JSDuck-generated navigation on the left of the page. So, assume i entered these parameters:

{
   name:foo-section-h2_1,
   title: This is Header2
}

The problem is that the -section tail - which is a valid link reference in JSDuck causes the parser to fail to render the README.md into the target README.js in a directory "foo".

Anyone have any suggestions - it is a huge hinderance if one can't express subsections in the main navigation of a guide.

Rene Saarsoo
  • 13,580
  • 8
  • 57
  • 85

1 Answers1

0

Unfortunately this is not supported by JSDuck. It expects each entry name in the guides.json to reference a directory name, to which it appends "/README.md" and expects to find the guide file in there. There is no workaround that I know of, and I'm the author of this whole thing.

The whole guides feature is full of various quirks and unresolved corner-cases like this. It's largely a bolt-on feature to JSDuck. My main suggestion is, that when you want to do anything more than the most basic guides, you should look for an alternative solution.

Or you could try patching this. But I took a look around the code, and it's not a simple fix to make.

Rene Saarsoo
  • 13,580
  • 8
  • 57
  • 85