Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gh-pages/examples/examples-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
- [oneof.html](oneof.html)
- [person.html](person.html)

## Draft-06
- [draft-06/animal.html](draft-06/animal.html)

## Draft-07
- [draft-07/user.html](draft-07/user.html)

## Draft-06
- [draft-06/animal.html](draft-06/animal.html)

## Draft-2019-09
- [draft-2019-09/array.html](draft-2019-09/array.html)
3 changes: 3 additions & 0 deletions lib/json-schema-static-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const defaultOptions = {

var JsonSchemaStaticDocs = function (options) {
this._options = extend(true, defaultOptions, options);

this._options.inputPath = this._options.inputPath.replace(/\/$/, "");
this._options.outputPath = this._options.outputPath.replace(/\/$/, "");
};

JsonSchemaStaticDocs.prototype.generate = async function () {
Expand Down
14 changes: 4 additions & 10 deletions lib/renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ const path = require("path");
const fg = require("fast-glob");

const removeSourcePathPrefix = (filename, sourcePath) => {
let result = filename
.replace(
new RegExp(
`/Users/collinst/Workspace/json-schema-static-docs/gh-pages/examples`
),
""
)
.replace(/^\//, "");

let result = filename.replace(new RegExp(sourcePath), "").replace(/^\//, "");
return result;
};

Expand Down Expand Up @@ -99,7 +91,9 @@ const sortFilenames = (filenames) => {
const createIndex = async (indexPath, sourcePath, options) => {
options = options || {};

let files = await fg([sourcePath + "/**"]);
const globPattern = path.join(sourcePath, "/**");

let files = await fg([globPattern]);
files = sortFilenames(files);

let title = options.title || "Index of Schema";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-schema-static-docs",
"version": "0.22.0",
"version": "0.22.1",
"description": "Generates static documentation for humans based on the contents of JSON schema files (yml or json).",
"main": "lib/json-schema-static-docs.js",
"bin": {
Expand Down