Skip to content

Commit

Permalink
Adds some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zamith committed Oct 22, 2014
1 parent 24272c7 commit 8304eb1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/deps
erl_crash.dump
*.ez
docs
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ defmodule YourApp do
end
```

### Documentation

You can find more documentation [here](http://hexdocs.pm/tomlex/0.0.3/).

# Roadmap

- [X] Comments
Expand Down
1 change: 1 addition & 0 deletions gen_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MIX_ENV="docs" mix docs
7 changes: 7 additions & 0 deletions lib/tomlex.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ defmodule Tomlex do
alias Tomlex.Line
alias Tomlex.Parser

@doc """
Parses a string into a map.
It tokenizes each line (separated by \n) into structs, which are then parsed
into the map structure.
"""
@spec load(String.t) :: Map.t
def load(text) do
String.split(text, "\n", trim: true)
|> Enum.map(fn(line) -> Line.tokenize(line) end)
Expand Down
5 changes: 4 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ defmodule Tomlex.Mixfile do
#
# Type `mix help deps` for more examples and options
defp deps do
[]
[
{:earmark, "~> 0.1", only: :docs},
{:ex_doc, "~> 0.6", only: :docs}
]
end

defp package do
Expand Down
2 changes: 2 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
%{"earmark": {:hex, :earmark, "0.1.10"},
"ex_doc": {:hex, :ex_doc, "0.6.1"}}

0 comments on commit 8304eb1

Please sign in to comment.