Re: It's a Markdown processor, right?

Andrei Fangli andrei_fangli at hotmail.com
Sun Sep 7 10:08:40 EDT 2014


Parsing is all about syntactic analysis, a parser may well just return true and false depending on whether the input is syntactically correct or not.


I’m not very comfortable about calling them libraries if they are actually executables or scripts. They are either one of them but not both. Like you pointed out, a _Markdown_ library consists of a parser and one or more formatters (bare in mind that formatters are responsible for transforming/translating something from internal memory, an instance, into a format that can be physically stored on external memory, hdd, and later retrieved (e.g.: formatting an instance to XML and later reconstructing the instance from that same XML, just like one would save a word document to a .docx file and later “opening” it to continue writing the same document)). Eventually the library will allow the user to write his own formatters (e.g.: your library has a html formatter but I want to save as pdf, I need a way to extend your library in my application to write my own pdf formatter without writing the parser all over again).


Now the application/script that gets shipped with the library to make use of it from the command line is something apart from the library itself like you pointed out. How will this application/script be called since it can’t be parser or formatter? It does both things in a very specific order. I’m still willing to call it a translator because it takes file A and translates it to file B under a different format. The shipped application/script is nothing more than an _application_ to the Markdown library and if it’s open sourced it can serve as a tutorial for “here’s how you use this library”.


A library must primarily expose an interface and one or more dlls that can be referenced and consumed. If it’s just an exe that does all the work then I’m hesitant to calling it a library. I know that CLI Assemblies are either .dll or .exe and both can act as libraries but the primary intent of an .exe is to be executed and maybe referenced not the other way around.






Andrei Fangli





From: Waylan Limberg
Sent: ‎Sunday‎, ‎7‎ ‎September‎ ‎2014 ‎17‎:‎06
To: markdown-discuss at six.pairlist.net





Actually, on rereading my previous response, a realized that I also referred to it as a "library" (see http://en.m.wikipedia.org/wiki/Library_(computing)) which most (all?) markdown parsers are. So a "markdown editor" (a GUI app like MarkdownPad) would make calls to a "markdown library" to covert the markdown text typed by the user to HTML.




Strictly speaking, a library would generally consist of a "parser" and a "formatter". The parser parses the text ( identifies the different parts) and a formatter coverts those parts (the parse tree) into the final format. Therefore some libraries (like Pandoc) have multiple formatters, whereas others (most) only have one. Given the lack of choice of formatters, most people forget about the formatter part of the process. Thus the common nomenclature used is often "parser".




To add additional confusion most libraries also ship with a command line script which wraps the underlying library. That script usually defaults to parsing Markdown text and outputting HTML. So most people (perhaps incorrectly) think of that wrapping script as the final product and refer to the whole thing as the "parser".




So I would say that "library" is probably the technically correct term, but the generally accepted (and most widely understood) term is "parser".


Waylan Limberg


On Sep 7, 2014, at 9:39 AM, Waylan Limberg <waylan.limberg at icloud.com> wrote:





I would have to agree with Andrei mostly. Those of us that have implemented markdown libraries generally refer to them as implementations of a **parser**. "Processor" or "translator" are not words I've ever seen used.

Waylan Limberg


On Sep 7, 2014, at 3:50 AM, Andrei Fangli <andrei_fangli at hotmail.com> wrote:





Hi,




I think not. When I hear Markdown processor I think of a specialized word/text processor (see http://en.wikipedia.org/wiki/Word_processor) which is more an application that helps you write stuff and print it, eventually export it to html. If you were to write an application that helps you write documents (e.g.: insert list, quote etc. via buttons/commands) and use Markdown as the underlying format would be a Markdown processor. If you would write an application that translates a Markdown document to html, that would be a Markdown translator and the whole process would be called translation (or Markdown to Html Translation). See http://en.wikipedia.org/wiki/Translation.




For me, Markdown implementation sounds a bit odd. Markdown is not standardized nor is its specification clear enough to draw a deterministic procedure for translating Markdown into html (or an Abstract Syntax Tree). You cannot say that there are multiple Markdown implementations if they do not yield the same output for any given input (if you would then I could swap implementations however I wish and get the same result).




I’d simply name the specification (or flavour) and append “Translator” at the end (e.g.: Github flavoured Markdown Translator, Common Markdown Translator etc.). That way it’s all clear what specification is used and what the intent of the application is. The real working horse behind a translator is a parser, once you have that you can pretty much do anything else. Saying that you have a Markdown parser is almost the same as saying that you have a Markdown translator, the remaining effort is close to a days work if you want to make it really fancy.





Andrei Fangli





From: Sean Leonard
Sent: ‎Sunday‎, ‎7‎ ‎September‎ ‎2014 ‎02‎:‎55
To: markdown-discuss at six.pairlist.net





Hello Markdown World,

Last month draft-seantek-text-markdown-media-type was adopted by the 
IETF Apps Area Working Group (APPSAWG). I am working on revising it.

I am trying to use uniform terms. An implementation that converts 
Markdown content to another format--most typically HTML--is called...a 
Markdown processor, right?

I have been using the term "Markdown processor". Just want to see if 
there is substantial disagreement about using that term to refer to the 
collective set of Markdown implementations out there.

Thanks,

Sean

PS I suppose it could also be called a "Markdown implementation". But 
I'm going to stick to my original nomenclature in the absence of a push 
for something else. For instance, graphical tools such as [MarkdownPad] 
may be implementations of Markdown, but they are not processors. 
MarkdownPad is a Markdown editor, that has built-in support for various 
Markdown processors (such as a GitHub Flavored Markdown processor, and a 
Markdown Extra processor).

[MarkdownPad]: http://markdownpad.com/

_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss at six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss



_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss at six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss



_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss at six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20140907/4309ef28/attachment-0001.html>
-------------- next part --------------
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss at six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss


More information about the Markdown-Discuss mailing list