From b6fcf5301d37e11adcc383f937eb7564f865f3ee Mon Sep 17 00:00:00 2001 From: Lars Trieloff Date: Wed, 4 Dec 2019 15:24:20 +0000 Subject: [PATCH] feat(markdown): show id and status in header --- lib/formatInfo.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/formatInfo.js b/lib/formatInfo.js index d597fce6..1da148de 100644 --- a/lib/formatInfo.js +++ b/lib/formatInfo.js @@ -77,13 +77,21 @@ function formatInfo({ extension }) { } } + function iscustom(schema) { + return [...(schema.allOf || [])] + .filter(e => typeof e === 'object') + .filter(e => typeof e.$ref === 'string') + .filter(({ $ref }) => $ref === 'https://ns.adobe.com/xdm/common/extensible.schema.json#/definitions/@context') + .length > 0; + } + function formatmeta(schema) { return { abstract: isabstract(schema.schema), extensible: isextensible(schema.schema), status: schema.schema['meta:status'] || undefined, identifiable: isidentifiable(schema.schema), - custom: undefined, + custom: iscustom(schema.schema), additional: undefined, definedin: undefined };