5 Commits

Author SHA1 Message Date
3a73fbe312
kick out the jams
Make the module act more like a module. The test code is now an
example. Get rid of redundant "Cmark" prefix in many types. Implement
most of the missing node routines.
2023-09-09 23:45:22 -07:00
ce0c1ae97c
it's alive
Okay, this works. The allocation situation is still kind of a mess, but
I think I have enough escape hatches for usability's sake. Parsing
from a file is left as an exercise for the user (it's not hard). The
node manipulation routines will probably added on demand. Or maybe I
will get a wild hair and just do it at some point.
2023-09-07 23:08:18 -07:00
933f354077
more wrapping
In theory, all of the APIs are now wrapped to get a rendered document
from a markdown source. And a variety of APIs for manipulating the
parse tree also exist. I should probably test this at some point.
2023-09-06 22:16:59 -07:00
2d099d931e
start doodling some wrapper ideas
The main points of interest here is the allocator wrapper, which was
kind of annoying to implement. Since the Zig allocator interface
expects to know the size of all allocations, we have to secretly
allocate space for that in front of the pointer that we return. This
ends up causing a little bit of slightly nasty pointer manipulation. I
took longer to debug this than I would like to admit from a bug that
ended up being caused by storing a pointer to a stack copy of an
Allocator object. Whoops.

The other interesting thing I think (though much simpler) is
representing the options bitfield as a packed struct. I think this
makes initializing the parser options a lot nicer than the c variant.
2023-09-04 15:42:47 -07:00
17a4224cb8
init 2023-09-04 15:42:46 -07:00