@@ -8,6 +8,7 @@ import 'package:analyzer/dart/element/element.dart';
88import 'package:dartdoc/src/dartdoc_options.dart' ;
99import 'package:dartdoc/src/model/model.dart' ;
1010import 'package:dartdoc/src/package_meta.dart' ;
11+ import 'package:dartdoc/src/render/category_renderer.dart' ;
1112import 'package:dartdoc/src/warnings.dart' ;
1213
1314/// A category is a subcategory of a package, containing libraries tagged
@@ -123,28 +124,24 @@ class Category extends Nameable
123124 String get href =>
124125 isCanonical ? '${package .baseHref }topics/${name }-topic.html' : null ;
125126
127+ String get categorization {
128+ return CategoryRendererHtml ().renderCategorization (this );
129+ }
130+
126131 String get linkedName {
127- String unbrokenCategoryName = name.replaceAll (' ' , ' ' );
128- if (isDocumented) {
129- return '<a href="$href ">$unbrokenCategoryName </a>' ;
130- } else {
131- return unbrokenCategoryName;
132- }
132+ return CategoryRendererHtml ().renderLinkedName (this );
133133 }
134134
135- String _categoryNumberClass ;
135+ int _categoryIndex ;
136136
137137 /// The position in the container order for this category.
138- String get categoryNumberClass {
139- if (_categoryNumberClass == null ) {
140- _categoryNumberClass = "cp-${ package .categories .indexOf (this )}" ;
138+ int get categoryIndex {
139+ if (_categoryIndex == null ) {
140+ _categoryIndex = package.categories.indexOf (this );
141141 }
142- return _categoryNumberClass ;
142+ return _categoryIndex ;
143143 }
144144
145- /// Category name used in template as part of the class.
146- String get spanClass => name.split (' ' ).join ('-' ).toLowerCase ();
147-
148145 CategoryDefinition get categoryDefinition =>
149146 config.categories.categoryDefinitions[sortKey];
150147
0 commit comments