Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsonschema2md
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fork
jsonschema2md
Commits
d55fbe74
Commit
d55fbe74
authored
7 years ago
by
Lars Trieloff
Browse files
Options
Downloads
Patches
Plain Diff
add parsing of --link-* cli args
parent
50e7ef15
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cli.js
+4
-0
4 additions, 0 deletions
cli.js
with
4 additions
and
0 deletions
cli.js
+
4
−
0
View file @
d55fbe74
...
@@ -35,6 +35,7 @@ var argv = require('optimist')
...
@@ -35,6 +35,7 @@ var argv = require('optimist')
.
describe
(
'
x
'
,
'
output JSON Schema files including description and validated examples in the _new folder at output directory
'
)
.
describe
(
'
x
'
,
'
output JSON Schema files including description and validated examples in the _new folder at output directory
'
)
.
alias
(
'
n
'
,
'
no-readme
'
)
.
alias
(
'
n
'
,
'
no-readme
'
)
.
describe
(
'
n
'
,
'
Do not generate a README.md file in the output directory
'
)
.
describe
(
'
n
'
,
'
Do not generate a README.md file in the output directory
'
)
.
describe
(
'
link-*
'
,
'
Add this file as a link the explain the * attribute, e.g. --link-abstract=abstract.md
'
)
.
check
(
function
(
args
)
{
.
check
(
function
(
args
)
{
if
(
!
fs
.
existsSync
(
args
.
input
))
{
if
(
!
fs
.
existsSync
(
args
.
input
))
{
throw
'
Input file "
'
+
args
.
input
+
'
" does not exist!
'
;
throw
'
Input file "
'
+
args
.
input
+
'
" does not exist!
'
;
...
@@ -45,6 +46,9 @@ var argv = require('optimist')
...
@@ -45,6 +46,9 @@ var argv = require('optimist')
})
})
.
argv
;
.
argv
;
const
docs
=
_
.
fromPairs
(
_
.
toPairs
(
argv
).
filter
(([
key
,
value
])
=>
{
return
key
.
startsWith
(
'
link-
'
);
}).
map
(([
key
,
value
])
=>
{
return
[
key
.
substr
(
5
),
value
];}));
console
.
log
(
docs
);
var
ajv
=
new
Ajv
({
allErrors
:
true
,
messages
:
true
});
var
ajv
=
new
Ajv
({
allErrors
:
true
,
messages
:
true
});
ajv
.
addMetaSchema
(
require
(
'
ajv/lib/refs/json-schema-draft-04.json
'
));
ajv
.
addMetaSchema
(
require
(
'
ajv/lib/refs/json-schema-draft-04.json
'
));
var
schemaPathMap
=
{};
var
schemaPathMap
=
{};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment