diff options
author | Loïc Hoguin <[email protected]> | 2018-06-12 18:31:23 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-06-12 18:35:54 +0200 |
commit | 9458416ef386d4a3c6ea42b27e7945db05bce08f (patch) | |
tree | 89b6b66881c663837fbd24895e43960367d4730e /src | |
parent | 3e29ee974ebbb8774ddf9ebba4582ff465e1a087 (diff) | |
download | asciideck-9458416ef386d4a3c6ea42b27e7945db05bce08f.tar.gz asciideck-9458416ef386d4a3c6ea42b27e7945db05bce08f.tar.bz2 asciideck-9458416ef386d4a3c6ea42b27e7945db05bce08f.zip |
Support --no-header-footer option in scripts/asciidoc
Diffstat (limited to 'src')
-rw-r--r-- | src/asciideck_to_html.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/asciideck_to_html.erl b/src/asciideck_to_html.erl index 70c90c0..035ff96 100644 --- a/src/asciideck_to_html.erl +++ b/src/asciideck_to_html.erl @@ -18,7 +18,7 @@ translate(AST, Opts) -> Output0 = ast(AST), - Output1 = header_footer(Output0, Opts), + Output1 = maybe_header_footer(Output0, Opts), {CompressExt, Output} = case Opts of #{compress := gzip} -> {".gz", zlib:gzip(Output1)}; _ -> {"", Output1} @@ -35,7 +35,9 @@ translate(AST, Opts) -> Output end. -header_footer(Body, _Opts) -> +maybe_header_footer(Body, #{no_header_footer := _}) -> + Body; +maybe_header_footer(Body, _Opts) -> [ "<!DOCTYPE html>\n" "<html lang=\"en\">\n" |