Comments (4)
Yes, I'm definitely open to it! I haven't really worked with free monads, so I'll have to see what it looks like in the end before deciding whether to include it here. At first glance, it seems a good idea.
from commonmark-hs.
One question is how this will handle extensibility. The way we do extensions, each extension can define additional typeclasses. Can you handle extensions that introduce new types of block or inline elements?
from commonmark-hs.
In my intended use-case, extensibility doesn't seem to be a blocker and working on the untouched (or only supporting the basic extensions) would be enough.
I think one way to have extensibility with records that you get with typeclasses is to make a 'hole' in the structure to allow extensibility upfront (e.g., data Block ext = ThematicBreak | CodeBlock Text Text | ... | Ext ext
). Then someone can implement HasThing (Block Thing)
with thing = Ext (Thing = Thing1 Text | Thing2 Int Text)
.
A bit handwavy at this point. I'll try something for my usecase over the coming weeks and let you know here.
from commonmark-hs.
In my intended use-case, extensibility doesn't seem to be a blocker
It would be a blocker, though, for inclusion in this library.
Note: for your purposes, it might also work to just use the commonmark-pandoc classes which give you a pandoc AST. (You don't need to depend on pandoc for this, just the relatively lightweight pandoc-types.) This seems very similar to what you're looking for, though less tightly linked to commonmark's own categorizations.
from commonmark-hs.
Related Issues (20)
- [fuzz result] nested empty list with two trailing blank lines causes the outer list to be parsed as loose
- [fuzz result] footnote definition labels with blank lines are allowed HOT 1
- [fuzz result] unindented lines after footnote def are silently eaten HOT 6
- `commonmark-pandoc`: calculate relative cell widths for pipe tables HOT 11
- Tests fail with "Stack space overflow" on big endian systems HOT 1
- [fuzz result] Link def title trailing backslash
- Support for GitHub markdown alerts {Note, Important, Tip...} HOT 14
- [fuzzing result] deeply nested list with blank lines causes outer list to not parse as loose
- [fuzz result] code span vanishes when link destination is ` HOT 5
- [fuzz result] [commonmark-pandoc] footnotes in footnotes HOT 3
- [fuzz result] inline processing instructions can't parse more than once in a block? HOT 2
- [fuzz result] HTML declaration blocks do not follow spec 0.30
- [fuzz result] counterintuitive list tightness
- Quadratic output size explosion with tables extension HOT 5
- gfm parsing oddity with links and raw HTML HOT 6
- GFM + Rebase relative paths incorrectly rebases URLs with Unicode characters HOT 1
- [fuzz result] backslashing `&` entities doesn't escape them in link destinations HOT 1
- autolink_bare_uris doesn't work correctly in 3.1.12.x for URLs with dot, comma, parenthesis etc. HOT 1
- Challenges Outputting Context-Dependent Things To Text HOT 2
- gfm parsing oddity with links in link text HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commonmark-hs.