Skip to content
Snippets Groups Projects
Commit c8165b27 authored by Lars Trieloff's avatar Lars Trieloff
Browse files

Pass docs through to header writer

parent 9a6366d1
Branches
Tags
No related merge requests found
...@@ -133,7 +133,7 @@ function ejsRender(template, ctx) { ...@@ -133,7 +133,7 @@ function ejsRender(template, ctx) {
//return JSON.stringify(obj, null, 2); //return JSON.stringify(obj, null, 2);
} }
const generateMarkdown = function(filename, schema, schemaPath, outDir, dependencyMap) { const generateMarkdown = function(filename, schema, schemaPath, outDir, dependencyMap, docs) {
var ctx = { var ctx = {
schema: schema, schema: schema,
_: _, _: _,
...@@ -151,7 +151,7 @@ const generateMarkdown = function(filename, schema, schemaPath, outDir, dependen ...@@ -151,7 +151,7 @@ const generateMarkdown = function(filename, schema, schemaPath, outDir, dependen
[ 'header.ejs', { [ 'header.ejs', {
schema: schema, schema: schema,
dependencies: flatten(dependencyMap), dependencies: flatten(dependencyMap),
table: headers(schema, schemaPath, filename).render() } ], table: headers(schema, schemaPath, filename, docs).render() } ],
//[ 'divider.ejs', null ], //[ 'divider.ejs', null ],
//[ 'topSchema.ejs', ctx ], //[ 'topSchema.ejs', ctx ],
[ 'examples.ejs', { examples: stringifyExamples(schema.examples), title: schema.title } ] [ 'examples.ejs', { examples: stringifyExamples(schema.examples), title: schema.title } ]
......
...@@ -421,7 +421,7 @@ Schema.process = function(schemaMap, schemaPath, docDir, schemaDir, metaElements ...@@ -421,7 +421,7 @@ Schema.process = function(schemaMap, schemaPath, docDir, schemaDir, metaElements
}); });
}).then(object => { }).then(object => {
return Promise.all([ return Promise.all([
markdownWriter(schemaMap[schemaKey].filePath, object.mSchema, schemaPath, docDir, object.dep), markdownWriter(schemaMap[schemaKey].filePath, object.mSchema, schemaPath, docDir, object.dep, docs),
schemaWriter(schemaMap[schemaKey].filePath, object.wSchema, schemaPath, schemaDir) ]); schemaWriter(schemaMap[schemaKey].filePath, object.wSchema, schemaPath, schemaDir) ]);
}); });
}).then(result => { }).then(result => {
......
...@@ -21,7 +21,9 @@ describe('Process examples', () => { ...@@ -21,7 +21,9 @@ describe('Process examples', () => {
'-m', '-m',
'template=reference', 'template=reference',
'-m', '-m',
'foo=bar' 'foo=bar',
'--link-abstract',
'../abstract.md'
]); ]);
ls.on('close', code => { ls.on('close', code => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment