tlienart / Franklin.jl

(yet another) static site generator. Simple, customisable, fast, maths with KaTeX, code evaluation, optional pre-rendering, in Julia.
https://franklinjl.org
MIT License
963 stars 114 forks source link

Compatibility with standard Markdown: a more serious look #204

Closed tlienart closed 5 years ago

tlienart commented 5 years ago

Ultimately, JuDoc uses Julia's Markdown to HTML conversion; this is mostly fine for "standard" things like basic text formatting, adding paragraphs, etc. Now after #201 it seems a more serious look would be required so that people who are used to "standard Markdown" as used with Jekyll or other popular engines don't get too surprised.

This issue is to list things that should be checked/tested/accomodated and will link to sub-issues for specific problems. It might take some time to fix/accomodate/document everything so probably a good idea to keep track of things in one place.

Markdown specs refs

High-priority

Low(er)-priority

Quirks / brainstorm

cormullion commented 5 years ago

What do you make of this type of link? (from Jeff & Co's blog post)

The [free lunch][] from Moore's Law is still over.

[free lunch]: http://www.gotw.ca/publications/concurrency-ddj.htm

Not sure whether Julia Markdown does these reference links...

tlienart commented 5 years ago

Yes I guess these would be part of what I call "indirect links", it seems that either

The [free lunch] from ...
...
[free lunch]: http://...

or

The [free lunch][] from ...
...
[free lunch]: http://...

are used; the former is used in Stefan's piping one and the latter in the post you quote, so I guess I'll have too find both ;-)

(that's not too hard though, but yeah I'm slowly using less and less of Julia's markdown parser and more and more of a handcrafted one 🙈 )

cormullion commented 5 years ago

Good stuff!. Could any of these changes be introduced into the Julia Markdown parser - making it more standard-compliant (if that's the right word to be used in a sentence about Markdown)?

tlienart commented 5 years ago

yeah I guess ultimately that makes sense though it's a bit tricky since in base there are multiple "flavours" (GitHub, Julia, ...); I guess the "Julia" one could be extended to match a bit more of Gruber's specs. But when I feel like I've satisfied the Markdown gods and have a good understanding of what's missing etc, then I may make suggestions to the mother ship

tlienart commented 5 years ago

@cormullion the different ways for "indirect" links definitions are now supported in PR #214 (I need to think a bit and test it a bit more before merging but it should be close to good to go). It's a bit trickier than what I initially thought actually for a simple reason: Judoc effectively slices the document into smaller blocks it can process very rapidly and then pieces everything back together.

But here, the link definition could be anywhere in the document; so this needs to be done after the piecing-back-together; as a result my solution is not very elegant (it's done after the HTML is generated); by the way I also had to resort to similar trickery to handle "latex-like" bibliographies; it works well but it's a bit ugly.

All this being said, issues about markdown syntax have been opened in Julia base (see links in the post at the top); I'll be glad to try to help there once I've better understood how Julia's Markdown parser works but solving it there would not solve it here for the reason mentioned above 🙂

tlienart commented 5 years ago

with #217, it's the (temporary?) end of this; one day I'll muster the courage to read through the commonmark specs and see what fun edge cases are still lurking.

I'll close this now and will report once I've tried to use JuDoc with JuliaBlog posts as per #201 in that issue.