add talk_org_revealjs tamplate

This commit is contained in:
wuyoli 2023-01-23 23:43:09 +01:00
parent c16a39a213
commit c35df27521
6 changed files with 132 additions and 0 deletions

View File

@ -21,3 +21,8 @@ $ git add .
You will have to replace all occurances of `TEMPLATE_NAME` with your `<project_name>`.
## Provided Templates
### `talk_org_revealjs`
A template for a talk built with org-mode, Pandoc and reveal.js
It will generate a preveal-js html file in `result/index.html` from `slides.org`
and a `result/handout.pdf` from `handout.org` (if it exists).

View File

@ -8,6 +8,10 @@
outputs = { official-templates, ... }: rec {
templates = {
talk_org_revealjs = {
path = ./talk_org_revealjs;
description = "A template for a talk built with org-mode, Pandoc and reveal.js";
};
} // official-templates.templates;
defaultTemplate = templates.trivial;

View File

@ -0,0 +1,44 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1673606088,
"narHash": "sha256-wdYD41UwNwPhTdMaG0AIe7fE1bAdyHe6bB4HLUqUvck=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "37b97ae3dd714de9a17923d004a2c5b5543dfa6d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"revealjs": {
"flake": false,
"locked": {
"lastModified": 1673876630,
"narHash": "sha256-xeEgKj2HtggtY0tAaSSsqqX2NCIXAKzzI1Ysx2283jY=",
"ref": "refs/heads/master",
"rev": "282680e1635b13734a7fc39693fc054aac564414",
"revCount": 2939,
"type": "git",
"url": "https://github.com/hakimel/reveal.js?tag=4.4.0"
},
"original": {
"type": "git",
"url": "https://github.com/hakimel/reveal.js?tag=4.4.0"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"revealjs": "revealjs"
}
}
},
"root": "root",
"version": 7
}

View File

@ -0,0 +1,61 @@
{
description = "A template for a talk built with org-mode, Pandoc and reveal.js";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
revealjs = {
url = "git+https://github.com/hakimel/reveal.js?tag=4.4.0";
flake = false;
};
};
outputs = { self, nixpkgs, revealjs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
buildInputs = with pkgs; [
pandoc-katex
haskellPackages.pandoc-crossref
texlive.combined.scheme-small
];
in {
packages.${system}.report = (
pkgs.stdenv.mkDerivation {
name = "talkSlides";
src = ./.;
inherit buildInputs;
phases = ["unpackPhase" "buildPhase"];
buildPhase = ''
mkdir -p $out
pandoc --embed-resources \
--standalone \
--filter pandoc-katex \
--css ${pkgs.nodePackages_latest.katex}/lib/node_modules/katex/dist/katex.min.css \
--incremental \
-t revealjs \
-V revealjs-url=${revealjs} \
slides.org -o $out/index.html
if [ -f handout.org ]; then
cat << EOF > header.tex
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{TEMPLATE_NAME}
\fancyhead[C]{}
\fancyhead[R]{YOUR_NAME}
EOF
pandoc --include-in-header=header.tex \
--pdf-engine=xelatex \
handout.org -o $out/handout.pdf
fi
'';
}
);
defaultPackage.${system} = self.packages.x86_64-linux.report;
};
}

View File

@ -0,0 +1,9 @@
#+TITLE: TEMPLATE_NAME
#+AUTHOR: YOUR_NAME
* First Heading
look, you can even use LaTeX Math:
$$
\beta r\cup\mathbb{H}
$$

View File

@ -0,0 +1,9 @@
#+TITLE: TEMPLATE_NAME
#+AUTHOR: YOUR_NAME
* First Heading
look, you can even use LaTeX Math:
$$
\beta r\cup\mathbb{H}
$$