dartdoc icon indicating copy to clipboard operation
dartdoc copied to clipboard

Specified categories were disapperared from the API doc

Open AlexV525 opened this issue 1 year ago • 7 comments

The request https://github.com/cfug/dio/pull/2344 is trying to remove the categories doc annotation, but then the topics disappeared.

However, the doc of the package pxl.dart seems working well while we have a similar configuration.

AlexV525 avatar Dec 25 '24 13:12 AlexV525

Please elaborate on what problem you are seeing. What did you try to do? What was the expected result? What was the actual result?

srawlins avatar Dec 26 '24 01:12 srawlins

https://pub.dev/documentation/dio/latest/dio/

There are two topics in the doc. The pull request is about removing the category annotation: https://github.com/cfug/dio/blob/b16a611a14b8b8a4cb7f2556628a5f030c315ffd/dio/lib/dio.dart#L4-L5

After removed, those topics are disappeared from the doc: https://github.com/cfug/dio/pull/2344#issuecomment-2561788533

We have configured categories in the yaml: https://github.com/cfug/dio/blob/main/dio/dartdoc_options.yaml

I looked at the package pxl.dart and it doesn't seem to have extra configuration but topics are displayed correctly in its doc.

AlexV525 avatar Dec 26 '24 01:12 AlexV525

Hi @srawlins , sorry for the previous lack of detailed comment. Is this something we can move on now?

AlexV525 avatar Jan 23 '25 10:01 AlexV525

Yes, that should be enough to start an investigation.

srawlins avatar Jan 23 '25 16:01 srawlins

I suspect showUndocumentedCategories: true just causes categories for which no markdown file exists to be included in the list of categories.

I don't think there is an option to include categories that are not referenced with {@Category ...} -- I suppose that maybe that's what showUndocumentedCategories should do -- or maybe we should have an showUnusedCategories option.

jonasfj avatar Apr 09 '25 14:04 jonasfj

See also https://github.com/dart-lang/dartdoc/issues/4012, which is probably the same use case.

jonasfj avatar Apr 09 '25 14:04 jonasfj

I did a bit of investigation, we have a test case covering the current behavior: https://github.com/dart-lang/dartdoc/blob/95f4208e094a2832dd29a9591d9b95ddf6632174/test/options_test.dart#L407-L439

Introduced in: https://github.com/dart-lang/dartdoc/pull/2965

I can see the argument that categories shouldn't be used for text documentation. But also that in the UI categories are currently called "topics", so it's certainly attractive to use them that way.

There currently two bugs asking for text documentation pages:

  • https://github.com/dart-lang/dartdoc/issues/4012
  • https://github.com/dart-lang/dartdoc/issues/1096

Maybe we should introduce a "pages" concept.

jonasfj avatar May 14 '25 13:05 jonasfj