Andrious Solutions
Andrious Solutions

Reputation: 728

Include additional documentation in dartdoc like go_router does

The package, go_router, successfully lists additional documentation as topics on its documentation page. You see them as a sidebar on the left-hand side of the page.

I've examined the approach used and read the documentation provided:

go_router's dartdoc_options.yaml file. enter image description here

And yet the topics don't appear on my documentation page.

What am I missing??

Running dart doc . locally produces the expected directory, doc/api. However, the file, categories.json, has an empty list, []. This means to me DartDoc is not even recognizing the categories I've defined.

I did note in the documentation: 'If there is no matching category defined in dartdoc_options.yaml, those declared categories in the source code will be invisible.'

And yet go_router doesn't implement such tagging and it still works??

What am I missing??

Thanks.

Similar StackOverflow questions:

How to get dartdoc to include additional documentation?

Using dartdoc categories

Upvotes: 2

Views: 191

Answers (1)

Andrious Solutions
Andrious Solutions

Reputation: 728

Yeah, I figured out what I was missing.

In your source code (under the lib directory), you have to insert in the class comments the '@category' directive:

/// {@category Get started}
/// {@category Configuration}
/// {@category Transition animations}
/// {@category Named routes}
/// {@category Redirection}

That's what the authors of go_router did.

I got the hint from another stackoverflow post on the subject:

'at least one element in the source code is declared as a member of that category,'

Yesh so, there you are.

Upvotes: 0

Related Questions