Skip to content

Commit

Permalink
🪵 Log missing citations in the correct place (#942)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwkoch authored Feb 28, 2024
1 parent b289f03 commit 3c9d996
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/gentle-hounds-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'myst-common': patch
'myst-cli': patch
---

Log missing citations in the correct place
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 @@ -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 = [
Expand Down
3 changes: 0 additions & 3 deletions packages/myst-cli/src/transforms/citations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion packages/myst-common/src/ruleids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 3c9d996

Please sign in to comment.