Commits at af93e68c63ab4e9943ca41834fff1d481de890a7
94b55a12Use hastscript instead of nano_jsx
The first reason for this change is tedious conversion from Markdown to components.
Since Hast does not have a concept of "Component", those needs to be converted to
custom elements first, then restored by carefully mapping the custom element nodes.
During that process, properties are transformed to HTML attributes (e.g. true -> "").
This is very error-prone and exhausting thing to write.
The second one is the quality of nano-jsx. The library is, honestly, toy-level.
Even though they promote it as "SSR First", HTML seriealization is joke: empty children
appears as `children=""`, cannot handle falsy attribute values, renders `true` attribute
value as `"true"`, etc...
Also, it's TypeScript typing is almost non-existent. Most of the exposed things are
typed as `any`. I would not call that a typed library.
While hastscript is not perfect either, it's good enough for my HTML generation usecase.
It also eliminates Mdast -> Hast -> (JSX runtime) confusing data conversion.
I choose not to write wrapper for `<Component/>` usage. It's nice, but not necessary.
In fact, normal function call is **far better** than JSX's loose and cryptic typings.
The only output changes I observed was "Module" and "Program" in "Architecture.canvas"
now overflows (thus broken in Safari). However, it's due to the new more strict CSS.
I believe it's improvement, not regression (needs to be fixed the overall JSONCanvas
stylings at some point, though).
Shota FUJI
authored at
Shota FUJI
comitted at
e635bd88Style GFM task list extension's output
The default output, which mimics GitHub's markup and styles, is horrible.
It sets `disabled` attribute that makes the element screen reader unfriendly.
Also it does not associate the text to checkbox, which is also screen reader unfriendly.
I may revisit styles in the future as the current one is not that pretty...
Shota FUJI
authored at
Shota FUJI
comitted at
49403feeFix content style having higher priority than component styles
I noticed this by seeing non-foldable callout's title being weirdly wrapped.
Shota FUJI
authored at
Shota FUJI
comitted at
9ee3d742Limit content styles only to body elements
Global styles have been a pain point.
Shota FUJI
authored at
Shota FUJI
comitted at
110d8d4eMove Hast related function inside page builder to one place
I have been felt those logics are disconnected.
Shota FUJI
authored at
Shota FUJI
comitted at
9626d6f3Fix Canvas having no color other than red and gray
Simple typo.
Shota FUJI
authored at
Shota FUJI
comitted at
d14df0a6Proper styles for callout
This work is foundation for later styling works.
Shota FUJI
authored at
Shota FUJI
comitted at
5aad74eaFix callout icon is not visible
hast-util-raw seems to lowercases every tagnames.
Shota FUJI
authored at
Shota FUJI
comitted at
432427c4Fix default opened callout is collapsed
hast-util-raw seems to have a bug on attribute handling: it mistake
an empty string as an absence of value.
Shota FUJI
authored at
Shota FUJI
comitted at
eac79b36Do not perform actual file write more than once on same file
Shota FUJI
authored at
Shota FUJI
comitted at
a9bf5e66File embed for JSONCanvas
Refactor for HTML rendering is to reduce unnecessary Mdast->Hast conversion.
Shota FUJI
authored at
Shota FUJI
comitted at
a1bcc49aAggregate mdast fromMarkdown extensions into one
Same as micromark's one.
Shota FUJI
authored at
Shota FUJI
comitted at
cbb403ecMake OFM image size parser to Mdast extension
I noticed an extension can be just a transform function when implementing OFM callout extension.
This is good.
Shota FUJI
authored at
Shota FUJI
comitted at
195452c5Aggregate micromark extensions into one
For usability. It's good abstraction IMO.
Inclusion of gfm is actually valid, as OFM includes subset of GFM.
Shota FUJI
authored at
Shota FUJI
comitted at
627b53c5Add comments on Safari's SVG rendering bug
I tried to apply workaround. It surely fixed position problem; however, it completely
ruined the rendering of non-overflowing elements. Safari is the new IE, yes.
If I could solve scroll (layout) problem on the canvas rendering, I'll switch to
SVG + HTML approach. It's ridiculous to abandon the most correct and semantic document
due to one problematic broken browser, but this is what we got. Cult made of normies and
fanboys encouraging unhealthy and uncompetetive web. At least Chrome does not have
this lot of rendering/compositing bugs.
Shota FUJI
authored at
Shota FUJI
comitted at
78f20ea9Implement complete JSONCanvas renderer
Even though files are 404 and Safari goes wild, basic rendering feature is done.
Shota FUJI
authored at
Shota FUJI
comitted at