Skip to content

Instantly share code, notes, and snippets.

@ar90n
Last active July 15, 2023 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ar90n/49264e884a777e3cb4d55c604a0abadc to your computer and use it in GitHub Desktop.
Save ar90n/49264e884a777e3cb4d55c604a0abadc to your computer and use it in GitHub Desktop.
add new languages support to pandoc

pandocにSyntaxHighlightする言語を追加する

skyhighlightに定義ファイルを追加してビルド

ENV SKYLIGHTING_VERSION 0.13.4
RUN curl -L https://github.com/jgm/skylighting/archive/refs/tags/${SKYLIGHTING_VERSION}.tar.gz | tar xvz
RUN <<EOF

cd skylighting-${SKYLIGHTING_VERSION}/skylighting-core/xml/
curl -L -O https://raw.githubusercontent.com/ziglang/kde-syntax-highlighting/master/zig.xml
cd ../../
cabal update
make
cd ..

EOF

ローカルビルドしたskyhighlightを参照しながらpandocをビルド

ENV PANDOC_VERSION 3.1.5
RUN curl -L https://github.com/jgm/pandoc/archive/refs/tags/${PANDOC_VERSION}.tar.gz | tar xvz
RUN <<EOF

cd pandoc-${PANDOC_VERSION}/
patch -u  --ignore-whitespace cabal.project << '_PATCH_'
--- cabal.project.orig  2023-07-15 14:43:44.158970852 +0000
+++ cabal.project       2023-07-14 12:43:10.057228179 +0000
@@ -2,6 +2,7 @@
           pandoc-lua-engine
           pandoc-server
           pandoc-cli
+          ../skylighting-0.13.4/skylighting
 tests: True
 flags: +embed_data_files
 constraints: skylighting-format-blaze-html >= 0.1.1,
_PATCH_
cabal update
make
cp $(make binpath) /opt/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment