@@ -102,15 +102,22 @@ generates docs.
102102
103103``` yaml
104104dartdoc :
105- categoryOrder : ["First Category", "Second Category"]
105+ categories :
106+ " First Category " :
107+ markdown : doc/First.md
108+ name : Awesome
109+ " Second Category " :
110+ markdown : doc/Second.md
111+ name : Great
106112 linkTo :
107113 url : " https://my.dartdocumentationsite.org/dev/%v%"
108114` ` `
109115
110116Unrecognized options will be ignored. Supported options:
111117
112- * **categoryOrder**: Specify the order of categories, below, for display in the sidebar and
113- the package page.
118+ * **categories**: Specify the order of categories. For APIs you'd like to document, specify
119+ the markdown file with ` markdown:` to use for the category page. Optionally, rename the
120+ category from the source code into a display name with 'name:'.
114121 * **exclude**: Specify a list of library names to avoid generating docs for,
115122 overriding any specified in include.
116123 * **include**: Specify a list of library names to generate docs for, ignoring all others.
@@ -144,9 +151,11 @@ as POSIX paths. Dartdoc will convert POSIX paths automatically on Windows.
144151
145152# ## Categories
146153
147- You can tag libraries in their documentation with the string `{@category YourCategory}`, and
148- that will cause the library to appear in a category when showing the sidebar on the Package
149- and Library pages.
154+ You can tag libraries or top level classes, functions, and variables in their documentation with
155+ the string `{@category YourCategory}`. For libraries, that will cause the library to appear in a
156+ category when showing the sidebar on the Package and Library pages. For other types of objects,
157+ the `{@category}` will be shown with a link to the category page if specified in
158+ dartdoc_options.yaml, as above.
150159
151160` ` ` dart
152161/// Here is my library.
@@ -155,6 +164,42 @@ and Library pages.
155164library my_library;
156165` ` `
157166
167+ # ### Other category tags and categories.json
168+
169+ A file `categories.json` will be generated at the top level of the documentation tree with
170+ information about categories collected from objects in the source tree. The directives
171+ ` @category` , `@subCategory`, `@image`, and `@samples` are understood and saved into this json.
172+ Future versions of dartdoc may make direct use of the image and samples tags.
173+
174+ As an example, if we document the class Icon in flutter using the following :
175+
176+ ` ` ` dart
177+ /// {@category Basics}
178+ /// {@category Assets, Images, and Icons}
179+ /// {@subCategory Information displays}
180+ /// {@image <image alt='' src='/images/catalog-widget-placeholder.png'>}
181+ class Icon extends StatelessWidget {}
182+ ` ` `
183+
184+ that will result in the following json :
185+
186+ ` ` ` json
187+ {
188+ "name": "Icon",
189+ "qualifiedName": "widgets.Icon",
190+ "href": "widgets/Icon-class.html",
191+ "type": "class",
192+ "categories": [
193+ "Assets, Images, and Icons",
194+ "Basics"
195+ ],
196+ "subcategories": [
197+ "Information displays"
198+ ],
199+ "image": "<image alt='' src='/images/catalog-widget-placeholder.png'>"
200+ }
201+ ` ` `
202+
158203# ## Animations
159204
160205You can specify links to videos inline that will be handled with a simple HTML5 player :
0 commit comments