git.iko.soy/typeable/pandoc
on master help sign in
Fix README.md so that relative links from manual become absolute.
a0df2f6John MacFarlane
README.md+11−7
@@ -39,8 +39,9 @@ library. It can convert *from*
39 - `gfm` ([GitHub-Flavored
39 - `gfm` ([GitHub-Flavored
40 Markdown](https://help.github.com/articles/github-flavored-markdown/)),
40 Markdown](https://help.github.com/articles/github-flavored-markdown/)),
41 or the deprecated and less accurate `markdown_github`; use
41 or the deprecated and less accurate `markdown_github`; use
42− [`markdown_github`](#markdown-variants) only if you need extensions
42+ [`markdown_github`](https://pandoc.org/MANUAL.html#markdown-variants)
43+ only if you need extensions not supported in
43− not supported in [`gfm`](#markdown-variants).
44+ [`gfm`](https://pandoc.org/MANUAL.html#markdown-variants).
44 - `haddock` ([Haddock
45 - `haddock` ([Haddock
45 markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))
46 markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))
46 - `html` ([HTML](http://www.w3.org/html/))
47 - `html` ([HTML](http://www.w3.org/html/))
@@ -49,7 +50,8 @@ library. It can convert *from*
49 - `jats` ([JATS](https://jats.nlm.nih.gov) XML)
50 - `jats` ([JATS](https://jats.nlm.nih.gov) XML)
50 - `json` (JSON version of native AST)
51 - `json` (JSON version of native AST)
51 - `latex` ([LaTeX](http://latex-project.org))
52 - `latex` ([LaTeX](http://latex-project.org))
52− - `markdown` ([Pandoc’s Markdown](#pandocs-markdown))
53+ - `markdown` ([Pandoc’s
54+ Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown))
53 - `markdown_mmd`
55 - `markdown_mmd`
54 ([MultiMarkdown](http://fletcherpenney.net/multimarkdown/))
56 ([MultiMarkdown](http://fletcherpenney.net/multimarkdown/))
55 - `markdown_phpextra` ([PHP Markdown
57 - `markdown_phpextra` ([PHP Markdown
@@ -98,8 +100,9 @@ It can convert *to*
98 - `gfm` ([GitHub-Flavored
100 - `gfm` ([GitHub-Flavored
99 Markdown](https://help.github.com/articles/github-flavored-markdown/)),
101 Markdown](https://help.github.com/articles/github-flavored-markdown/)),
100 or the deprecated and less accurate `markdown_github`; use
102 or the deprecated and less accurate `markdown_github`; use
101− [`markdown_github`](#markdown-variants) only if you need extensions
103+ [`markdown_github`](https://pandoc.org/MANUAL.html#markdown-variants)
104+ only if you need extensions not supported in
102− not supported in [`gfm`](#markdown-variants).
105+ [`gfm`](https://pandoc.org/MANUAL.html#markdown-variants).
103 - `haddock` ([Haddock
106 - `haddock` ([Haddock
104 markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))
107 markup](https://www.haskell.org/haddock/doc/html/ch03s08.html))
105 - `html` or `html5` ([HTML](http://www.w3.org/html/),
108 - `html` or `html5` ([HTML](http://www.w3.org/html/),
@@ -118,7 +121,8 @@ It can convert *to*
118 - `latex` ([LaTeX](http://latex-project.org))
121 - `latex` ([LaTeX](http://latex-project.org))
119 - `man` ([roff
122 - `man` ([roff
120 man](http://man7.org/linux/man-pages/man7/groff_man.7.html))
123 man](http://man7.org/linux/man-pages/man7/groff_man.7.html))
121− - `markdown` ([Pandoc’s Markdown](#pandocs-markdown))
124+ - `markdown` ([Pandoc’s
125+ Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown))
122 - `markdown_mmd`
126 - `markdown_mmd`
123 ([MultiMarkdown](http://fletcherpenney.net/multimarkdown/))
127 ([MultiMarkdown](http://fletcherpenney.net/multimarkdown/))
124 - `markdown_phpextra` ([PHP Markdown
128 - `markdown_phpextra` ([PHP Markdown
@@ -163,7 +167,7 @@ It can convert *to*
163 - `zimwiki` ([ZimWiki
167 - `zimwiki` ([ZimWiki
164 markup](http://zim-wiki.org/manual/Help/Wiki_Syntax.html))
168 markup](http://zim-wiki.org/manual/Help/Wiki_Syntax.html))
165 - the path of a custom lua writer, see [Custom
169 - the path of a custom lua writer, see [Custom
166− writers](#custom-writers) below
170+ writers](https://pandoc.org/MANUAL.html#custom-writers) below
167
171
168</div>
172</div>
169
173
tools/update-readme.lua+15−9
@@ -8,15 +8,21 @@ f:close()
8result = {}
8result = {}
9
9
10function Div(elem)
10function Div(elem)
11− local ident = elem.identifier or ""
11+ local ident = elem.identifier or ""
12− local get = function(el)
12+ local fixrel = function(el)
13− if el.identifier == ident then
13+ if el.target:match("^#") then
14− result = el
14+ el.target = "https://pandoc.org/MANUAL.html" .. el.target
15− end
16− end
17− if ident == 'input-formats' or ident == 'output-formats' then
18− pandoc.walk_block(pandoc.Div(mdoc.blocks), { Div = get })
19− return result
20 end
15 end
16+ return el
17+ end
18+ local get = function(el)
19+ if el.identifier == ident then
20+ result = pandoc.walk_block(el, { Link = fixrel })
21+ end
22+ end
23+ if ident == 'input-formats' or ident == 'output-formats' then
24+ pandoc.walk_block(pandoc.Div(mdoc.blocks), { Div = get })
25+ return result
26+ end
21end
27end
22
28