-
Notifications
You must be signed in to change notification settings - Fork 61
/
TODO
91 lines (66 loc) · 2.32 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
* TODO fix other writers to use new ropes
_ man
_ tex
_ context
_ latex
* TODO citations using independent citeproc program
- might need two passes for this, one to generate the list of
citations, which can then be passed to citeproc for processing
on the next pass. otherwise footnotes will be screwed up.
- there can be a special writer for the first pass, which skips
everything but citations and just stores them in a list.
* TODO math in $, $$
* TODO fenced code block extension
* TODO alternative indented code block with metadata?
This is text.
code {
in indented = block
}
--- haskell
code {
in indented = block
}
[haskell]
More text.
* TODO layout: indentation options?
* TODO latex reader - write peg
* TODO mathml - look at pandoc2?
* TODO make epub tool
* TODO make pdf tool
* TODO documentation, including extending writer + parser
Notes on a possible macro system: Simply add a function
to the writer:
W.name = function(last,first)
return first .. writer(space) .. writer.strong(last)
end
W.repeat = function(num,x)
return string.rep(x, tonumber(num))
end
When lunamark encounters %name{<inlines>}{<inlines>}
or %repeat[7]{Hi there%space}, it simply calls the writer.name function.
Note that writer.space is currently not a function; maybe that should
change for uniformity. We may want macros with no arguments that
need to be functions: e.g. %currenttime.
Probably we'd need several types of arguments:
* parsed inline lists
* parsed block lists
* raw text
Also we'd have to know whether to parse as a block or an inline.
So perhaps we'd need two different kinds of macros.
* inline macros:
%name{<inlines>} -- with inline argument
%name[raw text] -- with raw argument
* block macros
.admonition{<inlines>}{| -- multiline block
<blocks>
|}
.startsource[|
multiline raw text - first newline ignored
|]
These macros are all on the writer side. What about the reader side?
E.g. what if we want a macro
#include[myfile.txt]
that reads myfile.txt and parses the source as markdown?
This can't happen in the writer. But there could be a way to
register a reader macro. This would simply call a match-time
parser function that directly modifies the input string.