Commit graph

239 commits

Author SHA1 Message Date
John MacFarlane
6174b5bea5 Add lua filter functions to walk inline and block elements.
Refactored some code from Text.Pandoc.Lua.PandocModule
into new internal module Text.Pandoc.Lua.Filter.

Add `walk_inline` and `walk_block` in pandoc lua module.
2017-11-11 14:41:11 -08:00
Kolen Cheung
8ebf5c5f45 partially undo commit da1e626 2017-10-26 22:27:14 -07:00
Kolen Cheung
da1e626500 doc/using-the-pandoc-api.md: proofread (minor) 2017-10-26 18:16:12 -07:00
Kolen Cheung
0e47094f82 doc/filters.md: add more links to pandoc filters in diff. lang. 2017-10-26 18:08:19 -07:00
John MacFarlane
9ff04a947e Small fix to API guide. 2017-10-26 11:39:02 -07:00
John MacFarlane
4cc215391c Finshed API guide. Closes #3289. 2017-10-26 11:35:34 -07:00
John MacFarlane
456148fe7e More API documentation. 2017-10-26 10:52:44 -07:00
John MacFarlane
57277efaf5 More work on using-the-pandoc-api.md. 2017-10-26 09:19:44 -07:00
John MacFarlane
e23d293915 More work on using-the-pandoc-api.md. 2017-10-25 17:05:37 -07:00
John MacFarlane
50275957ff Small improvements in using-the-pandoc-api.md. 2017-10-24 22:49:05 -07:00
John MacFarlane
07bf48d07b More progress on using-the-pandoc-api.md. 2017-10-24 22:25:59 -07:00
John MacFarlane
8c0c4f954d Some work on using-the-pandoc-api.md. 2017-10-24 16:08:05 -07:00
Albert Krewinkel
12f8efe012
pandoc.lua: throw better error when pipe command fails
A table containing the error code, command, and command output is thrown
instead of just a string error message.
2017-10-05 11:41:59 +02:00
Albert Krewinkel
0e54d51d89
lua-filters.md: fix link to module documentation 2017-10-04 13:20:41 +02:00
John MacFarlane
d4f48e772d Added abc.lua example to lua-filters documentation.
Also fixed docs for `pipe`.
2017-10-03 14:20:48 -07:00
John MacFarlane
3e77ea4792 Lua: added 'pipe', which encapsulates Text.Pandoc.Process.pipeProcess.
This is hard to do in lua, so it's helpful to provide this.
2017-10-01 15:23:20 -07:00
John MacFarlane
4c3b3bf65a Lua: move sha1 from pandoc.mediabag to pandoc. 2017-10-01 00:33:56 -07:00
John MacFarlane
8768f7e5b0 Lua: use sha1 instead of hashname.
Better to leave control over the extension to the user.
2017-09-30 23:15:43 -07:00
John MacFarlane
9451d83058 Lua: make fetch return mime type first and then content. 2017-09-30 23:00:14 -07:00
John MacFarlane
17583cd99d Lua: simply mediabag module.
Now 'fetch' simply fetches content and mime type.
A new 'hashname' function is provided to get a filename based
on the sha1 hash of the contents and the mime type.
2017-09-30 22:54:12 -07:00
John MacFarlane
73c47a44d8 Lua: make lua.mediabag.fetch return filename and mime type.
This is necessary because you may need to insert the filename
into an image or link element.
2017-09-30 21:58:35 -07:00
John MacFarlane
9b7d652ab7 Merge pull request #3945 from tarleb/lua-mediabag
Lua mediabag module
2017-09-30 10:50:02 -04:00
Albert Krewinkel
c363519302 Provide make target to update lua module docs (#3946)
The pandoc module documentation in doc/lua-filters.md was automatically
generated from `data/pandoc.lua`.  A make target is provided which uses
a lua filter to update the documentation.
2017-09-30 10:45:31 -04:00
Albert Krewinkel
53b6ffe9b8
doc/lua-filters.md: document mediabag submodule 2017-09-30 15:09:24 +02:00
John MacFarlane
9a47c7863b Lua filters: set global FORMAT instead of args.
This changes the type of runLuaFilter.
2017-09-26 20:20:09 -07:00
Albert Krewinkel
2d416e203e Document possible return values of lua filter functions
This is mostly copy'n'pasted from the pandocfilters documentation.
2017-09-24 12:04:15 -07:00
John MacFarlane
ce05814372 Adjusted headings in using-the-pandoc-api.md. 2017-09-16 23:17:33 -07:00
John MacFarlane
91ab987a52 Removed customizing-pandoc.md from doc/, added filters.md.
filters.md is essentially the scripting tutorial from the
webiste.
2017-09-16 23:00:20 -07:00
John MacFarlane
9add713654 Moved ldoc.ltp from doc to tools.
doc should be reserved for actual documents, I think.

@tarleb - will this cause a problem?
2017-09-16 22:47:49 -07:00
Albert Krewinkel
79b1a701b8
lua-filters.md: append docs for pandoc's lua module
The documentation was generated from `data/pandoc.lua` using the
following command:

    ldoc -l doc -d /tmp data/pandoc.lua;
    pandoc -t markdown --columns=65 \
           --atx-headers /tmp/index.html >> \
           doc/lua-filters.md
2017-08-31 16:57:14 +02:00
Albert Krewinkel
bc47cfd40e
Add ldoc template for lua module documentation
The template can be used instead of the default template by calling ldoc
with the `-l doc` option, where *doc* is the directory of the template.
2017-08-31 16:57:08 +02:00
Albert Krewinkel
9ada1defb5
Document fallback functions in lua filters 2017-08-30 15:09:54 +02:00
John MacFarlane
f2dfb3f23b Added introduction and lightly edited rest of lua-filters document.
See #3608.
2017-08-21 22:14:26 -07:00
Albert Krewinkel
4567105f6c
doc/lua-filter.md: Add metadata variable replacment example 2017-08-21 19:00:51 +02:00
Albert Krewinkel
29a6793811
lua-filters.md: update docs and mention implicit filters 2017-08-21 16:53:00 +02:00
John MacFarlane
64ff86514b Added example of setting date with lua filter. 2017-08-14 09:57:01 -07:00
John MacFarlane
c505de59c0 Added link-table example to doc/lua-filters.md. 2017-06-28 15:31:42 +02:00
Albert Krewinkel
1afdccfa8c
Document lua filters 2017-04-30 15:55:45 +02:00
John MacFarlane
5b70b57c11 Added skeletons for docs on customizing pandoc and using pandoc API.
See #3289 and  #3288.
2017-02-01 12:50:44 +01:00