Skip to content

Commit

Permalink
🧹 Fixes to continuous numbering changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fwkoch committed Jan 9, 2025
1 parent 14eb694 commit e756be7
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/myst-cli/src/process/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,20 +383,16 @@ export function selectPageReferenceStates(
})
.filter((state): state is ReferenceState => !!state);
if (!opts?.suppressWarnings) warnOnDuplicateIdentifiers(session, pageReferenceStates);
pages.forEach((page) => {
const state = cache.$internalReferences[page.file];
if (!state) return;
const { mdast } = cache.$getMdast(page.file)?.post ?? {};
pageReferenceStates.forEach((state) => {
const { mdast } = cache.$getMdast(state.filePath)?.post ?? {};
if (!mdast) return;
const vfile = new VFile();
vfile.path = page.file;
buildIndexTransform(
mdast,
vfile,
state.vfile,
state,
new MultiPageReferenceResolver(pageReferenceStates, state.filePath),
);
logMessagesFromVFile(session, vfile);
logMessagesFromVFile(session, state.vfile);
});
return pageReferenceStates;
}
Expand Down Expand Up @@ -500,7 +496,7 @@ export async function fastProcessFile(
}),
]);
await Promise.all(
[...pages.map(({ file }) => file), ...fileParts].map(async (f) => {
[...pages.map((p) => p.file), ...fileParts].map(async (f) => {
return postProcessMdast(session, {
file: f,
pageReferenceStates,
Expand All @@ -509,7 +505,7 @@ export async function fastProcessFile(
}),
);
await Promise.all(
[...pages.map(({ file }) => file), ...fileParts].map(async (f) => {
[...pages.map((p) => p.file), ...fileParts].map(async (f) => {
const { mdast, frontmatter } = castSession(session).$getMdast(f)?.post ?? {};
if (mdast && frontmatter) {
await finalizeMdast(session, mdast, frontmatter, f, {
Expand Down

0 comments on commit e756be7

Please sign in to comment.