markxd-cli
v1.0.1
Published
- Generate APA-styled paginated PDFs using Markdown and LaTeX.
Downloads
1
Readme
markxd
- Generate APA-styled paginated PDFs using Markdown and LaTeX.
Description:
markxd is built on top of marked, KaTeX, and paged.js. The markdown is first compiled to HTML using marked, the math is parsed using KaTeX, and the HTML is rendered using paged.js
Variants:
- A CDN that allows you to write markdown, render a document, and save it as a PDF in the browser (In development)
- A CLI that allows you to convert a markdown file to a PDF in node.js
Browser:
- To start, create a
.html
file
<!DOCTYPE html>
- Add a script tag containing a copy of markxd
- Make sure to set the
type
tomodule
as markxd is an ESM package by default
<!DOCTYPE html>
<script
type="module"
src="https://cdn.jsdelivr.net/gh/nacho-cs/markxd@main/markxd.min.js"></script>
- After that simply create a
textarea
element containing the content you want to be rendered
<!DOCTYPE html>
<script
type="module"
src="https://cdn.jsdelivr.net/gh/nacho-cs/markxd@main/markxd.min.js"></script>
<textarea>
## Heading
Display math:
$$ 5^2 = 25 $$
Inline math: $ y=mx+b $
</textarea>
Node.js:
- Create a markdown (
.md
) file - Put the content you want to be rendered in the markdown file
- After, run this command:
> npx markxd ./path/to/input.md -o ./path/to/output.pdf
./path/to/output.pdf
is optional and by default, markxd will default to./markxd.pdf