You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by Marvin Humphrey <ma...@rectangular.com> on 2012/05/13 02:06:17 UTC
[lucy-dev] Markdown for documentation
Greets,
The POD documentation that Perl users of Lucy see is mostly autogenerated
from "DocuComments" in our cfh files. DocuComments probably look a lot
like Javadocs to most observers, though there are many similar
documentation systems out there[1].
Much of Lucy's documentation was originally written in POD, and there are
still some legacy POD-isms here and there, especially POD-style
L<links|perlpod>. Mixing POD and C-style comments is awkard, though; we
should really find a better syntax for those. Also, for inline code
snippets, we currently support XML-style <code>code tags</code>. I think
it would be a mistake to continue the transition to XML-style, a la C#.
Conceptually, the option I find most attractive is integrating Markdown
with Javadoc-style @tags, which has been done more than once:
http://www.stack.nl/~dimitri/doxygen/markdown.html
http://code.google.com/p/markdown-doclet/wiki/Examples
Honorable mention goes to Scaladoc, which mixes @tags with Trac-style wiki
markup.
https://wiki.scala-lang.org/display/SW/Syntax
None of those products would work for Clownfish as a direct dependency,
though. Doxygen has its advantages, but it's huge, it's GPL, its
generated HTML is funky, it's completely baffled by our autogenerated C
code, and its Markdown integration is idiosyncratic -- in short, I don't
think it's in Clownfish's interest to lash itself to Doxygen.
Instead, I think it might make sense to work with the C library Sundown:
https://github.com/tanoku/sundown
At first look, Sundown seems appropriate as a dependency for us:
cross-platform, no configuration, just a handful of .c and .h files.
Here's an approach I hope will work well:
1. Extract comment text from .cfh file.
2. Remove C comment artifacts and make content flush left.
3. Preprocess select @tags, converting them into an intermediate
Markdown format. At this point, the transformation of the original
comment into pure Markdown is complete.
4. Parse intermediate Markdown with Sundown.
5. Use Sundown plus custom plugins to render content in host-specific
output formats, e.g. POD, Rdoc.
Committing to Markdown as Clownfish's documentation language also gives us
the option of writing docs as pure .mdtext files.
Thoughts?
Marvin Humphrey
[1] http://www.stack.nl/~dimitri/doxygen/links.html
Re: [lucy-dev] Markdown for documentation
Posted by Logan Bell <lo...@gmail.com>.
+1 to uses markdown for documentation, even if there is this tension with
github and the markdown specification.
I read through the various recommendations (Sundown, upskirt, etc) and
Sundown seems to be the most active and attempts to comply with markdown
specifications. Even though it sounds like Sundown may cater more to github
style markdown they have this message right on their homepage:
"Sundown passes out of the box the official Markdown v1.0.0 and v1.0.3 test
suites, and has been extensively tested with additional corner cases to
make sure its output is as sane as possible at all times."
Also, +1 to using B<param_name>, that was new to me as well.
Cheers,
Logan
On Sun, May 13, 2012 at 11:44 AM, Marvin Humphrey <ma...@rectangular.com>wrote:
> On Sat, May 12, 2012 at 10:01 PM, David E. Wheeler
> <da...@justatheory.com> wrote:
> > The one complaint I have about Sundown is its lack of support for
> definition lists.
> >
> > https://github.com/tanoku/sundown/issues/10
> >
> > This is especially important, I find, for documenting lists of parameters
> > for methods. Definition lists are perfect for this. POD does that, too,
> with
> > the `=item text` syntax.
>
> We don't use `=item text` in Lucy's POD for parameter lists, though. I
> hate
> the fact that perldoc doesn't indent the label text, even if you use
> `=over 8`.
>
> Here are the two approaches contrasted:
>
>
> http://search.cpan.org/~dwheeler/Text-Markup-0.17/lib/Text/Markup.pm#new
>
> http://search.cpan.org/~logie/Lucy-0.3.1/lib/Lucy/Search/IndexSearcher.pod#hits%28_[labeled_params]_%29<http://search.cpan.org/%7Elogie/Lucy-0.3.1/lib/Lucy/Search/IndexSearcher.pod#hits%28_[labeled_params]_%29>
>
> I like your use of C<param_name> as opposed to our B<param_name>! We
> should
> switch to that.
>
> So... in vanilla Markdown, we can use bullet lists in conjunction with
> backticks -- and thus I don't believe that definition lists are required.
>
> * `foo` - A Foo.
> * `bar` - A Bar.
>
> > But Sundown does not. At least, not yet. Maybe
> > you'd want to add it? Last time I asked tanoku about it, he said that the
> > PHP Markdown syntax is terrible to parse.
>
> Here's the thing. There's only one Markdown specification: Gruber's
> original.
> Then there are a zillion different implementations which extend Markdown
> in incompatible ways.
>
> If this was only for our own internal use, it wouldn't matter. But we're
> defining a public API: the syntax for Clownfish documentation. IMO, the
> only
> sane approach is to lock the API to the unchanging vanilla Markdown spec,
> rather than to the shifting implementation details of what happens to be
> supported by one particular library.
>
> (I hope Sundown can be persuaded to support vanilla Markdown rather than
> Github-flavored Markdown.)
>
> > * [Discount](http://www.pell.portland.or.us/~orc/Code/discount/). BSD
> > license. Fast, but kind of weird, both in its additional syntax
> (definition
> > lists are kind of ugly) and in its interface.
>
> Looks like Discount is Unix-only. :(
>
> > * [peg-multimarkdown](https://github.com/fletcher/peg-multimarkdown).
> But
> > that's just too bloody big, isn't it?
>
> The size isn't outrageous, and it looks portable -- but the build seems to
> be
> fairly complex. It would take an unknown amount of work to integrate it.
>
> > * [upskirt](http://fossil.instinctive.eu/libupskirt/index). From which
> > Sundown was forked. Bare-bones parser-only implementation. Might
> require
> > more work to use, I don't know.
>
> I'm a little concerned about ongoing maintenance.
>
> http://fossil.instinctive.eu/libupskirt/wiki?name=about-the-name
>
> The whole github-triggered curse has been extremely painful for me.
> It's by
> far the worst coding-related experience I ever went through. That made
> me
> retire from Open Source.
>
> However I still feel a sense of duty, to fix whatever bugs it might
> contain,
> and occasionally going through the process of releasing a batch of
> fixes in a
> new version. Even for 1 user (myself excluded this time) I feel can't
> just
> leave like that. I feel responsible for maintaining the code base as
> long as
> it's used somewhere by someone.
>
> However I don't know yet how long the sense of duty will stand against
> the
> increasingly strong disgust for whole thing.
>
> However, even abandoned code might be OK for us, since this is for use by
> CFC
> rather than Lucy, and the needs of a compiler vis a vis security
> maintenance
> are vastly less than for a web-facing library.
>
> Marvin Humphrey
>
Re: [lucy-dev] Markdown for documentation
Posted by Joe Schaefer <jo...@yahoo.com>.
FWIW we finally settled on the python markdown implementation
for the www sitelargely because it has sane extension mechanisms.
We take advantage of that in order to properly identify headings
and such, that works great. The table fu is kinda-sorta useful
in many cases, but it's very limited. Automatic code highlighting
is nifty when it's using the right programming language ;-).
Yes I am aware that socially the markdown situation sucks, but
we had to pick something. Markdown at least has name-brand
recognition for what little it's worth, we could've went with
Textile if there was a decent webgui for editing it.
FWIW python and php at one point or another tried to keep parity
with markdown extension features. Dunno where that stands
today. But really from a usage standpoint nobody complains
about which version of markdown you're using from a holier-
than-tho perspective, if it works go for it.
>________________________________
> From: Marvin Humphrey <ma...@rectangular.com>
>To: dev@lucy.apache.org
>Sent: Thursday, May 17, 2012 11:18 PM
>Subject: Re: [lucy-dev] Markdown for documentation
>
>Hi David,
>
>As this discussion has progressed, I've been having second thoughts about
>Markdown. Perhaps we should consider reStructuredText as an alternative.
>
>In my opinion, our number one priority should be to commit to an external spec
>that is carved in stone. Debating lightweight markup syntax might be even
>less fun than debating query parser syntax. :P By implementing an
>authoritative spec, we limit the scope of debate and shut down a lot of
>bikeshedding before it starts.
>
>To my mind, the stability of the Markdown spec is one of its most
>attractive features. However, after further investigation, I have come to
>understand that the spec is rarely implemented as-is and that the Markdown
>community is deeply Balkanized and embittered on the subject of extending
>it[1]. I'm uneasy about inviting Markdown's controversies into our house.
>
>My preference is still for vanilla Markdown, more or less. To simplify
>things, let's tweak the proposal to relegate @tags to the end of the comment,
>eliminating inline @tag expansion.
>
> A DocuComment has two sections.
>
> body
> Description, formatted in Markdown. The first sentence must be a
> summary that can stand on its own. Terminated by the first line
> which begins with an "@" character or by the end of the comment.
>
> tags
> The comment may end with an optional tags block. Each tag begins
> with a supported @label at the beginning of a line, and is
> terminated by either the next tag or the end of the comment.
>
>There's only one Markdown extension I believe we can't live without: links
>without a protocol should be interpreted as API links.
>
> @param query A [Query](Lucy::Search::Query).
>
>Then there's one more change I'd consider optional, since nearly all Markdown
>implemenations have it: disable intra-word emphasis so that foo_bar_baz
>doesn't become foo<em>bar</em>baz. I don't really care one way or the other
>because 99% of the time `foo_bar_baz` should be enclosed in backticks.
>
>I realize that by adding those two extensions we start down the slippery
>slope... IMO, that's an argument against Markdown...
>
>I hope that's good enough. If it's not -- if we believe that ultimately it
>will be necessary to add additional extensions -- then I think we ought to
>consider reStructuredText instead.
>
> http://en.wikipedia.org/wiki/ReStructuredText
>
>From a high level, the syntactical differences between reStructuredText and
>extended Markdown are IMO superficial and the feature sets are similar -- but
>reStructuredText has a canonical spec which has been stable for 10 years.
>reStructuredText is like extended Markdown, minus the bikeshedding and the
>resentment towards the original author.
>
>> I prefer definition lists to bulleted lists, myself.
>
>Fortunately, the choice of whether we expand @param tags to bullet-lists or
>definition-lists is an implementation detail which is separate from whether we
>support lightweight markup within comments. Let's leave this topic for
>another day.
>
>> Well, MultiMarkdown is pretty well accepted as the #2 definition. Most
>> implementations follow its examples (FBOFW).
>
>I'm skeptical. From what I can tell, "GitHub Flavored Markdown" -- a
>particularly destructive variant given how incompatible it is with the
>original Markdown spec -- looks like a significant competitor.
>
>And here's what happened when someone tried to assert the dominance of
>MultiMarkdown on the markdown-discuss list last October:
>
> http://six.pairlist.net/pipermail/markdown-discuss/2011-October/002342.html
>
> > pandoc assessed 'em all, and decided on multimarkdown.
>
> Huh? No. Pandoc's markdown extensions aren't the same as mmd's. I have
> explained in earlier posts why I don't like mmd's table and metadata
> syntax. Pandoc goes back to 2005 and was not influenced by mmd.
>
>Adjudicating internet popularity contests is tiresome. :P
>
>> Note that Sundown supports quite a lot more than just vanilla Markdown. How
>> would you enforce that?
>
>It looks like you have to enable syntax extensions manually in Sundown -- so
>we "enforce" vanilla Markdown simply by not enabling those extensions.
>
>However, I'm concerned that choosing Sundown may set us up for failure because
>it means that we'll have this argument again later with someone who is
>*outraged* to discover that we've got their pet Markdown extension disabled.
>
>That's why I would like to determine whether we have consensus about forgoing
>additional Markdown extensions. If we don't have consensus, we should
>evaluate reStructuredText.
>
>Marvin Humphrey
>
>[1] http://six.pairlist.net/pipermail/markdown-discuss/2008-March/001163.html
> http://www.codinghorror.com/blog/2009/12/responsible-open-source-code-parenting.html
>
>
>
Re: [lucy-dev] Markdown for documentation
Posted by Nathan Kurz <na...@verse.com>.
On Tue, May 22, 2012 at 8:09 PM, Marvin Humphrey <ma...@rectangular.com> wrote:
> On Fri, May 18, 2012 at 11:57 AM, David E. Wheeler
> <da...@justatheory.com> wrote:
>> On May 18, 2012, at 2:40 PM, Marvin Humphrey wrote:
>>
>>> reStructuredText is probably a little noisier to read, true. But at least
>>> they're both quite readable in comparison to HTML, or XML as used in C#
>>> comments:
>>>
>>> http://broadcast.oreilly.com/2010/06/understanding-c-xml-comments.html
>>>
>>> /// <summary>
>>> /// The constructor sets the name, age and cash
>>> /// </summary>
>>> /// <param name="name">The name of the guy</param>
>>> /// <param name="age">The guy's age</param>
>>> /// <param name="cash">The amount of cash the guy starts with</param>
>>> public Guy(string name, int age, int cash) {
>>> this.name = name;
>>> this.age = age;
>>> Cash = cash;
>>> }
>>
>> I am glad you don’t hate the rest of us enough to do something like that. ;-P
I'm not sure if I have the same fear as David, but my fear is pretty
strong here too. At first, I thought you were talking about the
format for the external documentation, and I was slow to realize that
you were talking about adding all of this to the code itself. Yikes!
I feel comments should explain the intent of and offer structure to
the code, and not duplicate the information already contained in the
code. Maybe your examples are just strawmen, but it feels like a lot
of effort for very little gain. Rather than arguing about how to
format all the boilerplate, I'd like the discussion to be about why we
need it at all.
I found it hilarious that in your linked C# example that the comments
were broken and misleading. I thought (hoped) at first that this was
going to be the point of the article, but no, it seemed to be just
another cut-and-paste error that illustrates the perils of mandatory
and elaborate commenting strategies. And even if they weren't
mangled, do these comments add anything to the code?
-------
/// <summary>
/// Read-only backing field for the Name property
/// </summary>
private readonly string name;
...
/// <summary>
/// Read-only backing field for the Name property
/// </summary>
private readonly int age;
-------
Fearing I can't express myself coherently on this, here's a link to the
chapter from Code Complete that echos (and helped create) my
sentiments on comments. The section "Commenting Routines"
is most on point, but the Socratic Dialog at the beginning is applicable too.
The rest of the book is great too -- read it if you haven't.
http://www.scribd.com/doc/95398523/McConnell-Code-Complete-Chapter-32-Self-Documenting-Code
> Let's consider how various documentation systems, both real and theoretical,
> stack up against the C# XML system according to several criteria.
Fabulous summary of the formatting options though!
--nate
Re: [lucy-dev] Markdown for documentation
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Fri, May 18, 2012 at 11:57 AM, David E. Wheeler
<da...@justatheory.com> wrote:
> On May 18, 2012, at 2:40 PM, Marvin Humphrey wrote:
>
>> reStructuredText is probably a little noisier to read, true. But at least
>> they're both quite readable in comparison to HTML, or XML as used in C#
>> comments:
>>
>> http://broadcast.oreilly.com/2010/06/understanding-c-xml-comments.html
>>
>> /// <summary>
>> /// The constructor sets the name, age and cash
>> /// </summary>
>> /// <param name="name">The name of the guy</param>
>> /// <param name="age">The guy's age</param>
>> /// <param name="cash">The amount of cash the guy starts with</param>
>> public Guy(string name, int age, int cash) {
>> this.name = name;
>> this.age = age;
>> Cash = cash;
>> }
>
> I am glad you don’t hate the rest of us enough to do something like that. ;-P
Heh. Well, even though the end result is not my favorite doc comment format,
I think the C# people made some really interesting design choices, and that we
can learn from what they did!
Let's consider how various documentation systems, both real and theoretical,
stack up against the C# XML system according to several criteria.
~ Learning curve
~ Metadata: Can descriptions of method parameters, return values, etc. be
extracted as structured data? If so, that gives you a lot of options for
output, export and manipulation.
~ Expressivness: How much can you do within the main description? Bullet
lists? Code blocks? (Note that *all* these documentation systems allow
embedded HTML or XML which can be transformed to HTML.)
~ API links: Is it possible to link to an external class, a method in an
external class, a subject heading, etc?
~ Conciseness
~ Source legibility: It's valuable for the format to be both easy to read
and easy to write.
C# XML comments:
~ Learning curve: Very good if you already know Java and/or XML. Anyone who
knows XML already knows the syntax, so you only have to learn the
semantics. And since the semantics are basically the same as Javadoc's, if
you know both XML and Javadoc, you already grok this format!
~ Metadata: Yes, via XML tags and properties.
~ Expressiveness: Zilch without XML/XSLT.
~ API links: Yes.
~ Conciseness: Dreadful.
~ Source legibility: Horrible -- considerably more laborious to either read
or write in comparison to plain text or lightweight markup.
reStructuredText inside C multi-line comments:
~ Learning curve: Fair to poor. The format is not well-known. Given
examples it's not difficult to cargo cult, but the syntax is not always
intuitive.
~ Metadata: Yes, via field lists (and definition lists?).
~ API links: I think so.
~ Expressiveness: Outstanding, if you are motivated to learn the syntax.
~ Conciseness: Decent. Not as good as Markdown for code blocks.
~ Source legibility: Decent. It looks like plain text with the occasional
weird and distracting punctuation construct thrown in.
Plain Markdown inside C multi-line comments:
~ Learning curve: Good. Markdown is simple and fairly popular.
~ Metadata: No. This is a significant drawback.
~ API links: No. A severe drawback. :(
~ Expressiveness: Good. Missing some extended features.
~ Conciseness: Outstanding.
~ Source legibility: Outstanding. Tied with Javadoc for the easiest format
to both read and write.
Markdown with @tags and API links inside C multi-line comments:
~ Learning curve: Fair. Markdown is reasonably well known and easy to
learn. @tags are well known primarily via Javadoc, and easy to learn
via cargo culting.
~ Metadata: Yes, via @tags.
~ API links: Yes.
~ Expressiveness: Same as plain Markdown.
~ Conciseness: Outstanding.
~ Source legibility: Very good... but non-standard.
POD inside C multi-line comments:
~ Learning curve: Good. Easy things are easy, hard things are possible.
~ Metadata: No.
~ API links: Yes.
~ Expressiveness: Excellent. POD is full-featured.
~ Conciseness: Poor, particularly with lists.
~ Source legibility: Good in general, but has major flaws, e.g. nested
lists.
Javadoc:
~ Learning curve: Good. Well known and simple.
~ Metadata: Yes, via @tags.
~ API links: Yes.
~ Expressiveness: Fair to poor. Javadoc relies on metadata for common
constructs -- other than that you're going to need HTML. It's the
opposite of formats like POD and Markdown which rely on the user to make
most decisions about presentation.
~ Conciseness: Outstanding. Using the first sentence as an implicit summary
is genius, and @tags are extremely compact.
~ Source legibility: Outstanding. As easy to read and write as Markdown.
Scaladoc:
~ Learning curve: Good and bad. Easy to get started if you know Javadoc...
but then you have to learn the wiki syntax.
~ Metadata: Yes, via @tags.
~ API links: Yes.
~ Expressiveness: Outrageously powerful and complex. In addition to the
wiki syntax, also supports variables and documentation inheritance with
macro substitution!
~ Conciseness: Fair to good. The wiki-like syntax is not always minimalist.
~ Source legibility: Decent. Similar to Javadoc until you use the
wiki syntax.
Marvin Humphrey
Re: [lucy-dev] Markdown for documentation
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Fri, May 18, 2012 at 11:57 AM, David E. Wheeler
<da...@justatheory.com> wrote:
>>> As I said, I am unfamiliar with the @param syntax. Is it part of Sundown?
>>
>> Those @tags, including @param, @return, etc, are a convention used in Javadoc,
>> Scaladoc, Doxygen, and others.
>
> Ah, I see. Never used them. You would have to extend the parser to use them.
>
>> The idea is to treat the comment as an object which has properties, rather
>> than as a single blob of markup. That gives downstream renderers more choices
>> for output. For example, we might choose to output each @param tag as a
>> bullet list, or as a definition list.
>>
>> It's a powerful and elegant system -- but arguably another extension to
>> Markdown, if you want to see it that way.
>
> Since it is not a part of Markdown, I have trouble seeing how it could be
> considered anything else.
I don't think anyone who is familiar with Javadoc/Scaladoc/Doxygen would see
it that way -- the format would be perceived as "Javadoc with Markdown",
rather than "Markdown with @tags". And of course, that's by design -- it
would be advantageous to leverage existing developer familiarity with Javadoc.
However, the *feature* we are trying to support here is document metadata, and
@tags are only one way to specify metadata. With the proper parser, we could
also extract metadata from definition lists using something similar to the
syntax you propose here:
http://www.justatheory.com/computers/markup/modest-markdown-proposal.html
For example:
/*| Do stuff with `foo` and `bar`.
|
| Wrangle `foo` into a consumptive form after mutating its `okra`
| component from `ok` to `ochre`.
|
| * Meep the moop.
| * But don't bleep the bloop.
|
| Then apply `bar` as a transformation.
|
| Parameters:
|
| ~ foo: a [Foo](Fighter::Foo). Must not be NULL, Null, null, nil,
| None, Nothing, or undef.
| ~ bar: a [Bar](Dive::Bar).
|
| Returns: True on success, false on failure.
|*/
>> However, there's more than one way to specify properties, as the C# XML system
>> illustrates -- @tags are great, but it's not mandatory that we use that
>> particular syntax.
>>
>> In reStructuredText, I think we can use "field lists":
>>
>> http://docutils.sourceforge.net/docs/user/rst/quickref.html#field-lists
>> http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#field-lists
>>
>> Example:
>>
>> :param foo: A Foo.
>> :param bar: A Bar.
>> :return: true on success, false on failure.
>
> I guess that would work.
I share your reticence. In general, reStructuredText is unambiguous but also
unintuitive. :\
>>> http://www.justatheory.com/computers/markup/markdown-table-rfc.html
>>
>> For giggles, here's a version of your table example in reStructuredText:
>>
>> http://rst.ninjs.org/?n=4e1d41f32466afe278bd69c310d12cf1&theme=basic
>>
>> +------+-------------+------------------------------+--------+
>> | id | name | description | price |
>> +======+=============+==============================+========+
>> | 1 | gizmo | Takes care of the doohickies | 1.99 |
>> +------+-------------+------------------------------+--------+
>> | 2 | doodad | Collects *gizmos* | 23.80 |
>> +------+-------------+------------------------------+--------+
>> | 10 | dojigger | Handles: | 102.98 |
>> | | | | |
>> | | | * gizmos | |
>> | | | * doodads | |
>> | | | * thingamobobs | |
>> +------+-------------+------------------------------+--------+
>> | 1024 | thingamabob | Self-explanatory, no? | 0.99 |
>> +------+-------------+------------------------------+--------+
>
> Very MySQL-y.
You think so, eh?
The funny thing is that reStructuredText "grid tables" (which come from Emacs
"table mode") look as though they belong in Markdown -- because they look
great as plain text!
http://daringfireball.net/projects/markdown/
The overriding design goal for Markdown’s formatting syntax is to make it
as readable as possible. The idea is that a Markdown-formatted document
should be publishable as-is, as plain text, without looking like it’s been
marked up with tags or formatting instructions. While Markdown’s syntax
has been influenced by several existing text-to-HTML filters, the single
biggest source of inspiration for Markdown’s syntax is the format of plain
text email.
"Grid tables" may be verbose, but their borders look like graphical elements,
not "tags or formatting instructions".
In contrast, the MultiMarkdown table syntax never looks good in plain text,
even with your proposed improvements -- it looks like something out of
reStructuredText, because the syntax is obviously unnatural.
http://justatheory.com/computers/markup/markdown-table-rfc.html
However, tables aren't a must-have feature for our doc comments. The two
features missing from Markdown that we need are:
* Metadata
* API links
Marvin Humphrey
Re: [lucy-dev] Markdown for documentation
Posted by "David E. Wheeler" <da...@justatheory.com>.
On May 18, 2012, at 2:40 PM, Marvin Humphrey wrote:
> reStructuredText is probably a little noisier to read, true. But at least
> they're both quite readable in comparison to HTML, or XML as used in C#
> comments:
>
> http://broadcast.oreilly.com/2010/06/understanding-c-xml-comments.html
>
> /// <summary>
> /// The constructor sets the name, age and cash
> /// </summary>
> /// <param name="name">The name of the guy</param>
> /// <param name="age">The guy's age</param>
> /// <param name="cash">The amount of cash the guy starts with</param>
> public Guy(string name, int age, int cash) {
> this.name = name;
> this.age = age;
> Cash = cash;
> }
I am glad you don’t hate the rest of us enough to do something like that. ;-P
>> Is this ReST? I don't recognize it as Markdown.
>
> Haha, it's neither. It's an actual proposal, formatted as plain text. I tried
> to make it look like a definition list to please you. :)
>
>> As I said, I am unfamiliar with the @param syntax. Is it part of Sundown?
>
> Those @tags, including @param, @return, etc, are a convention used in Javadoc,
> Scaladoc, Doxygen, and others.
Ah, I see. Never used them. You would have to extend the parser to use them.
> The idea is to treat the comment as an object which has properties, rather
> than as a single blob of markup. That gives downstream renderers more choices
> for output. For example, we might choose to output each @param tag as a
> bullet list, or as a definition list.
>
> It's a powerful and elegant system -- but arguably another extension to
> Markdown, if you want to see it that way.
Since it is not a part of Markdown, I have trouble seeing how it could be considered anything else.
> However, there's more than one way to specify properties, as the C# XML system
> illustrates -- @tags are great, but it's not mandatory that we use that
> particular syntax.
>
> In reStructuredText, I think we can use "field lists":
>
> http://docutils.sourceforge.net/docs/user/rst/quickref.html#field-lists
> http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#field-lists
>
> Example:
>
> :param foo: A Foo.
> :param bar: A Bar.
> :return: true on success, false on failure.
I guess that would work.
>> http://www.justatheory.com/computers/markup/markdown-table-rfc.html
>
> For giggles, here's a version of your table example in reStructuredText:
>
> http://rst.ninjs.org/?n=4e1d41f32466afe278bd69c310d12cf1&theme=basic
>
> +------+-------------+------------------------------+--------+
> | id | name | description | price |
> +======+=============+==============================+========+
> | 1 | gizmo | Takes care of the doohickies | 1.99 |
> +------+-------------+------------------------------+--------+
> | 2 | doodad | Collects *gizmos* | 23.80 |
> +------+-------------+------------------------------+--------+
> | 10 | dojigger | Handles: | 102.98 |
> | | | | |
> | | | * gizmos | |
> | | | * doodads | |
> | | | * thingamobobs | |
> +------+-------------+------------------------------+--------+
> | 1024 | thingamabob | Self-explanatory, no? | 0.99 |
> +------+-------------+------------------------------+--------+
Very MySQL-y.
>> But of course, no table or definition list proposal (I had one of those,
>> too) has been accepted.
>
> reStructuredText has definition lists, too, FTR.
>
> http://docutils.sourceforge.net/docs/user/rst/quickref.html#definition-lists
Those look pretty good.
Best,
David
Re: [lucy-dev] Markdown for documentation
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Thu, May 17, 2012 at 10:01 PM, David E. Wheeler
<da...@justatheory.com> wrote:
> On May 17, 2012, at 11:18 PM, Marvin Humphrey wrote:
>> Perhaps we should consider reStructuredText as an alternative.
>
> That might be okay, though it is not as nice as Markdown in plain text.
reStructuredText is probably a little noisier to read, true. But at least
they're both quite readable in comparison to HTML, or XML as used in C#
comments:
http://broadcast.oreilly.com/2010/06/understanding-c-xml-comments.html
/// <summary>
/// The constructor sets the name, age and cash
/// </summary>
/// <param name="name">The name of the guy</param>
/// <param name="age">The guy's age</param>
/// <param name="cash">The amount of cash the guy starts with</param>
public Guy(string name, int age, int cash) {
this.name = name;
this.age = age;
Cash = cash;
}
>> A DocuComment has two sections.
>>
>> body
>> Description, formatted in Markdown. The first sentence must be a
>> summary that can stand on its own. Terminated by the first line
>> which begins with an "@" character or by the end of the comment.
>>
>> tags
>> The comment may end with an optional tags block. Each tag begins
>> with a supported @label at the beginning of a line, and is
>> terminated by either the next tag or the end of the comment.
>
> Is this ReST? I don't recognize it as Markdown.
Haha, it's neither. It's an actual proposal, formatted as plain text. I tried
to make it look like a definition list to please you. :)
> As I said, I am unfamiliar with the @param syntax. Is it part of Sundown?
Those @tags, including @param, @return, etc, are a convention used in Javadoc,
Scaladoc, Doxygen, and others.
http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#param
https://wiki.scala-lang.org/display/SW/Tags+and+Annotations
http://www.stack.nl/~dimitri/doxygen/commands.html#cmdparam
The idea is to treat the comment as an object which has properties, rather
than as a single blob of markup. That gives downstream renderers more choices
for output. For example, we might choose to output each @param tag as a
bullet list, or as a definition list.
It's a powerful and elegant system -- but arguably another extension to
Markdown, if you want to see it that way.
However, there's more than one way to specify properties, as the C# XML system
illustrates -- @tags are great, but it's not mandatory that we use that
particular syntax.
In reStructuredText, I think we can use "field lists":
http://docutils.sourceforge.net/docs/user/rst/quickref.html#field-lists
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#field-lists
Example:
:param foo: A Foo.
:param bar: A Bar.
:return: true on success, false on failure.
> http://www.justatheory.com/computers/markup/markdown-table-rfc.html
For giggles, here's a version of your table example in reStructuredText:
http://rst.ninjs.org/?n=4e1d41f32466afe278bd69c310d12cf1&theme=basic
+------+-------------+------------------------------+--------+
| id | name | description | price |
+======+=============+==============================+========+
| 1 | gizmo | Takes care of the doohickies | 1.99 |
+------+-------------+------------------------------+--------+
| 2 | doodad | Collects *gizmos* | 23.80 |
+------+-------------+------------------------------+--------+
| 10 | dojigger | Handles: | 102.98 |
| | | | |
| | | * gizmos | |
| | | * doodads | |
| | | * thingamobobs | |
+------+-------------+------------------------------+--------+
| 1024 | thingamabob | Self-explanatory, no? | 0.99 |
+------+-------------+------------------------------+--------+
> But of course, no table or definition list proposal (I had one of those,
> too) has been accepted.
reStructuredText has definition lists, too, FTR.
http://docutils.sourceforge.net/docs/user/rst/quickref.html#definition-lists
Marvin Humphrey
Re: [lucy-dev] Markdown for documentation
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Fri, May 18, 2012 at 9:04 AM, Peter Karman <pe...@peknet.com> wrote:
> Why are we not considering POD?
POD:
/** =over
*
* =item
*
* POD lists are outrageously verbose.
*
* =item
*
* =over
*
* =item
*
* For example, a two-item list occupies 12 lines.
*
* =item
*
* Nested POD lists provide no visual hint that they are nested via
* indentation.
*
* =back
*
* =item
*
* There are other issues, but IMO POD lists are so problematic that
* they suffice to rule out the format.
*
* =back
*/
Markdown:
/** * POD lists are outrageously verbose.
* * For example, a two-item list occupies 12 lines.
* * Nested POD lists provide no visual hint that they are nested via
* indentation.
* * There are other issues, but IMO POD lists are so problematic that
* they suffice to rule out the format.
*/
reStructuredText:
/** - POD lists are outrageously verbose.
*
* - For example, a two-item list occupies 12 lines.
* - Nested POD lists provide no visual hint that they are nested via
* indentation.
*
* - There are other issues, but IMO POD lists are so problematic that
* they suffice to rule out the format.
*/
Marvin Humphrey
Re: [lucy-dev] Markdown for documentation
Posted by Peter Karman <pe...@peknet.com>.
On 5/18/12 12:01 AM, David E. Wheeler wrote:
> On May 17, 2012, at 11:18 PM, Marvin Humphrey wrote:
>
>> In my opinion, our number one priority should be to commit to an external spec
>> that is carved in stone. Debating lightweight markup syntax might be even
>> less fun than debating query parser syntax. :P By implementing an
>> authoritative spec, we limit the scope of debate and shut down a lot of
>> bikeshedding before it starts.
>
> Well, stick to Pod, then. :-)
>
Yes. Why are we not considering POD?
--
Peter Karman . http://peknet.com/ . peter@peknet.com
Re: [lucy-dev] Markdown for documentation
Posted by "David E. Wheeler" <da...@justatheory.com>.
On May 17, 2012, at 11:18 PM, Marvin Humphrey wrote:
> Hi David,
Hi Marvin.
> As this discussion has progressed, I've been having second thoughts about
> Markdown. Perhaps we should consider reStructuredText as an alternative.
That might be okay, though it is not as nice as Markdown in plain text.
> In my opinion, our number one priority should be to commit to an external spec
> that is carved in stone. Debating lightweight markup syntax might be even
> less fun than debating query parser syntax. :P By implementing an
> authoritative spec, we limit the scope of debate and shut down a lot of
> bikeshedding before it starts.
Well, stick to Pod, then. :-)
> My preference is still for vanilla Markdown, more or less. To simplify
> things, let's tweak the proposal to relegate @tags to the end of the comment,
> eliminating inline @tag expansion.
>
> A DocuComment has two sections.
>
> body
> Description, formatted in Markdown. The first sentence must be a
> summary that can stand on its own. Terminated by the first line
> which begins with an "@" character or by the end of the comment.
>
> tags
> The comment may end with an optional tags block. Each tag begins
> with a supported @label at the beginning of a line, and is
> terminated by either the next tag or the end of the comment.
Is this ReST? I don't recognize it as Markdown. Here is the official syntax:
http://daringfireball.net/projects/markdown/syntax
> There's only one Markdown extension I believe we can't live without: links
> without a protocol should be interpreted as API links.
>
> @param query A [Query](Lucy::Search::Query).
Yeah. Another reason to stick with Pod.
> I hope that's good enough. If it's not -- if we believe that ultimately it
> will be necessary to add additional extensions -- then I think we ought to
> consider reStructuredText instead.
>
> http://en.wikipedia.org/wiki/ReStructuredText
>
> From a high level, the syntactical differences between reStructuredText and
> extended Markdown are IMO superficial and the feature sets are similar -- but
> reStructuredText has a canonical spec which has been stable for 10 years.
> reStructuredText is like extended Markdown, minus the bikeshedding and the
> resentment towards the original author.
ReST, unlike Markdown, is highly extensible. I had to work with Daniele Varrazzo pretty closely to get a non-sucky, mostly plain ReST support into Text::Markup/PGXN.
https://github.com/theory/text-markup/commits/master
>> I prefer definition lists to bulleted lists, myself.
>
> Fortunately, the choice of whether we expand @param tags to bullet-lists or
> definition-lists is an implementation detail which is separate from whether we
> support lightweight markup within comments. Let's leave this topic for
> another day.
As I said, I am unfamiliar with the @param syntax. Is it part of Sundown?
>
>> Well, MultiMarkdown is pretty well accepted as the #2 definition. Most
>> implementations follow its examples (FBOFW).
>
> I'm skeptical. From what I can tell, "GitHub Flavored Markdown" -- a
> particularly destructive variant given how incompatible it is with the
> original Markdown spec -- looks like a significant competitor.
>
> And here's what happened when someone tried to assert the dominance of
> MultiMarkdown on the markdown-discuss list last October:
>
> http://six.pairlist.net/pipermail/markdown-discuss/2011-October/002342.html
>
>> pandoc assessed 'em all, and decided on multimarkdown.
>
> Huh? No. Pandoc's markdown extensions aren't the same as mmd's. I have
> explained in earlier posts why I don't like mmd's table and metadata
> syntax. Pandoc goes back to 2005 and was not influenced by mmd.
>
> Adjudicating internet popularity contests is tiresome. :P
Eh. Well, there is my table proposal.
http://www.justatheory.com/computers/markup/markdown-table-rfc.html
But of course, no table or definition list proposal (I had one of those, too) has been accepted. So just core, canonical Markdown might be best.
>> Note that Sundown supports quite a lot more than just vanilla Markdown. How
>> would you enforce that?
>
> It looks like you have to enable syntax extensions manually in Sundown -- so
> we "enforce" vanilla Markdown simply by not enabling those extensions.
Ah, okay, that would probably be fine.
> However, I'm concerned that choosing Sundown may set us up for failure because
> it means that we'll have this argument again later with someone who is
> *outraged* to discover that we've got their pet Markdown extension disabled.
Another reason to stick with Pod. ;-P
> That's why I would like to determine whether we have consensus about forgoing
> additional Markdown extensions. If we don't have consensus, we should
> evaluate reStructuredText.
+1
David
Re: [lucy-dev] Markdown for documentation
Posted by Marvin Humphrey <ma...@rectangular.com>.
Hi David,
As this discussion has progressed, I've been having second thoughts about
Markdown. Perhaps we should consider reStructuredText as an alternative.
In my opinion, our number one priority should be to commit to an external spec
that is carved in stone. Debating lightweight markup syntax might be even
less fun than debating query parser syntax. :P By implementing an
authoritative spec, we limit the scope of debate and shut down a lot of
bikeshedding before it starts.
To my mind, the stability of the Markdown spec is one of its most
attractive features. However, after further investigation, I have come to
understand that the spec is rarely implemented as-is and that the Markdown
community is deeply Balkanized and embittered on the subject of extending
it[1]. I'm uneasy about inviting Markdown's controversies into our house.
My preference is still for vanilla Markdown, more or less. To simplify
things, let's tweak the proposal to relegate @tags to the end of the comment,
eliminating inline @tag expansion.
A DocuComment has two sections.
body
Description, formatted in Markdown. The first sentence must be a
summary that can stand on its own. Terminated by the first line
which begins with an "@" character or by the end of the comment.
tags
The comment may end with an optional tags block. Each tag begins
with a supported @label at the beginning of a line, and is
terminated by either the next tag or the end of the comment.
There's only one Markdown extension I believe we can't live without: links
without a protocol should be interpreted as API links.
@param query A [Query](Lucy::Search::Query).
Then there's one more change I'd consider optional, since nearly all Markdown
implemenations have it: disable intra-word emphasis so that foo_bar_baz
doesn't become foo<em>bar</em>baz. I don't really care one way or the other
because 99% of the time `foo_bar_baz` should be enclosed in backticks.
I realize that by adding those two extensions we start down the slippery
slope... IMO, that's an argument against Markdown...
I hope that's good enough. If it's not -- if we believe that ultimately it
will be necessary to add additional extensions -- then I think we ought to
consider reStructuredText instead.
http://en.wikipedia.org/wiki/ReStructuredText
>From a high level, the syntactical differences between reStructuredText and
extended Markdown are IMO superficial and the feature sets are similar -- but
reStructuredText has a canonical spec which has been stable for 10 years.
reStructuredText is like extended Markdown, minus the bikeshedding and the
resentment towards the original author.
> I prefer definition lists to bulleted lists, myself.
Fortunately, the choice of whether we expand @param tags to bullet-lists or
definition-lists is an implementation detail which is separate from whether we
support lightweight markup within comments. Let's leave this topic for
another day.
> Well, MultiMarkdown is pretty well accepted as the #2 definition. Most
> implementations follow its examples (FBOFW).
I'm skeptical. From what I can tell, "GitHub Flavored Markdown" -- a
particularly destructive variant given how incompatible it is with the
original Markdown spec -- looks like a significant competitor.
And here's what happened when someone tried to assert the dominance of
MultiMarkdown on the markdown-discuss list last October:
http://six.pairlist.net/pipermail/markdown-discuss/2011-October/002342.html
> pandoc assessed 'em all, and decided on multimarkdown.
Huh? No. Pandoc's markdown extensions aren't the same as mmd's. I have
explained in earlier posts why I don't like mmd's table and metadata
syntax. Pandoc goes back to 2005 and was not influenced by mmd.
Adjudicating internet popularity contests is tiresome. :P
> Note that Sundown supports quite a lot more than just vanilla Markdown. How
> would you enforce that?
It looks like you have to enable syntax extensions manually in Sundown -- so
we "enforce" vanilla Markdown simply by not enabling those extensions.
However, I'm concerned that choosing Sundown may set us up for failure because
it means that we'll have this argument again later with someone who is
*outraged* to discover that we've got their pet Markdown extension disabled.
That's why I would like to determine whether we have consensus about forgoing
additional Markdown extensions. If we don't have consensus, we should
evaluate reStructuredText.
Marvin Humphrey
[1] http://six.pairlist.net/pipermail/markdown-discuss/2008-March/001163.html
http://www.codinghorror.com/blog/2009/12/responsible-open-source-code-parenting.html
Re: [lucy-dev] Markdown for documentation
Posted by "David E. Wheeler" <da...@justatheory.com>.
On May 13, 2012, at 2:44 PM, Marvin Humphrey wrote:
> On Sat, May 12, 2012 at 10:01 PM, David E. Wheeler
> <da...@justatheory.com> wrote:
>> The one complaint I have about Sundown is its lack of support for definition lists.
>>
>> https://github.com/tanoku/sundown/issues/10
>>
>> This is especially important, I find, for documenting lists of parameters
>> for methods. Definition lists are perfect for this. POD does that, too, with
>> the `=item text` syntax.
>
> We don't use `=item text` in Lucy's POD for parameter lists, though. I hate
> the fact that perldoc doesn't indent the label text, even if you use
> `=over 8`.
It indents the definition text. Example from DBIx::Connector:
> Constructs and returns a DBIx::Connector object. The supported
> arguments are exactly the same as those supported by the DBI. Default
> values for those parameters vary from the DBI as follows:
>
> "RaiseError"
> Defaults to true if unspecified, and if "HandleError" is
> unspecified. Use of the "RaiseError" attribute, or a "HandleError"
> attribute that always throws exceptions (such as that provided by
> Exception::Class::DBI), is required for the exception‐handling
> functionality of "run()", "txn()", and "svp()" to work properly.
> Their explicit use is therefor recommended if for proper error
> handling with these execution methods.
>
> "AutoInactiveDestroy"
> Added in DBI 1.613. Defaults to true if unspecified. This is
> important for safe disconnects across forking processes.
I think this is great, because I can scan the definition labels quickly to find what I want.
If you mean HTML, that's nothing to do with Pod. It's a CSS issue.
> Here are the two approaches contrasted:
>
> http://search.cpan.org/~dwheeler/Text-Markup-0.17/lib/Text/Markup.pm#new
> http://search.cpan.org/~logie/Lucy-0.3.1/lib/Lucy/Search/IndexSearcher.pod#hits%28_[labeled_params]_%29
>
> I like your use of C<param_name> as opposed to our B<param_name>! We should
> switch to that.
I prefer definition lists to bulleted lists, myself. You might need to use B<C<>> to make the labels stand out in a bulleted list, so they are easier to scan.
>> But Sundown does not. At least, not yet. Maybe
>> you'd want to add it? Last time I asked tanoku about it, he said that the
>> PHP Markdown syntax is terrible to parse.
>
> Here's the thing. There's only one Markdown specification: Gruber's original.
> Then there are a zillion different implementations which extend Markdown
> in incompatible ways.
Well, MultiMarkdown is pretty well accepted as the #2 definition. Most implementations follow its examples (FBOFW).
> If this was only for our own internal use, it wouldn't matter. But we're
> defining a public API: the syntax for Clownfish documentation. IMO, the only
> sane approach is to lock the API to the unchanging vanilla Markdown spec,
> rather than to the shifting implementation details of what happens to be
> supported by one particular library.
MultiMarkdown is pretty stable. Note that Sundown supports quite a lot more than just vanilla Markdown. How would you enforce that?
> (I hope Sundown can be persuaded to support vanilla Markdown rather than
> Github-flavored Markdown.)
I expect they would accept a patch.
>> * [peg-multimarkdown](https://github.com/fletcher/peg-multimarkdown). But
>> that's just too bloody big, isn't it?
>
> The size isn't outrageous, and it looks portable -- but the build seems to be
> fairly complex. It would take an unknown amount of work to integrate it.
Yeah, I thought it was too much to bother with.
>> * [upskirt](http://fossil.instinctive.eu/libupskirt/index). From which
>> Sundown was forked. Bare-bones parser-only implementation. Might require
>> more work to use, I don't know.
>
> I'm a little concerned about ongoing maintenance.
>
> http://fossil.instinctive.eu/libupskirt/wiki?name=about-the-name
>
> The whole github-triggered curse has been extremely painful for me. It's by
> far the worst coding-related experience I ever went through. That made me
> retire from Open Source.
>
> However I still feel a sense of duty, to fix whatever bugs it might contain,
> and occasionally going through the process of releasing a batch of
> fixes in a
> new version. Even for 1 user (myself excluded this time) I feel can't just
> leave like that. I feel responsible for maintaining the code base as long as
> it's used somewhere by someone.
>
> However I don't know yet how long the sense of duty will stand against the
> increasingly strong disgust for whole thing.
>
> However, even abandoned code might be OK for us, since this is for use by CFC
> rather than Lucy, and the needs of a compiler vis a vis security maintenance
> are vastly less than for a web-facing library.
Yeah, and you could fork it if you wanted.
David
Re: [lucy-dev] Markdown for documentation
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Sat, May 12, 2012 at 10:01 PM, David E. Wheeler
<da...@justatheory.com> wrote:
> The one complaint I have about Sundown is its lack of support for definition lists.
>
> https://github.com/tanoku/sundown/issues/10
>
> This is especially important, I find, for documenting lists of parameters
> for methods. Definition lists are perfect for this. POD does that, too, with
> the `=item text` syntax.
We don't use `=item text` in Lucy's POD for parameter lists, though. I hate
the fact that perldoc doesn't indent the label text, even if you use
`=over 8`.
Here are the two approaches contrasted:
http://search.cpan.org/~dwheeler/Text-Markup-0.17/lib/Text/Markup.pm#new
http://search.cpan.org/~logie/Lucy-0.3.1/lib/Lucy/Search/IndexSearcher.pod#hits%28_[labeled_params]_%29
I like your use of C<param_name> as opposed to our B<param_name>! We should
switch to that.
So... in vanilla Markdown, we can use bullet lists in conjunction with
backticks -- and thus I don't believe that definition lists are required.
* `foo` - A Foo.
* `bar` - A Bar.
> But Sundown does not. At least, not yet. Maybe
> you'd want to add it? Last time I asked tanoku about it, he said that the
> PHP Markdown syntax is terrible to parse.
Here's the thing. There's only one Markdown specification: Gruber's original.
Then there are a zillion different implementations which extend Markdown
in incompatible ways.
If this was only for our own internal use, it wouldn't matter. But we're
defining a public API: the syntax for Clownfish documentation. IMO, the only
sane approach is to lock the API to the unchanging vanilla Markdown spec,
rather than to the shifting implementation details of what happens to be
supported by one particular library.
(I hope Sundown can be persuaded to support vanilla Markdown rather than
Github-flavored Markdown.)
> * [Discount](http://www.pell.portland.or.us/~orc/Code/discount/). BSD
> license. Fast, but kind of weird, both in its additional syntax (definition
> lists are kind of ugly) and in its interface.
Looks like Discount is Unix-only. :(
> * [peg-multimarkdown](https://github.com/fletcher/peg-multimarkdown). But
> that's just too bloody big, isn't it?
The size isn't outrageous, and it looks portable -- but the build seems to be
fairly complex. It would take an unknown amount of work to integrate it.
> * [upskirt](http://fossil.instinctive.eu/libupskirt/index). From which
> Sundown was forked. Bare-bones parser-only implementation. Might require
> more work to use, I don't know.
I'm a little concerned about ongoing maintenance.
http://fossil.instinctive.eu/libupskirt/wiki?name=about-the-name
The whole github-triggered curse has been extremely painful for me. It's by
far the worst coding-related experience I ever went through. That made me
retire from Open Source.
However I still feel a sense of duty, to fix whatever bugs it might contain,
and occasionally going through the process of releasing a batch of
fixes in a
new version. Even for 1 user (myself excluded this time) I feel can't just
leave like that. I feel responsible for maintaining the code base as long as
it's used somewhere by someone.
However I don't know yet how long the sense of duty will stand against the
increasingly strong disgust for whole thing.
However, even abandoned code might be OK for us, since this is for use by CFC
rather than Lucy, and the needs of a compiler vis a vis security maintenance
are vastly less than for a web-facing library.
Marvin Humphrey
Re: [lucy-dev] Markdown for documentation
Posted by "David E. Wheeler" <da...@justatheory.com>.
On May 12, 2012, at 5:06 PM, Marvin Humphrey wrote:
> Conceptually, the option I find most attractive is integrating Markdown
> with Javadoc-style @tags, which has been done more than once:
+1. Love Markdown, warts and all.
> Instead, I think it might make sense to work with the C library Sundown:
>
> https://github.com/tanoku/sundown
>
> At first look, Sundown seems appropriate as a dependency for us:
> cross-platform, no configuration, just a handful of .c and .h files.
>
> Here's an approach I hope will work well:
>
> 1. Extract comment text from .cfh file.
> 2. Remove C comment artifacts and make content flush left.
> 3. Preprocess select @tags, converting them into an intermediate
> Markdown format. At this point, the transformation of the original
> comment into pure Markdown is complete.
> 4. Parse intermediate Markdown with Sundown.
> 5. Use Sundown plus custom plugins to render content in host-specific
> output formats, e.g. POD, Rdoc.
>
> Committing to Markdown as Clownfish's documentation language also gives us
> the option of writing docs as pure .mdtext files.
>
> Thoughts?
The one complaint I have about Sundown is its lack of support for definition lists.
https://github.com/tanoku/sundown/issues/10
This is especially important, I find, for documenting lists of parameters for methods. Definition lists are perfect for this. POD does that, too, with the `=item text` syntax. But Sundown does not. At least, not yet. Maybe you'd want to add it? Last time I asked tanoku about it, he said that the PHP Markdown syntax is terrible to parse.
https://twitter.com/tanoku/status/197424671887589376
Anyway, just something to be aware of. Other possibilities:
* [Discount](http://www.pell.portland.or.us/~orc/Code/discount/). BSD license. Fast, but kind of weird, both in its additional syntax (definition lists are kind of ugly) and in its interface.
* [peg-multimarkdown](https://github.com/fletcher/peg-multimarkdown). But that's just too bloody big, isn't it?
* [upskirt](http://fossil.instinctive.eu/libupskirt/index). From which Sundown was forked. Bare-bones parser-only implementation. Might require more work to use, I don't know.
Anyway, Sundown seems decent overall, so it might be the best choice, though I think upskirt at least deserves a look.
Best,
David