Dear @waylan ,
my apologies for guerilla-restating my question. It’s likely that I have not expressed myself clearly which led you to closing and locking #545
I asked two questions, but perhaps I didn’t explain them sufficiently clearly. Please allow me to rephrase them for clarity. If you still consider this outside of your interests, and close this issue, I won’t raise it any further. I’m not interested in trolling.
I am interested in Markdown (not CommonMark or any other younger siblings). I’m not advocating to change the parsing behavior of PyMarkdown’s input format at all.
On the contrary: I think Markdown (as it is, fully disregarding its “siblings” etc.) is so useful that I’d like to keep it as a writing, editing and archiving format for as long and possible.
Which is why I wonder if you think it’d be reasonable to allow Markdown as an output format of PyMarkdown, in addition to the HTML variants.
John Gruber writes:
Markdown’s syntax is intended for one purpose: to be used as a format for writing for the web.
Markdown is not a replacement for HTML (...) The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a publishing format; Markdown is a writing format. Thus, Markdown’s formatting syntax only addresses issues that can be conveyed in plain text.
John made an excellent point there, and to me, the great value of Markdown is the ease of read, write and edit. Yes, Markdown does allow portions of HTML, but to me, Markdown is not really about HTML. It’s about authoring. The fact that in the end, people may want to convert it into HTML, is, in my view, secondary.
Output: Preprocessed Markdown
You write:
Preprocessors munge the source text before it is passed into the Markdown core. This is an excellent place to clean up bad syntax (...)
I discovered today that it’s trivial to use PyMarkdown to convert, let’s call it, my “markdownish input” into “proper Markdown” — by just using the preprocessors like this:
def getPreprocessedMarkdown(md_text, md_opts):
md = markdown.Markdown(**md_opts)
md.convert(md_text)
return u"\n".join(md.lines)
This, in a way, simulates the output_format = "markdown" behavior I was asking about. It just runs the preprocessors and gives me a “better” Markdown back — specifically because I want to use Markdown as a writing format and keep its clean form even if my preprocessing extensions allow me to bend the spec in the input.
Output: Pure Markdown
The PyMarkdown extensions system is truly fantastic, and it’s very productive in a controlled environment, but when used extensively, it can actually take the documents further away from John Gruber’s original syntax. Many PyMarkdown extensions add more “plain-text-style” syntax constructs, but this comes at a cost of making the Markdown documents less portable. And I’m looking for ways to make them more portable, or, closer to the original Markdown.
So I wonder if you’d think it’d be possible to have PyMarkdown work so that it takes as input a “markdownish document using custom extensions” document, and outputs a “pure Markdown” (“pure” by John Gruber’s original implementation standards, or as close to it as possible).
In other words, I’d like to turn “unportable Markdown-like syntax” into “portable Markdown” which then would not require extensions to compile, and could perhaps at a later stage compile even in the original markdown.pl (or at least with “extension-less PyMarkdown”).
In other words, all constructs that are provided by custom extensions would then be replaced by HTML, but the “core” Markdown constructs would be kept intact.
In my opinion, such behavior could bring the functionality of PyMarkdown closer to the spirit of John Gruber’s original Markdown spec.
I’m not informed enough if this is possible to do with PyMarkdown with little work, or would require significant changes. If the latter is the case, I don’t think I’d advocate doing it — because perhaps the use-case I’m thinking of is too limited.
Anyhow — I just wanted to ask my questions in a more clear way. If you still prefer not to discuss this any further or think this is indeed a duplicate of #338 , please feel free to close and lock this issue, and I’ll be no longer asking along these lines.
Many thanks,
Adam
Dear @waylan ,
my apologies for guerilla-restating my question. It’s likely that I have not expressed myself clearly which led you to closing and locking #545
I asked two questions, but perhaps I didn’t explain them sufficiently clearly. Please allow me to rephrase them for clarity. If you still consider this outside of your interests, and close this issue, I won’t raise it any further. I’m not interested in trolling.
I am interested in Markdown (not CommonMark or any other younger siblings). I’m not advocating to change the parsing behavior of PyMarkdown’s input format at all.
On the contrary: I think Markdown (as it is, fully disregarding its “siblings” etc.) is so useful that I’d like to keep it as a writing, editing and archiving format for as long and possible.
Which is why I wonder if you think it’d be reasonable to allow Markdown as an output format of PyMarkdown, in addition to the HTML variants.
John Gruber writes:
John made an excellent point there, and to me, the great value of Markdown is the ease of read, write and edit. Yes, Markdown does allow portions of HTML, but to me, Markdown is not really about HTML. It’s about authoring. The fact that in the end, people may want to convert it into HTML, is, in my view, secondary.
Output: Preprocessed Markdown
You write:
I discovered today that it’s trivial to use PyMarkdown to convert, let’s call it, my “markdownish input” into “proper Markdown” — by just using the preprocessors like this:
This, in a way, simulates the
output_format = "markdown"behavior I was asking about. It just runs the preprocessors and gives me a “better” Markdown back — specifically because I want to use Markdown as a writing format and keep its clean form even if my preprocessing extensions allow me to bend the spec in the input.Output: Pure Markdown
The PyMarkdown extensions system is truly fantastic, and it’s very productive in a controlled environment, but when used extensively, it can actually take the documents further away from John Gruber’s original syntax. Many PyMarkdown extensions add more “plain-text-style” syntax constructs, but this comes at a cost of making the Markdown documents less portable. And I’m looking for ways to make them more portable, or, closer to the original Markdown.
So I wonder if you’d think it’d be possible to have PyMarkdown work so that it takes as input a “markdownish document using custom extensions” document, and outputs a “pure Markdown” (“pure” by John Gruber’s original implementation standards, or as close to it as possible).
In other words, I’d like to turn “unportable Markdown-like syntax” into “portable Markdown” which then would not require extensions to compile, and could perhaps at a later stage compile even in the original
markdown.pl(or at least with “extension-less PyMarkdown”).In other words, all constructs that are provided by custom extensions would then be replaced by HTML, but the “core” Markdown constructs would be kept intact.
In my opinion, such behavior could bring the functionality of PyMarkdown closer to the spirit of John Gruber’s original Markdown spec.
I’m not informed enough if this is possible to do with PyMarkdown with little work, or would require significant changes. If the latter is the case, I don’t think I’d advocate doing it — because perhaps the use-case I’m thinking of is too limited.
Anyhow — I just wanted to ask my questions in a more clear way. If you still prefer not to discuss this any further or think this is indeed a duplicate of #338 , please feel free to close and lock this issue, and I’ll be no longer asking along these lines.
Many thanks,
Adam