index : pandoc | |
Hex package with a file-watcher and Mix task for using Pandoc to convert Markdown files to HTML. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-12-19 17:19:22 -0800 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-12-19 17:49:39 -0800 |
commit | 3d1ea3183c4de1690533cc01d1fa843bcea2e57e (patch) | |
tree | b8617bcac33dda0597924253b27afbca76cf05d2 /README.md | |
parent | ccb050102a3d5584fd7f7ad504583e8f43f5458d (diff) |
Bump versionv0.2.0
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 32 |
1 files changed, 23 insertions, 9 deletions
@@ -14,10 +14,17 @@ A watcher and a Mix task that uses Pandoc to convert markdown files to html. def deps do [ - {:pandoc, "~> 0.1.0", runtime: Mix.env() == :dev} + {:pandoc, "~> 0.2.0", runtime: Mix.env() == :dev} ] end +``` + +## Use +```elixir +# mix.exs + +# ... defp aliases do [ # ... @@ -131,7 +138,19 @@ defmodule Stasis.Document do ``` ```elixir -# lib/hello_web/controllers/post_html/index.html.heex +# lib/hello_web/controllers/post_html.ex + +# ... + +defp href(filename, draft \\ false) do + root = (draft && "/drafts") || "/posts" + Path.join(root, filename |> Path.basename(".md")) +end + +``` + +```heex +<!-- lib/hello_web/controllers/post_html/index.html.heex --> <%= for {id, data} <- @posts do %> <p> @@ -142,13 +161,8 @@ defmodule Stasis.Document do <% end %> ``` -```elixir -# lib/hello_web/controllers/post_html/show.html.heex +```heex +<!-- lib/hello_web/controllers/post_html/show.html.heex --> <%= raw(@post) %> ``` - -Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) -and published on [HexDocs](https://hexdocs.pm). Once published, the docs can -be found at <https://hexdocs.pm/pandoc>. - |