myst-frontmatter
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -114,3 +114,12 @@ "use strict"; | ||
const JUPYTEXT_KEYS = ['formats', 'text_representation']; | ||
exports.RESERVED_EXPORT_KEYS = ['format', 'template', 'output', 'id', 'name', 'renderer']; | ||
exports.RESERVED_EXPORT_KEYS = [ | ||
'format', | ||
'template', | ||
'output', | ||
'id', | ||
'name', | ||
'renderer', | ||
'article', | ||
'sub_articles', | ||
]; | ||
const KNOWN_ALIASES = { | ||
@@ -540,2 +549,15 @@ author: 'authors', | ||
} | ||
if ((0, simple_validators_1.defined)(value.article)) { | ||
output.article = (0, simple_validators_1.validateString)(value.article, (0, simple_validators_1.incrementOptions)('article', opts)); | ||
} | ||
if ((0, simple_validators_1.defined)(value.sub_articles)) { | ||
if (output.format !== types_1.ExportFormats.xml) { | ||
(0, simple_validators_1.validationError)("sub_articles are only supported for exports of format 'jats'", opts); | ||
} | ||
else { | ||
output.sub_articles = (0, simple_validators_1.validateList)(value.sub_articles, (0, simple_validators_1.incrementOptions)('sub_articles', opts), (file, ind) => { | ||
return (0, simple_validators_1.validateString)(file, (0, simple_validators_1.incrementOptions)(`sub_articles.${ind}`, opts)); | ||
}); | ||
} | ||
} | ||
return output; | ||
@@ -542,0 +564,0 @@ } |
@@ -108,3 +108,12 @@ import doi from 'doi-utils'; | ||
const JUPYTEXT_KEYS = ['formats', 'text_representation']; | ||
export const RESERVED_EXPORT_KEYS = ['format', 'template', 'output', 'id', 'name', 'renderer']; | ||
export const RESERVED_EXPORT_KEYS = [ | ||
'format', | ||
'template', | ||
'output', | ||
'id', | ||
'name', | ||
'renderer', | ||
'article', | ||
'sub_articles', | ||
]; | ||
const KNOWN_ALIASES = { | ||
@@ -522,2 +531,15 @@ author: 'authors', | ||
} | ||
if (defined(value.article)) { | ||
output.article = validateString(value.article, incrementOptions('article', opts)); | ||
} | ||
if (defined(value.sub_articles)) { | ||
if (output.format !== ExportFormats.xml) { | ||
validationError("sub_articles are only supported for exports of format 'jats'", opts); | ||
} | ||
else { | ||
output.sub_articles = validateList(value.sub_articles, incrementOptions('sub_articles', opts), (file, ind) => { | ||
return validateString(file, incrementOptions(`sub_articles.${ind}`, opts)); | ||
}); | ||
} | ||
} | ||
return output; | ||
@@ -524,0 +546,0 @@ } |
@@ -100,2 +100,5 @@ import type { CreditRole } from 'credit-roles'; | ||
output?: string; | ||
article?: string; | ||
/** sub_articles are only for jats xml export */ | ||
sub_articles?: string[]; | ||
} & Record<string, any>; | ||
@@ -102,0 +105,0 @@ export declare type SiteFrontmatter = { |
{ | ||
"name": "myst-frontmatter", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
174808
3454