File tree Expand file tree Collapse file tree 4 files changed +11
-14
lines changed Expand file tree Collapse file tree 4 files changed +11
-14
lines changed Original file line number Diff line number Diff line change 5
5
- [ oneof.html] ( oneof.html )
6
6
- [ person.html] ( person.html )
7
7
8
- ## Draft-06
9
- - [ draft-06/animal.html] ( draft-06/animal.html )
10
-
11
8
## Draft-07
12
9
- [ draft-07/user.html] ( draft-07/user.html )
13
10
11
+ ## Draft-06
12
+ - [ draft-06/animal.html] ( draft-06/animal.html )
13
+
14
14
## Draft-2019-09
15
15
- [ draft-2019-09/array.html] ( draft-2019-09/array.html )
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ const defaultOptions = {
28
28
29
29
var JsonSchemaStaticDocs = function ( options ) {
30
30
this . _options = extend ( true , defaultOptions , options ) ;
31
+
32
+ this . _options . inputPath = this . _options . inputPath . replace ( / \/ $ / , "" ) ;
33
+ this . _options . outputPath = this . _options . outputPath . replace ( / \/ $ / , "" ) ;
31
34
} ;
32
35
33
36
JsonSchemaStaticDocs . prototype . generate = async function ( ) {
Original file line number Diff line number Diff line change @@ -3,15 +3,7 @@ const path = require("path");
3
3
const fg = require ( "fast-glob" ) ;
4
4
5
5
const removeSourcePathPrefix = ( filename , sourcePath ) => {
6
- let result = filename
7
- . replace (
8
- new RegExp (
9
- `/Users/collinst/Workspace/json-schema-static-docs/gh-pages/examples`
10
- ) ,
11
- ""
12
- )
13
- . replace ( / ^ \/ / , "" ) ;
14
-
6
+ let result = filename . replace ( new RegExp ( sourcePath ) , "" ) . replace ( / ^ \/ / , "" ) ;
15
7
return result ;
16
8
} ;
17
9
@@ -99,7 +91,9 @@ const sortFilenames = (filenames) => {
99
91
const createIndex = async ( indexPath , sourcePath , options ) => {
100
92
options = options || { } ;
101
93
102
- let files = await fg ( [ sourcePath + "/**" ] ) ;
94
+ const globPattern = path . join ( sourcePath , "/**" ) ;
95
+
96
+ let files = await fg ( [ globPattern ] ) ;
103
97
files = sortFilenames ( files ) ;
104
98
105
99
let title = options . title || "Index of Schema" ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " json-schema-static-docs" ,
3
- "version" : " 0.22.0 " ,
3
+ "version" : " 0.22.1 " ,
4
4
"description" : " Generates static documentation for humans based on the contents of JSON schema files (yml or json)." ,
5
5
"main" : " lib/json-schema-static-docs.js" ,
6
6
"bin" : {
You can’t perform that action at this time.
0 commit comments