diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-14 20:38:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-14 20:38:52 +0000 |
commit | a3ba1abf10468e4cc434f285fabe14ab5fe86158 (patch) | |
tree | 155acdc9224098902aebfbc79b77a1b3be2f0294 /Master/texmf-dist/tex/luatex | |
parent | c8d2ea73c06009f96ad1c3a66b69d20d57209dc7 (diff) |
markdown (14sep20)
git-svn-id: svn://tug.org/texlive/trunk@56342 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r-- | Master/texmf-dist/tex/luatex/markdown/markdown.lua | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/luatex/markdown/markdown.lua b/Master/texmf-dist/tex/luatex/markdown/markdown.lua index 36d2b611a78..e6127c8bf6d 100644 --- a/Master/texmf-dist/tex/luatex/markdown/markdown.lua +++ b/Master/texmf-dist/tex/luatex/markdown/markdown.lua @@ -58,7 +58,7 @@ -- those in the standard .ins files. -- local metadata = { - version = "2.8.2", + version = "2.9.0", comment = "A module for the conversion from markdown to plain TeX", author = "John MacFarlane, Hans Hagen, Vít Novotný", copyright = {"2009-2016 John MacFarlane, Hans Hagen", @@ -74,6 +74,7 @@ local md5 = require("md5") local M = {metadata = metadata} local defaultOptions = {} defaultOptions.cacheDir = "." +defaultOptions.frozenCacheFileName = "frozenCache.tex" defaultOptions.blankBeforeBlockquote = false defaultOptions.blankBeforeCodeFence = false defaultOptions.blankBeforeHeading = false @@ -85,7 +86,9 @@ defaultOptions.contentBlocks = false defaultOptions.contentBlocksLanguageMap = "markdown-languages.json" defaultOptions.definitionLists = false defaultOptions.fencedCode = false +defaultOptions.finalizeCache = false defaultOptions.footnotes = false +defaultOptions.frozenCacheCounter = 0 defaultOptions.hashEnumerators = false defaultOptions.headerAttributes = false defaultOptions.html = false @@ -4033,7 +4036,21 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline local name = util.cache(options.cacheDir, input, salt, function(input) return util.rope_to_string(parse_blocks_toplevel(input)) .. writer.eof end, ".md" .. writer.suffix) - return writer.pack(name) + local output = writer.pack(name) + if options.finalizeCache then + local file, mode + if options.frozenCacheCounter > 0 then + mode = "a" + else + mode = "w" + end + file = assert(io.open(options.frozenCacheFileName, mode)) + assert(file:write([[\expandafter\def\csname markdownFrozenCache]] .. + options.frozenCacheCounter .. [[\endcsname{]] .. output .. [[}]] .. + "\n")) + assert(file:close()) + end + return output end return self end |