trashhalo / astro-pandoc

astro component that lets you use pandoc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Astro Pandoc

Astro component for using pandoc to convert content. This allows you to embed any format pandoc supports.

Usage

---
import { Pandoc } from "astro-pandoc";
---
<Pandoc caller={import.meta.url} file="Component.tex" extraArgs={["--webtex"]} /

Component.tex

\documentclass{article}
\usepackage{amsmath} % for the equation* environment
\begin{document}

This is a simple math expression \(\sqrt{x^2+1}\) inside text. 
And this is also the same: 
\begin{math}
\sqrt{x^2+1}
\end{math}
but by using another command.

This is a simple math expression without numbering
\[\sqrt{x^2+1}\] 
separated from text.

This is also the same:
\begin{displaymath}
\sqrt{x^2+1}
\end{displaymath}

\ldots and this:
\begin{equation*}
\sqrt{x^2+1}
\end{equation*}

\end{document}

Screenshot of a the rendered demo page

Props

  • caller: url of the caller so we can use it to look up relative paths
  • file: input file relative to the caller
  • extraArgs: optional. array of extra arguments to pass to pandoc
  • template: optional. control the html generated by pandoc

About

astro component that lets you use pandoc

License:MIT License


Languages

Language:Astro 34.9%Language:JavaScript 21.1%Language:HTML 19.0%Language:TeX 18.8%Language:Python 4.3%Language:Dockerfile 1.9%