Skip to content

Commit 21e9b9c

Browse files
committed
change to myst-migrate
1 parent 7b048a3 commit 21e9b9c

File tree

34 files changed

+262
-268
lines changed

34 files changed

+262
-268
lines changed

.changeset/eight-tools-live.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"myst-transforms": patch
3+
"myst-spec-ext": patch
4+
"myst-to-docx": patch
5+
"myst-config": patch
6+
"myst-cli": patch
7+
---
8+
9+
Change footnotes to use enumerator over number

.changeset/eleven-keys-explain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"myst-config": patch
3+
---
4+
5+
Add version to config file

.changeset/red-suits-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"myst-cli": patch
3+
---
4+
5+
Add version to site content outputs

docs/myst.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ project:
153153
- file: document-parts.md
154154
- file: settings.md
155155
- file: glossary.md
156+
- file: versions.md
156157
- title: Contribute
157158
children:
158159
- file: contributing.md

docs/versions.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: MyST Content Versions
3+
---
4+
5+
The following page describes changes to the MyST content that is served from the `.json` endpoint of a MyST Site. The `myst-compat` package can be used to translate between versions by upgrading and downgrading between versions.
6+
7+
The version is a string integer (i.e. `'1'` or `'2'`) and is incremented with every change to the content of a MyST page, which includes metadata as well as the MyST AST.
8+
9+
# MyST Versions
10+
11+
## Version 1 - 2025-02-07 - Footnote Numbering
12+
13+
The footnotes have dropped backwards compatibility with `number`, instead using `enumerator` on both the `FootnoteReference` and `FootnoteDefinition` nodes.
14+
Previous versions of the AST had both of these defined. The `enumerator` property is used in all other numberings of figures, sections, equations, etc.
15+
16+
## Version 0 - Pre 2025-02-01
17+
18+
This is the first version of MyST AST considered to be versioned, subsequent releases will have changes for migrating the content between versions.

package-lock.json

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/myst-cli/src/build/site/manifest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { getSiteTemplate } from './template.js';
2525
import { collectExportOptions } from '../utils/collectExportOptions.js';
2626
import { filterPages } from '../../project/load.js';
2727
import { getRawFrontmatterFromFile } from '../../process/file.js';
28+
import { SPEC_VERSION } from '../../spec-version.js';
2829

2930
type ManifestProject = Required<SiteManifest>['projects'][0];
3031

@@ -411,9 +412,10 @@ export async function getSiteManifest(
411412
validatedFrontmatter.options = resolvedOptions;
412413
const parts = resolveFrontmatterParts(session, validatedFrontmatter);
413414
const manifest: SiteManifest = {
415+
version: SPEC_VERSION,
416+
myst: version,
414417
...validatedFrontmatter,
415418
parts,
416-
myst: version,
417419
nav: nav || [],
418420
actions: actions || [],
419421
projects: siteProjects,

packages/myst-cli/src/process/site.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ export async function writeFile(
389389
const parts = resolveFrontmatterParts(session, frontmatter);
390390
const frontmatterWithExports = { ...frontmatter, exports, downloads, parts };
391391
const mystData: MystData = {
392+
version: SPEC_VERSION,
392393
kind,
393394
sha256,
394395
slug,
@@ -398,7 +399,6 @@ export async function writeFile(
398399
widgets,
399400
mdast,
400401
references,
401-
version: SPEC_VERSION,
402402
};
403403
const jsonFilenameParts = [session.contentPath()];
404404
if (projectSlug) jsonFilenameParts.push(projectSlug);

packages/myst-cli/src/spec-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const SPEC_VERSION = '1';
1+
export const SPEC_VERSION = 1;

packages/myst-cli/src/transforms/crossReferences.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function mystDataFilename(dataUrl: string) {
1717
}
1818

1919
export type MystData = {
20+
version: number;
2021
kind?: SourceFileKind;
2122
sha256?: string;
2223
slug?: string;
@@ -30,7 +31,6 @@ export type MystData = {
3031
widgets?: Record<string, any>;
3132
mdast?: GenericParent;
3233
references?: References;
33-
version?: string;
3434
};
3535

3636
async function fetchMystData(

packages/myst-compat/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/myst-compat/src/downgrade/index.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/myst-compat/src/downgrade/version_2_1.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

packages/myst-compat/src/index.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/myst-compat/src/types/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/myst-compat/src/types/v1.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/myst-compat/src/types/v2.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/myst-compat/src/upgrade/index.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/myst-compat/src/upgrade/version_1_2.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

packages/myst-config/src/site/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ type ManifestProject = {
6969
} & Omit<ProjectFrontmatter, 'downloads' | 'exports' | 'parts'>;
7070

7171
export type SiteManifest = Omit<SiteFrontmatter, 'parts'> & {
72+
version: number;
7273
myst: string;
7374
id?: string;
7475
projects?: ManifestProject[];

0 commit comments

Comments
 (0)