ionic-team / capacitor-docgen

Docs Readme Markdown and JSON Generator for Capacitor Plugins.
https://capacitorjs.com/
Other
12 stars 8 forks source link

Use markdown link instead of <a> element #37

Open tafelnl opened 2 years ago

tafelnl commented 2 years ago

Currently we are busy refactoring the Capacitor Google Maps plugin. One of the improvements is better documentation. The fork (WIP) can be found here: https://github.com/DutchConcepts/capacitor-google-maps/tree/next

I use docsify to generate an organized documentation website based on the markdown documentation (can be found in the ./docs folder in that fork). The API reference is generated with this plugin. This works really well, for which I commend you 👏.

The generated website (GitHub pages) can be found here.

As can be seen, the links generated by docgen are broken, because they are a <a> element instead of a markdown link.

It would be solved by changing: <code><a href="#foobar">FooBar</a></code> to <code>[FooBar](#foobar)</code>

The docsify team said the following:

You need generate markdown syntax. Such as

[MyClass](#MyClass)

It will not be compiled if it is HTML.

Therefore I hope it can be solved in this plugin. As far as I can see now, I don't think this change does have any drawbacks, so it would make sense to implement it like this. But please do share your opinion about this.

tafelnl commented 2 years ago

I just created a PR for this (with updated jest tests)