Skip to content

Commit

Permalink
🎨 Theme updates for showing proofs, algorithms, and github previews (#…
Browse files Browse the repository at this point in the history
…140)

* 🎨 Update for showing proofs

* Update Playwright Snapshots

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
rowanc1 and github-actions[bot] authored May 16, 2023
1 parent 899330e commit 41f501e
Show file tree
Hide file tree
Showing 6 changed files with 291 additions and 118 deletions.
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,25 @@
"@jupyterlab/notebook": "^3.4.7",
"@jupyterlab/rendermime": "^3.4.7",
"@jupyterlab/translation": "^3.4.7",
"@myst-theme/diagrams": "^0.1.32",
"@myst-theme/frontmatter": "^0.1.32",
"@myst-theme/providers": "^0.1.32",
"@myst-theme/diagrams": "^0.2.6",
"@myst-theme/frontmatter": "^0.2.6",
"@myst-theme/providers": "^0.2.6",
"katex": "^0.15.2",
"myst-ext-card": "^0.0.4",
"myst-ext-grid": "^0.0.4",
"myst-ext-tabs": "^0.0.4",
"myst-frontmatter": "^0.0.9",
"myst-parser": "^0.0.23",
"myst-to-react": "^0.1.32",
"myst-transforms": "^0.0.23"
"myst-ext-card": "^0.0.7",
"myst-ext-grid": "^0.0.7",
"myst-ext-tabs": "^0.0.7",
"myst-ext-proof": "^0.0.2",
"myst-frontmatter": "^0.0.13",
"myst-parser": "^0.0.30",
"myst-to-react": "^0.2.6",
"myst-transforms": "^0.0.30"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@jupyterlab/builder": "^3.4.7",
"@jupyterlab/testutils": "^3.4.7",
"@myst-theme/styles": "^0.1.32",
"@myst-theme/styles": "^0.2.6",
"@tailwindcss/typography": "^0.5.8",
"@types/jest": "^26.0.0",
"@types/react": "^17.0.1",
Expand Down
11 changes: 8 additions & 3 deletions src/myst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
import { cardDirective } from 'myst-ext-card';
import { gridDirective } from 'myst-ext-grid';
import { tabDirectives } from 'myst-ext-tabs';
import { proofDirective } from 'myst-ext-proof';
import { StaticNotebook } from '@jupyterlab/notebook';
import { getCellList } from './utils';
import { imageUrlSourceTransform } from './images';
Expand All @@ -50,7 +51,12 @@ const evalRole: RoleSpec = {

export function markdownParse(text: string): Root {
const mdast = mystParse(text, {
directives: [cardDirective, gridDirective, ...tabDirectives],
directives: [
cardDirective,
gridDirective,
proofDirective,
...tabDirectives
],
roles: [evalRole]
});
// Parsing individually here requires that link and footnote references are contained to the cell
Expand Down Expand Up @@ -102,7 +108,6 @@ export function parseContent(notebook: StaticNotebook): Promise<void> {
const file = new VFile();
const references = {
cite: { order: [], data: {} },
footnotes: {},
article: mdast as any
};
const { frontmatter: frontmatterRaw } = getFrontmatter(
Expand All @@ -128,7 +133,7 @@ export function parseContent(notebook: StaticNotebook): Promise<void> {
.use(mathPlugin, { macros: frontmatter?.math ?? {} }) // This must happen before enumeration, as it can add labels
.use(enumerateTargetsPlugin, { state })
.use(linksPlugin, { transformers: linkTransforms })
.use(footnotesPlugin, { references })
.use(footnotesPlugin)
.use(resolveReferencesPlugin, { state })
.use(internalLinksPlugin, { notebook })
.use(addCiteChildrenPlugin)
Expand Down
5 changes: 5 additions & 0 deletions style/jupyterlab-typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@
.myst > *:last-child {
margin-bottom: 0.5em;
}

.article {
/* This is a required class currently in the hover-card */
@apply myst;
}
}
1 change: 1 addition & 0 deletions style/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
@import '@myst-theme/styles/cross-references.css';
@import '@myst-theme/styles/block-styles.css';
@import '@myst-theme/styles/tasklists.css';
@import '@myst-theme/styles/hover.css';
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 41f501e

Please sign in to comment.