pandoc-ext / pagebreak Goto Github PK
View Code? Open in Web Editor NEWManual page breaks
License: MIT License
Manual page breaks
License: MIT License
I was trying the filter and didn't work using commonmark_x
, until I use -f markdown
.
I did use input.md from test samples:
$ pandoc --lua-filter pagebreak.lua input.md -f markdown -t ms > expected.ms
$ pandoc --lua-filter pagebreak.lua input.md -f commonmark_x -t ms > not_expected.ms
$ diff --unified --suppress-common-lines expected.ms not_expected.ms
--- expected.ms 2024-02-21 00:05:06.881878556 -0300
+++ not_expected.ms 2024-02-20 23:40:30.712961487 -0300
@@ -2,7 +2,8 @@
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Donec hendrerit tempor tellus.
Donec pretium posuere tellus.
-.bp
+.PP
+\[rs]newpage
.PP
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus.
As you can see they're not the same, for -t ms
pagebreak should be in both cases .bp
.
Same mismatch happens using:
And not just -t ms
output, also:
I din't use "expected" files to compare, because clearly they have errors and need to upload again, problems like:
input.md > 1 page break (corrupted maybe?)
expected.adoc > 0 page break
expected.html > 2 page break
expected.context > no exist to compare
$ pacman -Qs pandoc | head -1
local/pandoc-bin 3.1.11-1
$ neofetch --off distro kernel
distro: Arch Linux x86_64
kernel: 6.1.52-1-lts
Can this filter be extended so it can include pagebreaks when converting from supported output formats to Markdown?
I work on a project where I prefer to work in plain text, but others use MS Word for most of their work. We really need as much of the formating to be intact when converting, and especially pagebreaks would be helpful to keep when I convert between the different formats.
I think it would be reasonable to have an option that allows a paragraph consisting only of \newpage. This wouldn't depend on supporting the raw_tex extension, and is actually a variant of the pagebreak.break-on.form-feed option.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.