I want to generate documentation for my flutter project, which will later be published to its GitHub wiki via a pipeline (this question is not about how I could set up such a pipeline).
As a first step, I want to generate the documentation in Markdown. As far as I can see it, GitHub wiki pages can not be written in pure HTML and Markdown is probably the most popular choice for markup.
I looked into the dart doc documentation and its configuration options but it seems that it only generates HTML and has no option to output Markdown.
Then, I searched for alternatives and found dartdoc
. I read this post and followed these instructions.
They are basically:
dartdoc
via dart pub global activate dartdoc
dart pub global run dartdoc
.dart pub global run dartdoc --format=md
instead.However, in the end I get this message in the terminal:
Building package executable...
Built dartdoc:dartdoc.
fatal error: Could not find an option named "format".
It also displays all available options and their descriptions but I can not find any information for generating Markdown.
The instructions I used worked for dartdoc 6.1.2
. However, I have installed dartdoc 8.0.8
. The newest version would be dartdoc 8.0.10
but dependency conflicts keep me from upgrading to it.
So, did I miss anything? Did dartdoc drop support for generating Markdown? If yes, are there alternatives for documentation generation I am not aware of that are able to generate Markdown documentation files for flutter/ dart projects?
Per the post you linked to, --format=md
was not properly generating Markdown anyway. That post linked to a corresponding GitHub issue, and that issue was "fixed" by removing the --format
flag.
Regarding alternatives:
If you want API documentation for a library, if you publish it to pub.dev, pub.dev will automatically generate and host the HTML documentation for you.
GitHub wiki pages seem inappropriate for generated documentation since wiki pages are meant to be easily editable, but generated content should not be edited directly. Consider using GitHub pages instead, which can host HTML.