From f96a6f55410d18a58ad7f38741ad785e12d1d06e Mon Sep 17 00:00:00 2001 From: Lars Trieloff <trieloff@adobe.com> Date: Thu, 26 Apr 2018 15:51:42 +0000 Subject: [PATCH] Include schema status in README --- cli.js | 0 examples/docs/README.md | 34 ++++++++++++++++---------------- lib/readmeWriter.js | 1 + spec/examples/README.md | 34 ++++++++++++++++---------------- spec/lib/integrationTest.spec.js | 1 - templates/md/readme.ejs | 2 +- 6 files changed, 36 insertions(+), 36 deletions(-) mode change 100644 => 100755 cli.js diff --git a/cli.js b/cli.js old mode 100644 new mode 100755 diff --git a/examples/docs/README.md b/examples/docs/README.md index b15a093..cbf8be8 100644 --- a/examples/docs/README.md +++ b/examples/docs/README.md @@ -6,24 +6,24 @@ ## / -* [Abstract](./abstract.schema.md) – `https://example.com/schemas/abstract` -* [Arrays](./arrays.schema.md) – `https://example.com/schemas/arrays` -* [Complex References ](./complex.schema.md) – `https://example.com/schemas/complex` -* [Constant Types](./constants.schema.md) – `https://example.com/schemas/constants` -* [Custom](./custom.schema.md) – `https://example.com/schemas/custom` -* [Deeply Extending](./deepextending.schema.md) – `https://example.com/schemas/deepextending` -* [Definitions](./definitions.schema.md) – `https://example.com/schemas/definitions` -* [Enumerated ](./enums.schema.md) – `https://example.com/schemas/enums` -* [Example](./example.schema.md) – `https://example.com/schemas/example` -* [Examples](./examples.schema.md) – `https://example.com/schemas/examples` -* [Extending](./extending.schema.md) – `https://example.com/schemas/extending` -* [Extensible](./extensible.schema.md) – `https://example.com/schemas/extensible` -* [Identifiable](./identifiable.schema.md) – `https://example.com/schemas/identifiable` -* [Simple](./simple.schema.md) – `https://example.com/schemas/simple` -* [Simple Types](./simpletypes.schema.md) – `https://example.com/schemas/simpletypes` -* [Stabilizing](./stabilizing.schema.md) – `https://example.com/schemas/stabilizing` +* [Abstract](./abstract.schema.md) – `https://example.com/schemas/abstract` (Unknown) +* [Arrays](./arrays.schema.md) – `https://example.com/schemas/arrays` (Unknown) +* [Complex References ](./complex.schema.md) – `https://example.com/schemas/complex` (Unknown) +* [Constant Types](./constants.schema.md) – `https://example.com/schemas/constants` (Unknown) +* [Custom](./custom.schema.md) – `https://example.com/schemas/custom` (Unknown) +* [Deeply Extending](./deepextending.schema.md) – `https://example.com/schemas/deepextending` (Unknown) +* [Definitions](./definitions.schema.md) – `https://example.com/schemas/definitions` (Unknown) +* [Enumerated ](./enums.schema.md) – `https://example.com/schemas/enums` (Unknown) +* [Example](./example.schema.md) – `https://example.com/schemas/example` (Unknown) +* [Examples](./examples.schema.md) – `https://example.com/schemas/examples` (Unknown) +* [Extending](./extending.schema.md) – `https://example.com/schemas/extending` (Unknown) +* [Extensible](./extensible.schema.md) – `https://example.com/schemas/extensible` (Unknown) +* [Identifiable](./identifiable.schema.md) – `https://example.com/schemas/identifiable` (Unknown) +* [Simple](./simple.schema.md) – `https://example.com/schemas/simple` (Unknown) +* [Simple Types](./simpletypes.schema.md) – `https://example.com/schemas/simpletypes` (Unknown) +* [Stabilizing](./stabilizing.schema.md) – `https://example.com/schemas/stabilizing` (Stabilizing) ## /subdir/ -* [Subdir](./subdir/subdir.schema.md) – `https://example.com/schemas/subdir/subdir` +* [Subdir](./subdir/subdir.schema.md) – `https://example.com/schemas/subdir/subdir` (Unknown) diff --git a/lib/readmeWriter.js b/lib/readmeWriter.js index ddac3dd..8b047a9 100644 --- a/lib/readmeWriter.js +++ b/lib/readmeWriter.js @@ -38,6 +38,7 @@ const generateReadme = function(paths, schemas, out, base) { id: schema.jsonSchema.$id, title: schema.jsonSchema.title, full: schema.filePath, + status: schema.jsonSchema['meta:status'] !== undefined ? (schema.jsonSchema['meta:status'].charAt(0).toUpperCase() + schema.jsonSchema['meta:status'].slice(1)) : 'Unknown', relative: relativePath(schema.filePath, base), dir: directory(schema.filePath, base), }; diff --git a/spec/examples/README.md b/spec/examples/README.md index b15a093..cbf8be8 100644 --- a/spec/examples/README.md +++ b/spec/examples/README.md @@ -6,24 +6,24 @@ ## / -* [Abstract](./abstract.schema.md) – `https://example.com/schemas/abstract` -* [Arrays](./arrays.schema.md) – `https://example.com/schemas/arrays` -* [Complex References ](./complex.schema.md) – `https://example.com/schemas/complex` -* [Constant Types](./constants.schema.md) – `https://example.com/schemas/constants` -* [Custom](./custom.schema.md) – `https://example.com/schemas/custom` -* [Deeply Extending](./deepextending.schema.md) – `https://example.com/schemas/deepextending` -* [Definitions](./definitions.schema.md) – `https://example.com/schemas/definitions` -* [Enumerated ](./enums.schema.md) – `https://example.com/schemas/enums` -* [Example](./example.schema.md) – `https://example.com/schemas/example` -* [Examples](./examples.schema.md) – `https://example.com/schemas/examples` -* [Extending](./extending.schema.md) – `https://example.com/schemas/extending` -* [Extensible](./extensible.schema.md) – `https://example.com/schemas/extensible` -* [Identifiable](./identifiable.schema.md) – `https://example.com/schemas/identifiable` -* [Simple](./simple.schema.md) – `https://example.com/schemas/simple` -* [Simple Types](./simpletypes.schema.md) – `https://example.com/schemas/simpletypes` -* [Stabilizing](./stabilizing.schema.md) – `https://example.com/schemas/stabilizing` +* [Abstract](./abstract.schema.md) – `https://example.com/schemas/abstract` (Unknown) +* [Arrays](./arrays.schema.md) – `https://example.com/schemas/arrays` (Unknown) +* [Complex References ](./complex.schema.md) – `https://example.com/schemas/complex` (Unknown) +* [Constant Types](./constants.schema.md) – `https://example.com/schemas/constants` (Unknown) +* [Custom](./custom.schema.md) – `https://example.com/schemas/custom` (Unknown) +* [Deeply Extending](./deepextending.schema.md) – `https://example.com/schemas/deepextending` (Unknown) +* [Definitions](./definitions.schema.md) – `https://example.com/schemas/definitions` (Unknown) +* [Enumerated ](./enums.schema.md) – `https://example.com/schemas/enums` (Unknown) +* [Example](./example.schema.md) – `https://example.com/schemas/example` (Unknown) +* [Examples](./examples.schema.md) – `https://example.com/schemas/examples` (Unknown) +* [Extending](./extending.schema.md) – `https://example.com/schemas/extending` (Unknown) +* [Extensible](./extensible.schema.md) – `https://example.com/schemas/extensible` (Unknown) +* [Identifiable](./identifiable.schema.md) – `https://example.com/schemas/identifiable` (Unknown) +* [Simple](./simple.schema.md) – `https://example.com/schemas/simple` (Unknown) +* [Simple Types](./simpletypes.schema.md) – `https://example.com/schemas/simpletypes` (Unknown) +* [Stabilizing](./stabilizing.schema.md) – `https://example.com/schemas/stabilizing` (Stabilizing) ## /subdir/ -* [Subdir](./subdir/subdir.schema.md) – `https://example.com/schemas/subdir/subdir` +* [Subdir](./subdir/subdir.schema.md) – `https://example.com/schemas/subdir/subdir` (Unknown) diff --git a/spec/lib/integrationTest.spec.js b/spec/lib/integrationTest.spec.js index 7101d6d..ba3e13a 100644 --- a/spec/lib/integrationTest.spec.js +++ b/spec/lib/integrationTest.spec.js @@ -50,7 +50,6 @@ describe('Compare results', () => { '--link-status', 'status.md' ]); - ls.on('close', code => { expect(code).toEqual(0); diff --git a/templates/md/readme.ejs b/templates/md/readme.ejs index a275b9c..9bd71f2 100644 --- a/templates/md/readme.ejs +++ b/templates/md/readme.ejs @@ -11,5 +11,5 @@ <% _.forIn(groups, (schemas, group) => { %> ## <%= group %> <% _.forEach(_.sortBy(schemas, [o => { return o.title }]), schema => { %> -* [<%= schema.title %>](.<%= schema.relative %>.schema.md) – `<%= schema.id %>`<% }); %> +* [<%= schema.title %>](.<%= schema.relative %>.schema.md) – `<%= schema.id %>` (<%= schema.status %>)<% }); %> <% }); %> -- GitLab