This is all very much my draft notes currently but will be worked upon in the comming days, so take everything with a grain of salt.
tl;dr This is looking really promising already in terms of translatability, the main callenge here will likely be the rewrite of the Layout process into separate steps as discussed.
Comparison Typst => HTML
How easy we could convert most functions into a HTML/CSS counterpart.
Text
#lorem() -> #text
#emph -> <em>
#linebreak -> <br>
#lower -> <span class="lower"> or similar with text-transform: lowercase
#overline -> <span class="overline"> with text-decoration: overline
#raw -> <code> with syntax highlighting done over a <div> instead (possibly highlight.js)
#smallcaps -> <span class="smallcaps">
#smartquote -> #text
#strike -> <s>
#strong -> <strong>
#sub -> <sub>
#super -> <sup>
#text -> <span>
#underline -> <span class="underline"> with text-decoration: underline
#upper -> <span class="upper"> or similar with text-transform: uppercase
Math
Good sauce: https://fred-wang.github.io/TeXZilla/
accent -> <mover>
attach -> <munderover> / <msubsup>
scripts -> <msubsup>
limits -> <munderover>
binom -> <mrow><mo>(</mo><mfrac linethickness="0px"><mi>n</mi><mi>k</mi></mfrac><mo>)</mo></mrow>
cases -> <mrow><mo>{</mo><mtable columnalign="left left" displaystyle="false"></mtable></mrow>
equation -> <math>
frac -> <mfrac>
lr -> <mrow> with <mo>
mat -> <mtable>
root -> <mroot> and <msqrt>
round -> Same as lr
styles -> with css
op -> <mo> or <mi>
under/over -> <munderover>
variants -> #text
vec -> <mtable>
Layout
#align -> <span class="center"> with text-align: center
#block -> <div>
#box -> <div class="box"> with display: inline-block
#list -> <ul>
#colbreak -> maybe possible with css break-before: ...
#columns -> possible with column-count: 2
#grid -> <div class="grid"> with display: grid and so on
#hide -> either with opacity: 0 or using a <div> with a fixed width
#measure -> maybe possible with js?
#move -> with position: relative; top: y, left: x
#enum -> <ol> tbh, the name could maybe be improved
#pad -> with padding: 10pt 2pt ...
#page -> Doesn't make sense in context of web media
#pagebreak -> Same as #page
#par -> <p>
#parbreak -> beginning of new <p>
#place -> with position: absolute; top: ...
#repeat -> Could maybe be possible with width: 100%; overflow: hidden but very hacky
#rotate -> with transform: rotate(...)
#scale -> with transform: scale(...)
#h -> possibly with position: inline-block; width: ...
#v -> same as #h but with height instead of width
#stack -> with display: flex
#table -> <table>
#terms -> <dl>
Visualize
Easily possible using SVG's
#circle -> <circle>
#ellipse -> <ellipse>
#image -> <image>
#line -> <line>
#path -> <path>
#polygon -> <polygon>
#rect -> <rect>
#square -> <rect>
Meta
#bibliography -> Likely with <a href="#el-id"> but has to be looked into
#cite -> same as #bibliography
#counter -> #text
#document -> should be used to insert meta information into the HTML Document.
#figure -> <figure>
#heading -> <h1> /<h2> / ...
#link -> <a>
#locate -> Doesn't make much sense in the context of web media / possibly with JS
#numering -> #text
#outline -> #text
#query -> can be ignored
#ref -> <a>
#state might be ignored
#style -> possibly can be ignored
This is all very much my draft notes currently but will be worked upon in the comming days, so take everything with a grain of salt.
tl;dr This is looking really promising already in terms of translatability, the main callenge here will likely be the rewrite of the Layout process into separate steps as discussed.
Comparison Typst => HTML
How easy we could convert most functions into a
HTML/CSScounterpart.Text
#lorem()->#text#emph-><em>#linebreak-><br>#lower-><span class="lower">or similar withtext-transform: lowercase#overline-><span class="overline">withtext-decoration: overline#raw-><code>with syntax highlighting done over a<div>instead (possibly highlight.js)#smallcaps-><span class="smallcaps">#smartquote->#text#strike-><s>#strong-><strong>#sub-><sub>#super-><sup>#text-><span>#underline-><span class="underline">withtext-decoration: underline#upper-><span class="upper">or similar withtext-transform: uppercaseMath
Good sauce: https://fred-wang.github.io/TeXZilla/
accent-><mover>attach-><munderover>/<msubsup>scripts-><msubsup>limits-><munderover>binom-><mrow><mo>(</mo><mfrac linethickness="0px"><mi>n</mi><mi>k</mi></mfrac><mo>)</mo></mrow>cases-><mrow><mo>{</mo><mtable columnalign="left left" displaystyle="false"></mtable></mrow>equation-><math>frac-><mfrac>lr-><mrow>with<mo>mat-><mtable>root-><mroot>and<msqrt>round-> Same aslrstyles-> with cssop-><mo>or<mi>under/over-><munderover>variants->#textvec-><mtable>Layout
#align-><span class="center">withtext-align: center#block-><div>#box-><div class="box">withdisplay: inline-block#list-><ul>#colbreak-> maybe possible with cssbreak-before: ...#columns-> possible withcolumn-count: 2#grid-><div class="grid">withdisplay: gridand so on#hide-> either withopacity: 0or using a<div>with a fixed width#measure-> maybe possible with js?#move-> withposition: relative; top: y, left: x#enum-><ol>tbh, the name could maybe be improved#pad-> withpadding: 10pt 2pt ...#page-> Doesn't make sense in context of web media#pagebreak-> Same as#page#par-><p>#parbreak-> beginning of new<p>#place-> withposition: absolute; top: ...#repeat-> Could maybe be possible withwidth: 100%; overflow: hiddenbut very hacky#rotate-> withtransform: rotate(...)#scale-> withtransform: scale(...)#h-> possibly withposition: inline-block; width: ...#v-> same as#hbut with height instead of width#stack-> withdisplay: flex#table-><table>#terms-><dl>Visualize
Easily possible using SVG's
#circle-><circle>#ellipse-><ellipse>#image-><image>#line-><line>#path-><path>#polygon-><polygon>#rect-><rect>#square-><rect>Meta
#bibliography-> Likely with<a href="#el-id">but has to be looked into#cite-> same as#bibliography#counter->#text#document-> should be used to insert meta information into the HTML Document.#figure-><figure>#heading-><h1>/<h2>/ ...#link-><a>#locate-> Doesn't make much sense in the context of web media / possibly with JS#numering->#text#outline->#text#query-> can be ignored#ref-><a>#statemight be ignored#style-> possibly can be ignored