otherjoel / punct Goto Github PK
View Code? Open in Web Editor NEW⏺✍️ Write in Lisp + Markdown, publish to multiple formats
License: Other
⏺✍️ Write in Lisp + Markdown, publish to multiple formats
License: Other
When writing Punct, there was a question of what guarantees I should make about the body
element of document
. I started by making it a very straight translation of the commonmark package’s document structure1 into a list. Hence, Punct’s documentation specifies document-body
as simply list?
.
After some feedback, I’m revisiting this question. It would be more ergonomic to make this value (listof xexpr?)
. This way, people could make use of the familiar xml
and txexpr
packages to manipulate the document’s elements. Further, I could uniformly require that custom elements also be xexpr?
, and the same requirements and guarantees would hold at all phases of parsing the document. I don’t think there would be any downside.
That package uses structs for every element, and so does things like using actual integers for heading levels because it has no reason to do otherwise. '(heading [[level 2]] "Abstract")
is not a valid x-expression, however (attributes must be strings), so it cannot be manipulated by the functions from xml
or txexpr
. ↩
The match
patterns in render/base.rkt
(and elsewhere) match reliably against elements created by the Commonmark parser because the set and order of attributes is consistent. But an author may generate txexprs of their own and these will amost never match.
#lang punct
`doc->html` will convert this to an `img` tag: ![Image 1](image1.jpg)
But not this: •'(image [[src "image3.jpg"]])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.