TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Djot: A light markup language by the creator of Pandoc and CommonMark

276 pointsby eevilspockover 2 years ago

18 comments

gravypodover 2 years ago
(Opinions are my own)<p>I like the ideas behind this but I do not think this will take off as much as CommonMark has. My main reasons for thinking this:<p>1. Users don&#x27;t really care about edge cases. CommonMark (cmark-gfm really) is &quot;good enough&quot;. If something looks odd people go &quot;oh, strange&quot; and make a 3 second edit and forget about it.<p>2. There&#x27;s already multiple parsers for every language for markdown. Here there is a single Lua implementation.<p>3. GitHub is the king.<p>If it cannot render in GitHub it&#x27;s not real. If it&#x27;s harder for me to write in the 99% case then it&#x27;s not worth it. If it&#x27;s harder for me to implement within my application then I&#x27;m too lazy to switch.<p>Nice things in here:<p>1. Less ambiguous parsing. For the parser infrastructure I support at $JOB this makes supporting questions from users a HUGE pain in the ass.<p>2. AST-first design. Seems like everything appears in the AST (even references!) which is a huge win over cmark-gfm. There&#x27;s also source positions included which is a MASSIVE win for tooling.<p>3. Custom Attributes implementation. This is really nice for extensibility. It is less readable but having it as an option is nice.
评论 #33876324 未加载
评论 #33874744 未加载
评论 #33879457 未加载
评论 #33877292 未加载
评论 #33876328 未加载
评论 #33876332 未加载
评论 #33876788 未加载
评论 #33874612 未加载
评论 #33875304 未加载
dschuesslerover 2 years ago
I recently found out that the author is John MacFarlane, a philosophy professor I have read papers from in totally unrelated contexts. I was more than surprised to see that he is the original author of pandoc. It boggles my mind how someone with an academic career in a somewhat unrelated field can have a GitHub profile like him. It&#x27;s really impressive.<p>On topic, though, preceding sublists with empty lines is a complete non-starter for me. However, since I don&#x27;t hard-wrap lines (goal 7), but use soft-wrap only, I am not in the target audience anyways.
评论 #33874620 未加载
评论 #33873360 未加载
评论 #33879593 未加载
评论 #33872988 未加载
评论 #33872191 未加载
adlpzover 2 years ago
I understand the rationale and how CommonMark parsing is not trivial and could be simplified, but the resulting language misses, for me, the best part of Markdown: that it happens to be <i>pretty much</i> just what I&#x27;d write in plain text anyways.<p>The odd newline requirements on lists and blocks, the special syntax for raw HTML and so on makes Djot feel more artificial to me.
评论 #33871439 未加载
评论 #33871415 未加载
评论 #33873053 未加载
评论 #33871408 未加载
评论 #33874226 未加载
civopsecover 2 years ago
&gt; In djot, we just get rid of indented code blocks. Most people prefer fenced code blocks anyway, and we don&#x27;t need two different ways of writing code blocks (goal 11).<p>Sensible. Mostly since it makes other things easier (goal 5), second because one thing is only represented in one way, and thirdly (least important) since indented code blocks are kind of a pain to format compared to fenced code blocks.
评论 #33894378 未加载
eslaughtover 2 years ago
So this is what happened to the energy that had been going into CommonMark. I&#x27;d been wondering, because the spec releases for CommonMark have been slowing down for quite a while [1], and it felt like certain issues just never saw attention [2]. I&#x27;m glad that energy didn&#x27;t just dissipate and actually went into something useful.<p>On a practical level, nearly everything this does is better served by Pandoc Markdown today. But maybe in some not-so-distant future I&#x27;ll be able to make use of this.<p>[1]: <a href="https:&#x2F;&#x2F;spec.commonmark.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;spec.commonmark.org&#x2F;</a><p>[2]: <a href="https:&#x2F;&#x2F;talk.commonmark.org&#x2F;t&#x2F;issues-we-must-resolve-before-1-0-release-6-remaining&#x2F;1287" rel="nofollow">https:&#x2F;&#x2F;talk.commonmark.org&#x2F;t&#x2F;issues-we-must-resolve-before-...</a>
lynx23over 2 years ago
This looks pretty intersting. Besides, I find it fascinating how jgm apparently is happy on both sides of the &quot;typed language&quot; spectrum. pandoc in Haskell, and djot in Lua. True, pandoc has acquired a lot of Lua in the recent years, but still. I wonder how it feels switching from the cozy safety of a language like Haskell, back to the &quot;good old&quot; interpreter days. I personally have dropped writing anything larger then 1k lines in a dynamic language. Have been bitten by my own inconsistencies too much in the past.<p>I wonder what someone like jgm has to say about the difference of writing Haskell and Lua.
评论 #33876618 未加载
评论 #33876418 未加载
评论 #33901747 未加载
miklover 2 years ago
Given the ubiquity of Markdown, and how painful it is to build a completely compliant parser, I really hope Djot (or something like it) would take off.<p>Shame that the creator of Markdown blocks any efforts to to fix or standardise the format.
评论 #33871810 未加载
w10-1over 2 years ago
Most excellent!<p>If Github supported it alongside markdown, this would drive the markdown parsers to support this as a flavor, and then the community could decide; it will be fascinating to analyze the open-source population.<p>I&#x27;m finding dozens of applications for a lingua franca of mildly-structured, human-readable language that transforms as easily into data as documents and UI&#x27;s. I&#x27;ve built out 10+ markdown applications using 3-4 parsers, and always had to reduce the effective semantics to a small subset of features, and then had to use metadata or convention to do what attributes will do much more cleanly.<p>As for Lua: yes it&#x27;s the best for integrating into pandoc <i>performance-wise</i>, but ay! the table structures and metadata tables to get anything like typing are mind bending, and I am still miffed at being blocked at a critical time by a bug in pandoc&#x27;s lua initializer for tables.<p>Aside language&#x2F;stdlib developers, jgm is my greatest benefactor, and he deserves a cadre of loyal and competent implementors.
toshover 2 years ago
Related: &quot;Beyond Markdown&quot; <a href="https:&#x2F;&#x2F;johnmacfarlane.net&#x2F;beyond-markdown.html" rel="nofollow">https:&#x2F;&#x2F;johnmacfarlane.net&#x2F;beyond-markdown.html</a>
tontoover 2 years ago
look forward to having standardized e.g. &quot;figure captions&quot;, looks like it&#x27;s being worked out here <a href="https:&#x2F;&#x2F;github.com&#x2F;jgm&#x2F;djot&#x2F;issues&#x2F;28" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jgm&#x2F;djot&#x2F;issues&#x2F;28</a><p>pandoc is interesting because with markdown it currently converts the &quot;alt text&quot; for figures ![alttexthere](img.jpg) in markdown-&gt;pdf conversion into the figure captions, which is cool but makes me think: it is not alt anymore, anyone should have it
0xbadcafebeeover 2 years ago
I never realized the problem with markup until that phrase &quot;light markup&quot;. The problem is that it&#x27;s designed for a human to edit it by hand with a text editor. It&#x27;s a programmer designing for a programmer, rather than for a user. It&#x27;s a plumber designing a sink. A mechanic designing a radio. A busboy designing tableware.<p>What we should have instead of markup, is a WYSIWYG with keyboard shortcuts. Confluence, for example, will convert Markdown into rich text in real time, and has keyboard shortcuts for its other layout&#x2F;style options. But the point is to edit it in a GUI, see your changes live, and not need to learn a language in order to edit a document. There are so many problems you avoid by giving the user tools to make their life easier. Markup may be one tiny part of that, but it shouldn&#x27;t be considered the complete solution.
评论 #33874605 未加载
评论 #33874899 未加载
评论 #33872916 未加载
评论 #33873234 未加载
评论 #33872900 未加载
Cyberdogover 2 years ago
As someone who&#x27;s been using Markdown since before it was cool, I love it! I think writing the implementation in Lua is an interesting take since Lua out-of-the-box does not support standard regular expressions; it instead has its own pattern-matching thing which is a bit more limited. But it looks like they&#x27;ve embraced that limitation to force themselves to write something that doesn&#x27;t need a full regex library to be sanely parsed.<p>My biggest complaint is that asterisks map to &lt;strong&gt; and underscores map to &lt;em&gt; (in HTML terms). This is not backwards-compatible with Markdown where (asterisk)foo(asterisk) gets you &lt;em&gt;foo&lt;&#x2F;em&gt;, and it feels objectively backwards, if that makes sense. I wonder if there&#x27;s any chance they could reverse that.
评论 #33873389 未加载
gernbover 2 years ago
The odds of replacing markdown and all it&#x27;s issues seem nearly impossible given its ubiquity and I&#x27;ve run into many of those problems but, this seems just as arbitrary in many ways,<p>For example:<p>&gt; Block-level elements can&#x27;t interrupt paragraphs (or headings), because of goal 7<p>It then goes on to show they do interrupt paragraphs<p><pre><code> - this then - this other thing </code></pre> vs<p><pre><code> - this then - this other thing </code></pre> The 2nd is 2 list items but it&#x27;s just the first with being interrupted by a block-level element.
评论 #33871632 未加载
solarkraftover 2 years ago
HTML is quite good at what it was invented for. Why is it so out of fashion?
评论 #33872312 未加载
评论 #33872859 未加载
评论 #33872159 未加载
howenterpriseyover 2 years ago
Love it, will see how many places I can get this introduced. The things that pissed the author of this off are precisely the things that piss me off. Unconcerned with the newlines in list syntax; that&#x27;s how I&#x27;d write them myself, anyway. I like many things about this, including the various uses of curly braces.
__tmk__over 2 years ago
Wow, this is all I ever wanted. The only thing that&#x27;s maybe missing is a natural way to do captions for images and tables, and a syntax for spoilers. But these can probably be built on top of the div and span syntax.
joemaller1over 2 years ago
How do you say it?
评论 #33872898 未加载
评论 #33872726 未加载
deafpolygonover 2 years ago
After doing Markdown for a while... and discovering Org. I&#x27;ll keep Org. Thanks.