Skip to content

Commit

Permalink
updated edown_layout with R14B02 additions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Wiger committed Mar 23, 2011
1 parent 555e039 commit 5ca2ed6
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 8 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: all compile clean doc

all: compile doc

compile:
./rebar compile

clean:
./rebar clean

doc:
./rebar doc
6 changes: 5 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ to EDoc.

EDoc was written by Richard Carlsson, (c) 2001-2007 Richard Carlsson.
It is part of Erlang/OTP (http://www.erlang.org) and available
via the Erlang Public License (EPL).
via the Erlang Public License (EPL).

Original idea and implementation for EDown: ulf.wiger@erlang-solutions.com

Markedoc contributed by Henning Dietrich <hd2010@eonblast.com>
29 changes: 29 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,40 @@ written, and the outline of each, other plugins convert to suitable
content representation (e.g. HTML or Markdown), and EDoc then
writes the files necessary.



For now, EDown focuses on producing reasonable Markdown, rather
than complying fully with the plugin framework. That is, the
edown_doclet module will not go out of its way to function together
with any other layout module than edown_layout, and vice versa.



markedoc
========



The sed script bin/markedoc works in the opposite direction and converts
your `README.md` to an `EDoc` file.



See [bin/MARKEDOC-README.md](bin/MARKEDOC-README.md).



**FreeBSD, Mac OS X**
`$ sed -E -f markedoc.sed <markdown file> > <edoc file>`



**Linux**
`$ sed -r -f markedoc.sed <markdown file> > <edoc file>`




<h2 class="indextitle">Modules</h2>


Expand Down
4 changes: 2 additions & 2 deletions doc/edown_doclet.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla



<tt>run(Command::<a href="#type-doclet_gen">doclet_gen()</a> | <a href="#type-doclet_toc">doclet_toc()</a>, Ctxt::<a href="#type-edoc_context">edoc_context()</a>) -> ok</tt>
<tt>runfun((Command::<a href="#type-doclet_gen">doclet_gen()</a> | <a href="#type-doclet_toc">doclet_toc()</a>, Ctxt::<a href="#type-edoc_context">edoc_context()</a>) -> ok)</tt>



Expand Down Expand Up @@ -150,4 +150,4 @@ will be copied to the target directory.



_Generated by EDoc, Dec 31 2010, 09:13:36._
_Generated by EDoc, Mar 23 2011, 18:36:45._
2 changes: 1 addition & 1 deletion doc/edown_layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ __See also:__ [//edoc/edoc:layout/2](http://www.erlang.org/doc/man/edoc.html#lay



_Generated by EDoc, Dec 31 2010, 09:13:36._
_Generated by EDoc, Mar 23 2011, 18:36:45._
2 changes: 1 addition & 1 deletion doc/edown_lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla



_Generated by EDoc, Dec 31 2010, 09:13:36._
_Generated by EDoc, Mar 23 2011, 18:36:45._
2 changes: 1 addition & 1 deletion doc/edown_xmerl.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla



_Generated by EDoc, Dec 31 2010, 09:13:36._
_Generated by EDoc, Mar 23 2011, 18:36:45._
17 changes: 17 additions & 0 deletions doc/overview.edoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,21 @@ For now, EDown focuses on producing reasonable Markdown, rather
than complying fully with the plugin framework. That is, the
edown_doclet module will not go out of its way to function together
with any other layout module than edown_layout, and vice versa.

markedoc
========

The sed script bin/markedoc works in the opposite direction and converts
your `README.md' to an `EDoc' file.

See <a href="bin/MARKEDOC-README.md">bin/MARKEDOC-README.md</a>.

**FreeBSD, Mac OS X**
`$ sed -E -f markedoc.sed <markdown file> > <edoc file>'

**Linux**
`$ sed -r -f markedoc.sed <markdown file> > <edoc file>'



@end
3 changes: 2 additions & 1 deletion ebin/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
./*
*.beam
*.app
22 changes: 21 additions & 1 deletion src/edown_layout.erl
Original file line number Diff line number Diff line change
Expand Up @@ -715,16 +715,24 @@ t_type([E=#xmlElement{name = atom}]) ->
t_atom(E);
t_type([E=#xmlElement{name = integer}]) ->
t_integer(E);
t_type([E=#xmlElement{name = range}]) ->
t_range(E);
t_type([E=#xmlElement{name = binary}]) ->
t_binary(E);
t_type([E=#xmlElement{name = float}]) ->
t_float(E);
t_type([#xmlElement{name = nil}]) ->
t_nil();
t_type([#xmlElement{name = list, content = Es}]) ->
t_list(Es);
t_type([#xmlElement{name = paren, content = Es}]) ->
t_paren(Es);
t_type([#xmlElement{name = nonempty_list, content = Es}]) ->
t_nonempty_list(Es);
t_type([#xmlElement{name = tuple, content = Es}]) ->
t_tuple(Es);
t_type([#xmlElement{name = 'fun', content = Es}]) ->
t_fun(Es);
["fun("] ++ t_fun(Es) ++ [")"];
t_type([#xmlElement{name = record, content = Es}]) ->
t_record(Es);
t_type([E = #xmlElement{name = abstype, content = Es}]) ->
Expand All @@ -742,15 +750,27 @@ t_atom(E) ->
t_integer(E) ->
[get_attrval(value, E)].

t_range(E) ->
[get_attrval(value, E)].

t_binary(E) ->
[get_attrval(value, E)].

t_float(E) ->
[get_attrval(value, E)].

t_nil() ->
["[]"].

t_paren(Es) ->
["("] ++ t_utype(get_elem(type, Es)) ++ [")"].

t_list(Es) ->
["["] ++ t_utype(get_elem(type, Es)) ++ ["]"].

t_nonempty_list(Es) ->
["["] ++ t_utype(get_elem(type, Es)) ++ [", ...]"].

t_tuple(Es) ->
["{"] ++ seq(fun t_utype_elem/1, Es, ["}"]).

Expand Down

0 comments on commit 5ca2ed6

Please sign in to comment.