@@ -2,6 +2,7 @@ const path = require("path");
2
2
const normalizePath = require ( "normalize-path" ) ;
3
3
const { context} = require ( "../context" ) ;
4
4
const { descriptionParser} = require ( "../parsers/description-parser.js" ) ;
5
+ const { dashCase} = require ( "../utils/dashCase" ) ;
5
6
6
7
const _filterParams = ( labels ) => {
7
8
return labels
@@ -45,6 +46,10 @@ class DocSymbol {
45
46
this . labels = [ ] ;
46
47
}
47
48
49
+ get id ( ) {
50
+ return dashCase ( [ this . symbolType , this . symbolName ] . filter ( Boolean ) . join ( "-" ) ) ;
51
+ }
52
+
48
53
get path ( ) {
49
54
return this . docFile . path ;
50
55
}
@@ -112,11 +117,7 @@ class DocSymbol {
112
117
* @returns {* }
113
118
*/
114
119
get url ( ) {
115
- const url = [
116
- context . baseUrl ,
117
- normalizePath ( path . dirname ( this . docFile . relativePackagePath ) ) , //.replace(/\.ts$/, '')
118
- `${ this . symbolName } .html`
119
- ] . join ( "/" ) ;
120
+ const url = [ context . baseUrl , normalizePath ( path . dirname ( this . docFile . relativePackagePath ) ) , `${ this . id } .html` ] . join ( "/" ) ;
120
121
121
122
return context . outputResolver ( url ) ;
122
123
}
@@ -126,7 +127,7 @@ class DocSymbol {
126
127
* @returns {* }
127
128
*/
128
129
get outputPath ( ) {
129
- const file = normalizePath ( path . join ( context . outputDir , path . dirname ( this . docFile . relativePackagePath ) , `${ this . symbolName } .md` ) ) ;
130
+ const file = normalizePath ( path . join ( context . outputDir , path . dirname ( this . docFile . relativePackagePath ) , `${ this . id } .md` ) ) ;
130
131
131
132
return context . outputResolver ( file ) ;
132
133
}
0 commit comments