From 8afe75a607f0c5a87799ca794441bc2384c69042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luan=20Guimar=C3=A3es?= Date: Fri, 1 Jun 2018 03:34:52 -0300 Subject: [PATCH] Add support to 'new' command --- Dockerfile | 2 +- config/config.exs | 18 ++++++++++-------- lib/command/executor.ex | 10 ++++------ lib/command/new.ex | 32 ++++++++++++++++++++++++++++++++ lib/command/pandoc.ex | 5 ++++- lib/pandocker.ex | 1 + 6 files changed, 52 insertions(+), 16 deletions(-) create mode 100644 lib/command/new.ex diff --git a/Dockerfile b/Dockerfile index c3dfa51..88e600e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN apt-get install -y gnupg2 && \ && curl -L http://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add - \ && apt-get update \ && mkdir -p /usr/share/man/man1/ \ - && apt-get install -y elixir erlang-inets erlang --no-install-recommends \ + && apt-get install -y git elixir erlang-inets erlang --no-install-recommends \ && apt-get clean -y ADD mix.exs /tmp/mix.exs diff --git a/config/config.exs b/config/config.exs index 99a2556..3777346 100644 --- a/config/config.exs +++ b/config/config.exs @@ -32,17 +32,19 @@ config :pandocker, envs: %{ } config :pandocker, defaults: %{ - command: "help", - config_yaml: "pandocker.yml", - project_root: "/code", - source_path: 'src', - output_file: 'out.pdf', - files: "/pandocker/examples/example.md" + command: "help", + config_yaml: "pandocker.yml", + project_root: "/code", + source_path: 'src', + output_file: 'out.pdf', + files: "/pandocker/examples/example.md", + templates_url: "https://github.com/luanguimaraesla/pandocker-templates", } config :pandocker, tokens: %{ - command: ~r/^\s*(?P(compile|help|new))/, - config_yaml: ~r/-f (?P\/?(\w+\/?)*\w+\.(yaml|yml))/, + command: ~r/^\s*(?P(compile|help|new))/, + template: ~r/(-t|--template)\s*(?