diff --git a/README.md b/README.md index daab11f..9a00282 100644 --- a/README.md +++ b/README.md @@ -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 + <%= for {id, data} <- @posts do %>
@@ -142,13 +161,8 @@ defmodule Stasis.Document do
<% end %>
```
-```elixir
-# lib/hello_web/controllers/post_html/show.html.heex
+```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