A library for defining your structs in Markdown. It will be compiled to a module with documentation, a struct and some helper functions like new
. Depending on the options you give it it creates a new module or injects it in the current module. Any extra text (like paragraphs) will be present in the documentation but not in the structs. Please see the examples for more details.
This module implements some features of the MSON spec of Apiary. Adding new features is currently not on the roadmap.
Usage is inspired by the excellent protobuf library.
defmodule MyProject do
use MSON, """
# Data
+ name (string)
+ type (string)
"""
end
%MyProject.Data{name: nil, type: nil}
You can define your own functions.
defmodule MyProject.Data do
use MSON, ["""
# Data
+ name (string)
+ type (string)
""", inject: true]
end
%MyProject.Data{name: nil, type: nil}
Add it to your mix.exs
file like either one of this:
defp deps do
[
{:mson, "~> 0.1"}
]
end
Write documentation.
Fork and send a PR! Try to be a good citizen ;-)