diff --git a/.changeset/gentle-hounds-boil.md b/.changeset/gentle-hounds-boil.md new file mode 100644 index 000000000..94a3411e0 --- /dev/null +++ b/.changeset/gentle-hounds-boil.md @@ -0,0 +1,6 @@ +--- +'myst-common': patch +'myst-cli': patch +--- + +Log missing citations in the correct place diff --git a/packages/myst-cli/src/process/mdast.ts b/packages/myst-cli/src/process/mdast.ts index 6162c6f16..14d743060 100644 --- a/packages/myst-cli/src/process/mdast.ts +++ b/packages/myst-cli/src/process/mdast.ts @@ -296,7 +296,7 @@ export async function postProcessMdast( const { mdast, dependencies } = mdastPost; const fileState = cache.$internalReferences[file]; const state = pageReferenceStates - ? new MultiPageReferenceResolver(pageReferenceStates, file) + ? new MultiPageReferenceResolver(pageReferenceStates, file, vfile) : fileState; // NOTE: This is doing things in place, we should potentially make this a different state? const transformers = [ diff --git a/packages/myst-cli/src/transforms/citations.ts b/packages/myst-cli/src/transforms/citations.ts index f709e0f5a..e00695af2 100644 --- a/packages/myst-cli/src/transforms/citations.ts +++ b/packages/myst-cli/src/transforms/citations.ts @@ -37,9 +37,6 @@ function addCitationChildren( ): boolean { const render = renderer[cite.label as string]; if (!render) { - addWarningForFile(session, file, `Citation not found for label: ${cite.label}`, 'error', { - ruleId: RuleId.citationLabelExists, - }); cite.error = 'not found'; return false; } diff --git a/packages/myst-common/src/ruleids.ts b/packages/myst-common/src/ruleids.ts index 591f0c012..210f4cc40 100644 --- a/packages/myst-common/src/ruleids.ts +++ b/packages/myst-common/src/ruleids.ts @@ -81,7 +81,6 @@ export enum RuleId { citationIsUnique = 'citation-is-unique', bibFileExists = 'bib-file-exists', citationRenders = 'citation-renders', - citationLabelExists = 'citation-label-exists', // Code rules codeMetadataLifted = 'code-metadata-lifted', codeMetatagsValid = 'code-metatags-valid',