diff --git a/examples/docs/abstract.schema.md b/examples/docs/abstract.schema.md index c7cd2424ac94f7f32e6b9f8ecd749b5c19d31458..d43412ee4aa3a46a74becfb12ed74d1b91f75e34 100644 --- a/examples/docs/abstract.schema.md +++ b/examples/docs/abstract.schema.md @@ -1,9 +1,8 @@ - --- template: reference foo: bar --- - +# Abstract --- \ No newline at end of file diff --git a/examples/docs/definitions.schema.md b/examples/docs/definitions.schema.md index c7cd2424ac94f7f32e6b9f8ecd749b5c19d31458..50018180f2e8be28a8737fc3111eefc1d6b2fd86 100644 --- a/examples/docs/definitions.schema.md +++ b/examples/docs/definitions.schema.md @@ -1,9 +1,8 @@ - --- template: reference foo: bar --- - +# Definitions --- \ No newline at end of file diff --git a/examples/docs/example.schema.md b/examples/docs/example.schema.md index c7cd2424ac94f7f32e6b9f8ecd749b5c19d31458..c25446a5e9d593271c6c21b035073ed8fc2e9790 100644 --- a/examples/docs/example.schema.md +++ b/examples/docs/example.schema.md @@ -1,9 +1,8 @@ - --- template: reference foo: bar --- - +# Example --- \ No newline at end of file diff --git a/examples/docs/simple.schema.md b/examples/docs/simple.schema.md index c7cd2424ac94f7f32e6b9f8ecd749b5c19d31458..61036aa10d87548e71579130028313d701dd5ae0 100644 --- a/examples/docs/simple.schema.md +++ b/examples/docs/simple.schema.md @@ -1,9 +1,8 @@ - --- template: reference foo: bar --- - +# Simple --- \ No newline at end of file diff --git a/examples/docs/subdir/subdir.schema.md b/examples/docs/subdir/subdir.schema.md index c7cd2424ac94f7f32e6b9f8ecd749b5c19d31458..0f2cb03a0de707e6047b3ade1bfac17fe4ce73a1 100644 --- a/examples/docs/subdir/subdir.schema.md +++ b/examples/docs/subdir/subdir.schema.md @@ -1,9 +1,8 @@ - --- template: reference foo: bar --- - +# Subdir --- \ No newline at end of file diff --git a/lib/markdownWriter.js b/lib/markdownWriter.js index 54af0d8eef76c69c8730bf0d5704a4e25ace5d10..5dc91d6571f59213407c759bffdecec7f08d3c07 100644 --- a/lib/markdownWriter.js +++ b/lib/markdownWriter.js @@ -19,7 +19,7 @@ function render([ template, context ]) { } function build(total, fragment) { - return total + '\n' + fragment.replace(/\n\n/g, '\n'); + return total + fragment.replace(/\n\n/g, '\n'); } function assoc(obj, key, value) { @@ -38,12 +38,13 @@ const generateMarkdown = function(filename, schema, schemaPath, outDir, dependen dependencyMap:dependencyMap }; - console.log(schema.metaElements); + console.log(schema); // this structure allows us to have separate templates for each element. Instead of having // one huge template, each block can be built individually const multi = [ [ 'frontmatter.ejs', { meta: schema.metaElements } ], + [ 'header.ejs', { title: schema.title } ], //[ 'divider.ejs', null ], //[ 'topSchema.ejs', ctx ], [ 'divider.ejs', null ] diff --git a/templates/md/header.ejs b/templates/md/header.ejs new file mode 100644 index 0000000000000000000000000000000000000000..837be32de40bf919bb55444259e0e71bfa96227c --- /dev/null +++ b/templates/md/header.ejs @@ -0,0 +1,7 @@ +<% /** + * Copyright 2017 Adobe Systems Incorporated. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + */ %> +# <%=title %> \ No newline at end of file