asciinema.org/web/views/doc_view.ex
Marcin Kulik ace1d58167 Port docs
2017-06-02 15:40:24 +02:00

24 lines
574 B
Elixir

defmodule Asciinema.DocView do
use Asciinema.Web, :view
@titles %{
:"how-it-works" => "How it works",
:"getting-started" => "Getting started",
:installation => "Installation",
:usage => "Usage",
:config => "Configuration file",
:embedding => "Sharing & embedding",
:faq => "FAQ",
}
def title_for(topic) do
@titles[topic]
end
def topic_link(conn, current_topic, topic) do
class = if current_topic == topic, do: "active"
render "topic_link.html", conn: conn, topic: topic, text: title_for(topic), class: class
end
end