diff --git a/packages/myst-to-react/src/basic.tsx b/packages/myst-to-react/src/basic.tsx index 81564a956..01d6e7d01 100644 --- a/packages/myst-to-react/src/basic.tsx +++ b/packages/myst-to-react/src/basic.tsx @@ -4,6 +4,7 @@ import type { NodeRenderer } from '@myst-theme/providers'; import classNames from 'classnames'; import { Tooltip } from './components/index.js'; import { MyST } from './MyST.js'; +import type { GenericNode } from 'myst-common'; type TableExts = { rowspan?: number; @@ -46,6 +47,7 @@ type BasicNodeRenderers = { emphasis: NodeRenderer; link: NodeRenderer; paragraph: NodeRenderer; + algorithmLine: NodeRenderer; break: NodeRenderer; inlineMath: NodeRenderer; math: NodeRenderer; @@ -129,6 +131,17 @@ const BASIC_RENDERERS: BasicNodeRenderers = {

); }, + algorithmLine({ node }) { + // Used in algorithms + const style = { + paddingLeft: `${(node.indent ?? 0) + 2}rem`, + }; + return ( +

+ +

+ ); + }, break() { return
; }, diff --git a/styles/app.css b/styles/app.css index 7fb65d115..cb03d6d0d 100644 --- a/styles/app.css +++ b/styles/app.css @@ -12,3 +12,4 @@ @import './tasklists.css'; @import './grid.css'; @import './hover.css'; +@import './proof.css'; diff --git a/styles/proof.css b/styles/proof.css new file mode 100644 index 000000000..bf4469bba --- /dev/null +++ b/styles/proof.css @@ -0,0 +1,16 @@ +p[data-line-number].line::before { + content: attr(data-line-number); + position: absolute; + left: 0; + font-family: monospace; + width: 1.25em; + text-align: right; + user-select: none; + color: gray; + overflow: hidden; +} + +p.line { + position: relative; + margin: 0; +}