Участник:Dmitriid/en-MANRenderer
Материал из Erlang по-русски.
Содержание |
[править]
Description
Code you'll find on this page is being used to render man formatted pages as wiki pages.
This class is being used as an extension to show documents on MAN_Страницы.
The class was written using reference from man man and troff/nroff quick reference. Since I used man gen_server as reference, the class doesn't try to parse anything beyond formatting used in that man page.
[править]
Usage
Create/edit a page.
Place man-formatted text between <manpage> and </manpage> tags.
[править]
Example
<manpage>
.TH Usage
.SH Subtitle
.RS 2
Text
.RE
.LP
More text
*
List
.LP
More text
.nf
Formatted
text
.fi
</manpage>
which will result in:
Usage
Subtitle
Text
More text
- List
More text
Formatted text
[править]
Changes
0.2.2
* links to other man pages are now properly recognized and formatted
0.2.1
+ lists are properly formatted (list elements cannot be multiline)
* extra <br> tags removed (e.g. after <h*>)
Unfortunately, wiki adds extra tags. Can't figure out a way to avoid this
0.2
+ Class that parses text line by line
+ Automatic linking to other man pages
0.1
+ Text formatted using regexpsp
[править]
Code
Available here: User:Dmitriid/MamutManRenderer
[править]
License
As-is
Use anywhere you want
Honorary mention of the author is welcome

