Skip to content

Commit

Permalink
re-generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
uwiger committed May 8, 2012
1 parent c283e6d commit 48bc5c3
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 152 deletions.
78 changes: 21 additions & 57 deletions README.md
Expand Up @@ -15,51 +15,32 @@ More-or-less readable Markdown can be generated.
A doclet needs to be written that also creates
a markdown-based index and overview. Currently, the
edoc_doclet creates an index.html and overview.html,
which do not point to the .md files.
which do not point to the .md files.



To generate markdown edoc, run:

<pre>
To generate markdown edoc, run: <pre>
edoc:application(App, [{doclet, edown_doclet} | OtherOpts]).
</pre>


</pre>

The `edown_xmerl` module is used as an xmerl export module.
It converts xmerl's "simple xml" to Markdown syntax. Note that
GH-flavored Markdown allows HTML markup (at least common tags),
but doesn't expand markdown markup inside HTML markup, so the
`edown_xmerl` module has to know the context in which it operates.



** Special edown option: **

but doesn't expand markdown markup inside HTML markup, so the `edown_xmerl` module has to know the context in which it operates.

** Special edown option: **

Using the option `{top_level_readme, {File, BaseHref}}`, a github-friendly
`README.md` in the top directory can be generated from the `overview.edoc`.
This file is the same as the `doc/README.md` file already generated,
but with relative links corrected (using `BaseHref`) so that they actually
work. This step is needed since Github doesn't support relative paths in
Markdown links.



Example:



`{top_level_readme, {"./README.md", "http://github.com/esl/edown"}}`
Markdown links.

Example:

`{top_level_readme, {"./README.md", "http://github.com/esl/edown"}}`

The conversion function will fetch the current branch name from git,
and fail if it cannot do so.


and fail if it cannot do so.

