Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose firstTimeLong to project settings #536

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/myst-cli/src/process/mdast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export async function transformMdast(
.use(htmlPlugin, { htmlHandlers })
.use(mathPlugin, { macros: frontmatter.math })
.use(glossaryPlugin, { state }) // This should be before the enumerate plugins
.use(abbreviationPlugin, { abbreviations: frontmatter.abbreviations })
.use(abbreviationPlugin, { abbreviations: frontmatter.abbreviations, firstTimeLong: frontmatter.firstTimeLong })
.use(enumerateTargetsPlugin, { state }) // This should be after math
.use(joinGatesPlugin)
.run(mdast, vfile);
Expand Down
1 change: 1 addition & 0 deletions packages/myst-frontmatter/src/frontmatter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export type ProjectFrontmatter = SiteFrontmatter & {
math?: Record<string, string>;
/** Abbreviations used throughout the project */
abbreviations?: Record<string, string>;
firstTimeLong?: boolean;
exports?: Export[];
thebe?: Thebe;
requirements?: string[];
Expand Down
5 changes: 5 additions & 0 deletions packages/myst-frontmatter/src/frontmatter/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const PROJECT_FRONTMATTER_KEYS = [
'bibliography',
'math',
'abbreviations',
'firstTimeLong',
'exports',
// Do not add any project specific keys here!
].concat(SITE_FRONTMATTER_KEYS);
Expand All @@ -94,6 +95,7 @@ export const USE_PROJECT_FALLBACK = [
'subject',
'venue',
'biblio',
'firstTimeLong',
'numbering',
'keywords',
];
Expand Down Expand Up @@ -751,6 +753,9 @@ export function validateSharedProjectFrontmatterKeys(
if (defined(value.open_access)) {
output.open_access = validateBoolean(value.open_access, incrementOptions('open_access', opts));
}
if (defined(value.firstTimeLong)) {
output.firstTimeLong = validateBoolean(value.firstTimeLong, incrementOptions('firstTimeLong', opts));
}
if (defined(value.license)) {
output.license = validateLicenses(value.license, incrementOptions('license', opts));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mystmd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"unlink": "npm uninstall -g mystmd",
"link": "npm run unlink; npm link;",
"copy:version": "echo \"const version = '\"$npm_package_version\"';\nexport default version;\" > src/version.ts",
"dev": "npm run link && esbuild src/index.ts --bundle --outfile=dist/myst.cjs --platform=node --external:fsevents --watch",
"dev": "npm run link && esbuild src/index.ts --bundle --outfile=dist/myst.cjs --platform=node --external:fsevents",
"lint": "npm run copy:version; eslint \"src/**/*.ts\" -c .eslintrc.cjs",
"lint:format": "npm run copy:version; prettier --check \"src/**/*.ts\"",
"test": "npm run link; npm run copy:version; vitest run",
Expand Down