From 31918c6a3559b4fbdbedd3837dc6fb67cba91a89 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 14 Apr 2023 13:29:56 +0200 Subject: [PATCH] Improve the docs slightly --- README.md | 2 +- pagebreak.lua | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0954d1c..bf1e7ec 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ line option. ### Quarto / R Markdown The use of this filter with either Quarto or R Markdown is -discouraged, as both systems ship with their own fork of this +*discouraged*, as both systems ship with their own fork of this extension. Use those instead. Note also that Quarto allows to use the [`{{ pagebreak }}` diff --git a/pagebreak.lua b/pagebreak.lua index 55abe53..63058a0 100644 --- a/pagebreak.lua +++ b/pagebreak.lua @@ -72,13 +72,16 @@ local function newpage(format, pagebreak) end end +--- Checkes whether a the given string contains a LaTeX pagebreak or +--- newpage command. local function is_newpage_command(command) return command:match '^\\newpage%{?%}?$' or command:match '^\\pagebreak%{?%}?$' end -- Returns a filter function for RawBlock elements, checking for LaTeX --- pagebreak/newpage commands; returns `nil` when the target format is latex. +-- pagebreak/newpage commands; returns `nil` when the target format is +-- latex. local function latex_pagebreak (pagebreak) -- Don't do anything if the output is TeX if FORMAT:match 'tex$' then @@ -107,6 +110,7 @@ local function ascii_pagebreak (raw_pagebreak) end end +--- Filter function; this is the entrypoint when used as a filter. function Pandoc (doc) local config = doc.meta.pagebreak or {} local break_on = config['break-on'] or {}