Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building self-contained presentations and for passing extra variables to pandoc #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kalbasit
Copy link

@kalbasit kalbasit commented Dec 25, 2018

When selfContained is false (default), the reveal.js files are now absolute and the reveal.js symlink is removed. This allows the HTML files to reside in any sub-folder without having to maintain relative dependencies.

When selfContained is true, the resulting HTML file will have all assets inlined, that includes all reveal.js files as well as any embedded images in the markdown presentation.

Extra variables can be passed in the extraPandocVariables set. For example, to use a different theme, pass extraPandocVariables = { theme = "sky"; };. Note that when using a reveal.js theme that is not the default theme and has selfContained enabled, Pandoc requires network access and this will not work with the sandbox enabled. You must disable the sandbox with nix-build --option build-use-sandbox false.

The reveal.js files are now absolute and the reveal.js symlink is
removed. This allows the HTML files to reside in any sub-folder without
having to maintain relative dependencies.
The resulting HTML file will have all assets inlined, that includes all
reveal.js files as well as any embedded images in the markdown
presentation.
@kalbasit kalbasit force-pushed the nix-reveal_self-contained branch from 8e017f4 to 55be9ea Compare December 25, 2018 02:09
@kalbasit kalbasit changed the title Add support for building self-contained presentations within sub-folders. Add support for building self-contained presentations and for passing extra variables to pandoc Dec 25, 2018
@kalbasit kalbasit force-pushed the nix-reveal_self-contained branch from dc9ba9e to ac56cbf Compare December 25, 2018 02:41
When using a reveal.js theme that is not the default theme and has
`selfContained` enabled, Pandoc requires network access and this will
not work with the sandbox enabled. You must disable the sandbox with
`nix-build --option build-use-sandbox false`.
@kalbasit kalbasit force-pushed the nix-reveal_self-contained branch from ac56cbf to 94c62f2 Compare December 25, 2018 02:43
@kalbasit
Copy link
Author

kalbasit commented Dec 25, 2018

Here's a shell.nix that I use to provide a wrapper around nix-build that disables the sandbox without having to type in manually every time. Should I put it in the README?

{ pkgs ? import <nixpkgs> {} }:

with pkgs;
with pkgs.lib;

let
  nixBuild = pkgs.writeScriptBin "nix-build" ''
    #! ${runtimeShell} -e

    ${getBin nix}/bin/nix-build --option build-use-sandbox false "$@"
  '';
in

stdenv.mkDerivation {
  name = "presentations-dev";

  buildInputs = [ nixBuild ];

  phases = ["nobuildPhase"];

  nobuildPhase = ''
    echo
    echo "This derivation is not meant to be built, aborting";
    echo
    exit 1
  '';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant