jhaaaa
jhaaaa

Reputation: 96

Does dart doc support generation of markdown instead of HTML?

I have dart doc . working and generating HTML files.

I want to generate Markdown files instead.

When googling, I found this answer https://github.com/dart-lang/dartdoc/issues/1479#issuecomment-868961953 - which led me to this PR: https://github.com/dart-lang/dartdoc/pull/2703

In the diff https://github.com/dart-lang/dartdoc/pull/2703/files - I see format and md - but I'm new to this, so I don't know how to use this info to create the command I need to use.

I was expecting something like dart doc . --format md to work, but it doesn't.

Also, when I run dart doc --help, it leads me here: https://dart.dev/go/dartdoc-options-file - and it doesn't mention the ability to generate docs in Markdown.

Maybe this isn't supported? TY

Upvotes: 1

Views: 252

Answers (2)

Monika Matis
Monika Matis

Reputation: 1

Apparently flag --format=md does not longer exist in dartdoc:

'dart run dartdoc --format=md Building package executable... Built dartdoc:dartdoc. fatal error: Could not find an option named "--format". Usage: dartdoc [OPTIONS] ...'

BTW, command dart pub run ... is depreciated now. 'dart pub run dartdoc --format=md Deprecated. Use dart run instead. Building package executable... Built dartdoc:dartdoc. fatal error: Could not find an option named "--format".

Usage: dartdoc [OPTIONS]...'

edit: upon checking further the --format option was depreciated in ver. 8.0.3 (current 8.2.2): https://pub.dev/packages/dartdoc/changelog#803

Upvotes: 0

Dennis Kaselow
Dennis Kaselow

Reputation: 4551

dart doc can't create documentation in markdown format, you have to use the package dartdoc (see https://github.com/dart-lang/dartdoc/issues/3241#issuecomment-1302150336)

You have to run dart pub global run dartdoc --format=md (but the generated md may not be pure md, see https://github.com/dart-lang/dartdoc/issues/3237).

Upvotes: 1

Related Questions