NOTE
====
Expand All @@ -73,49 +54,32 @@ different sections. It would have been better to have a framework
where some plugin functions identify the different files to be
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.


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.


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](http://github.com/esl/gproc/blob/master/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>`
your `README.md` to an `EDoc` file.

See [bin/MARKEDOC-README.md](http://github.com/esl/edown/blob/master/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>`

##Modules##


<table width="100%" border="0" summary="list of modules">
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_doclet.md" class="module">edown_doclet</a></td></tr>
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_layout.md" class="module">edown_layout</a></td></tr>
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_lib.md" class="module">edown_lib</a></td></tr>
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_make.md" class="module">edown_make</a></td></tr>
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_xmerl.md" class="module">edown_xmerl</a></td></tr></table>
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_doclet.md" class="module">edown_doclet</a></td></tr>
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_layout.md" class="module">edown_layout</a></td></tr>
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_lib.md" class="module">edown_lib</a></td></tr>
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_make.md" class="module">edown_make</a></td></tr>
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_xmerl.md" class="module">edown_xmerl</a></td></tr></table>

68 changes: 16 additions & 52 deletions doc/README.md
Expand Up @@ -15,51 +15,32 @@ More-or-less readable Markdown can be generated.
A doclet needs to be written that also creates
a markdown-based index and overview. Currently, the
edoc_doclet creates an index.html and overview.html,
which do not point to the .md files.
which do not point to the .md files.



To generate markdown edoc, run:

<pre>
To generate markdown edoc, run: <pre>
edoc:application(App, [{doclet, edown_doclet} | OtherOpts]).
</pre>


</pre>

The `edown_xmerl` module is used as an xmerl export module.
It converts xmerl's "simple xml" to Markdown syntax. Note that
GH-flavored Markdown allows HTML markup (at least common tags),
but doesn't expand markdown markup inside HTML markup, so the
`edown_xmerl` module has to know the context in which it operates.



** Special edown option: **

but doesn't expand markdown markup inside HTML markup, so the `edown_xmerl` module has to know the context in which it operates.

** Special edown option: **

Using the option `{top_level_readme, {File, BaseHref}}`, a github-friendly
`README.md` in the top directory can be generated from the `overview.edoc`.
This file is the same as the `doc/README.md` file already generated,
but with relative links corrected (using `BaseHref`) so that they actually
work. This step is needed since Github doesn't support relative paths in
Markdown links.



Example:



`{top_level_readme, {"./README.md", "http://github.com/esl/edown"}}`
Markdown links.

Example:

`{top_level_readme, {"./README.md", "http://github.com/esl/edown"}}`

The conversion function will fetch the current branch name from git,
and fail if it cannot do so.


and fail if it cannot do so.

NOTE
====
Expand All @@ -73,41 +54,24 @@ different sections. It would have been better to have a framework
where some plugin functions identify the different files to be
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.


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.


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>`
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>`

##Modules##

Expand Down
16 changes: 6 additions & 10 deletions doc/edown_doclet.md
Expand Up @@ -39,15 +39,11 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla



Main doclet entry point.
Main doclet entry point.



Also see [`//edoc/edoc:layout/2`](/Users/uwiger/FL/git/edoc/doc/edoc.md#layout-2) for layout-related options, and
[`//edoc/edoc:get_doc/2`](/Users/uwiger/FL/git/edoc/doc/edoc.md#get_doc-2) for options related to reading source
files.

Options:
Also see [`//edoc/edoc:layout/2`](http://www.erlang.org/doc/man/edoc.html#layout-2) for layout-related options, and
[`//edoc/edoc:get_doc/2`](http://www.erlang.org/doc/man/edoc.html#get_doc-2) for options related to reading source
files. Options:



Expand Down Expand Up @@ -77,7 +73,7 @@ functions will also be included. The default value is <code>false</code>.



<dt><code>{overview, <a href="/Users/uwiger/FL/git/edoc/doc/edoc.md#type-filename">//edoc/edoc:filename()</a>}</code>
<dt><code>{overview, <a href="http://www.erlang.org/doc/man/edoc.html#type-filename">//edoc/edoc:filename()</a>}</code>
</dt>


Expand Down Expand Up @@ -117,7 +113,7 @@ specified, no stylesheet reference will be generated.



<dt><code>{stylesheet_file, <a href="/Users/uwiger/FL/git/edoc/doc/edoc.md#type-filename">//edoc/edoc:filename()</a>}</code>
<dt><code>{stylesheet_file, <a href="http://www.erlang.org/doc/man/edoc.html#type-filename">//edoc/edoc:filename()</a>}</code>
</dt>


Expand Down
10 changes: 4 additions & 6 deletions doc/edown_layout.md
Expand Up @@ -50,9 +50,7 @@ The module is intended to be used together with edoc.<a name="index"></a>



The layout function.

Options to the standard layout:
The layout function. Options to the standard layout:



Expand Down Expand Up @@ -118,15 +116,15 @@ the source file. The default value is <code>true</code>.



<dd>Specifies an <a href="/Users/uwiger/FL/git/xmerl/doc/index.md" target="_top"><code>xmerl</code></a> callback module to be
used for exporting the documentation. See <a href="/Users/uwiger/FL/git/xmerl/doc/xmerl.md#export_simple_content-2"><code>//xmerl/xmerl:export_simple_content/2</code></a> for details.
<dd>Specifies an <a href="http://www.erlang.org/doc/man/index.html" target="_top"><code>xmerl</code></a> callback module to be
used for exporting the documentation. See <a href="http://www.erlang.org/doc/man/xmerl.html#export_simple_content-2"><code>//xmerl/xmerl:export_simple_content/2</code></a> for details.
</dd>





__See also:__ [//edoc/edoc:layout/2](/Users/uwiger/FL/git/edoc/doc/edoc.md#layout-2), [edown_doclet:layout/2](edown_doclet.md#layout-2).<a name="overview-2"></a>
__See also:__ [//edoc/edoc:layout/2](http://www.erlang.org/doc/man/edoc.html#layout-2), [edown_doclet:layout/2](edown_doclet.md#layout-2).<a name="overview-2"></a>

###overview/2##

Expand Down
38 changes: 11 additions & 27 deletions doc/edown_make.md
Expand Up @@ -34,14 +34,10 @@



Reads ConfigFile and calls [`edoc:application/3`](edoc.md#application-3)


Reads ConfigFile and calls [`edoc:application/3`](edoc.md#application-3)

The ConfigFile will be read using [`file:script/1`](file.md#script-1), and should return
`{App, Dir, Options}`, as required by [`edoc:application/3`](edoc.md#application-3).

This function does not manage dependencies. It is simply a wrapper around
`{App, Dir, Options}`, as required by [`edoc:application/3`](edoc.md#application-3). This function does not manage dependencies. It is simply a wrapper around
[`edoc:application/3`](edoc.md#application-3).<a name="main-1"></a>

###main/1##
Expand All @@ -57,32 +53,20 @@ This function does not manage dependencies. It is simply a wrapper around



Escript entry point for building edown (or edoc) documentation



Usage: edown_make -config ConfigFile [-pa P] [-pz P]



Calls [from_script(ConfigFile)](#from_script-1) and then terminates,
with a normal or non-normal exit code, depending on the outcome.
Escript entry point for building edown (or edoc) documentation

Usage: edown_make -config ConfigFile [-pa P] [-pz P]

Calls [from_script(ConfigFile)](#from_script-1) and then terminates,
with a normal or non-normal exit code, depending on the outcome.

Make sure `$EDOWN/edown_make` is runnable, and in the command path, and
that the edown BEAM files are in the Erlang path (e.g. using $ERL_LIBS).
The `edown_make` escript also accepts `-pa P` and/or `-pz P` flags as a
means of locating the edown byte code.



Note, however, that the function `edoc_make:main/1` only expects the
config file as an input argument, corresponding to


The `edown_make` escript also accepts `-pa P` and/or `-pz P` flags as a
means of locating the edown byte code.

`escript edoc_make.beam ConfigFile`
Note, however, that the function `edoc_make:main/1` only expects the
config file as an input argument, corresponding to

(The reason for this is that if the beam file can be passed directly to
`escript edoc_make.beam ConfigFile` (The reason for this is that if the beam file can be passed directly to
the escript command, setting the path should also be doable that way).

0 comments on commit 48bc5c3

Please sign in to comment.