Live data from Hacker News

If it is worth keeping, save it in Markdown

p.migdal.pl

241–250 of 282 posts

Re: If it is worth keeping, save it in Markdown

#241

Earlier quoted context omitted.

> [Markdown] struggles with things like embedded content and non-standard layouts. I don't share that experience. I typeset all these documents using Markdown with pandoc's div extension, transformed into XHTML, and then passed to ConTeXt: * https://impacts.to/downloads/lowres/impacts.pdf * https://dave.autonoma.ca/blog/2020/04/28/typesetting-markdow... * https://pdfhost.io/v/4FeAGGasj_SepiSolar_Highlevel_Software_..…

Those are all PDFs. Why, if Markdown is so great?

Not OP but I've done similar work myself.

Alternatives for authoring PDFs include LaTeX or similar markup languages, or GUI-based tools.

For many works, Markdown is more than sufficient for producing book-length texts (I've done this numerous times myself, either authoring my own works or transcribing/modifying books for improved access/readability). Markdown's benefit is that it is extraordinarily lightweight, and removes overhead from the authoring process.

Even where one ultimately chooses to migrate from Markdown to some more capable authoring format, Markdown remains useful for creating the original rough form of the work. Complex elements (figures, formulae, tables, etc.) can be indicated and, after document conversion from, say Markdown to LaTeX, fleshed out in full.

With tools such as Pandoc (see my earlier comments on it), it's trivially possible to create multiple outputs (I usually refer to these as "endpoints") of a document. I've used Makefiles to drive this process, such that I write source in Markdown and generate partial or full HTML documents,[1] other LWMLs,[2] PDF, ePub, straight ASCII/UTF-8/Unicode text, word-processing formats, etc., as I want. The set of Markdown + Pandoc makes this trivial in ways that, say, LaTeX alone isn't entirely suited.[3]

It's of course possible to use another LWML as the source format. Markdown has its limitations, but is most widely known and implemented, and limitations workarounds are typically reasonable.

________________________________

Notes:

1. A partial HTML doc may be useful for dropping into a larger document, and doesn't require global HTML elements such as the , , tags, or others such as or in most cases.

2. Lightweight markup languages such as bbCode, AsciiDoc, RST, MediaWiki, OrgMode, etc., etc., see: https://en.wikipedia.org/wiki/Lightweight_markup_language>. Useful when inserting the document into systems based on these formats.

Re: If it is worth keeping, save it in Markdown

#242
post #156

Markdown is great, but not a panacea. Tables, in particular, just suck, especially if you want to have even slight formatting inside of the cells. Unfortunately, it’s either plain-text-readable or rich representation. Pick your poison.

The biggest problem with Markdown is the baffling lack of plain VIEWERS. Not editors with a preview pane, but straight-up viewers that render Markdown for reading. There are very, very few. I use Marked 2, for Mac. I don't even remember if I ever found another one. It's irritating as hell, because pretty much every open-source project's read-me files are in Markdown. Why, when there is no viewer anywhere near as ubiq…

Makefile-driven development. Run "make pdf" as needed (looped in a shell one-liner if you prefer, or driven by an event watcher). A decent PDF viewer will either reload the document automatically on change or can be readily reloaded. The Suckless PDF viewer zathura is among the former, I've also used, variously, xpdf (slightly grungy these days but an old reliable) or MacOS's Viewer app.

https://pwmt.org/projects/zathura/>

This lets you work on the doc in a terminal window and have the (reasonably constantly updated) formatted output in a PDF viewer.

Short documents will render virtually instantly. I've not had long renders until documents extend to at least several chapters worth of text if not book-length, and even then it's a matter of a few seconds in most cases. Highly-formatted texts may of course take longer.

Re: If it is worth keeping, save it in Markdown

#243

The killer app for markdown would be a collaborative editor that displays the raw markdown and formatted markdown side-by-side and makes both sides editable. Tech people can use `#` and `*` on one side for formatting, product people can use normal text-editor buttons like "header1", "italics", etc.

HackMD already does this. It has a dual-pane view for raw markdown and formatted output, supports WYSIWYG editing, and allows real-time collaboration. Surprised no one mentioned it.

- [HackMD: Your Collaborative Markdown Workspace for Knowledge Sharing](https://hackmd.io/)

Re: If it is worth keeping, save it in Markdown

#244

Earlier quoted context omitted.

> Why not HTML? Browsers have native basic WYSIWYG editing built in Can you point me to a page in Firefox that I can use offline to WYSIWYG edit a hypertext document without needing to use the developer console to edit raw HTML?

I believe it's technically possible, but I don't know if there's a tool. Btw, genuinely asking, what's your offline scenario? Long loong time ago, I used TiddlyWiki for a brief time period for my temp offline scenarios. Single local HTML, can edit, but not WYSIWYG.

> what's your offline scenario?

Keep my data out of corporate hands without needing to run a website myself (eg, a WYSIWYG site) while not having to use some different app.

Re: If it is worth keeping, save it in Markdown

#245

I've landed on a workflow that I like a lot, and have shown to several people on my team. I use Google Drive for Desktop, which maps the G:\ drive to Google Drive. From there, I use VS Code for Markdown editing. Google Docs now supports Markdown files, so if I need to convert the Markdown file to Word or PDF, I just open it in Docs and download it in the format I need. (Pandoc also works for this, as the author menti…

But why should you need to convert it? Why does no one call out the giant problem with Markdown: the lack of READERS?

People read documents, not formats.

Re: If it is worth keeping, save it in Markdown

#246

Earlier quoted context omitted.

Markdown is also missing: - Diagrams - Math - Any custom blocks - like Figures, algorithms, image boxes, etc - Numbered chapters / sections (Eg Chapter 1, Appendix A, etc). - Semantic references For readmes, thats fine I guess. But I miss all those features when I'm writing proper blog posts, articles and documentation. There are various hacky workarounds. But as soon as you start using bespoke markdown extensions, y…

Mermaid charts! Supported by github and very readable as plaintext https://github.blog/developer-skills/github/include-diagrams...

I put that in the "hacky workarounds" category.

Does it work at all? Yeah. Does it work in my markdown editor? Probably not. Does it work in my markdown renderer? I don't know. Which version of Mermaid does it work with? Probably a different version of mermaid on every platform. Can I save my mermaid diagram to a file and link it instead of inlining the mermaid diagram inline? Who knows. Flip a coin everywhere mermaid is supported.

I tried pushing a markdown renderer to the limits once - only to find out that the markdown renderer I was using doesn't correctly implement commonmark, and my markdown file breaks with every other markdown renderer I've tried it with. To say nothing of the custom extensions I tried to use.

At this stage I'd rather keep my markdown files simple, and use something better for real documents. Something like typst.

Re: If it is worth keeping, save it in Markdown

#247

Earlier quoted context omitted.

Parsing Markdown is downright everything-hostile. Computers and humans alike.

Markdown is an attempt to codify formatting conventions that were already long in use for newsgroups and email. It’s meant to be human readable first and only incidentally convertible to actual markup. If semantics are a mess and nobody can agree on how you lay out a table, I’m kind of ok with that. Plain text is the presentation format, and if you want precise conversion, drop some raw HTML or LaTeX in there. LaTeX…

> Markdown is an attempt to codify formatting conventions that were already long in use for newsgroups and email.

Markdown was never really about codifying anything existing. Sure, it took a lot of guidance from existing conventions, but it also invented quite a bit, ignored quite a bit, and compromised quite a bit because of wanting to mostly sit atop HTML.

The most notable deviation from custom is its link syntax, which is simply bad. Where any delimiter was necessary, the longstanding custom was to delimit with angle brackets; and Markdown did allow https://example.com/>, but its text-with-hyperlink syntax of [text](href) is highly confusing, leads to frequent errors, and makes the huge mistake of using as its delimiters characters that are valid in URLs. (In current spec terms, parentheses are in the set of URL code points https://url.spec.whatwg.org/#url-code-points>.) This has led to all sorts of trouble. My guess is that angle brackets weren’t used because of the potential for confusion with HTML tags, though there would have been no real parser ambiguity, and autolink syntax kinda messed that argument up anyway.

Then its image syntax of ![alt text](href), that’s just plain nonsense.

I’d say that reStructuredText (from a little earlier) matched existing conventions slightly better than Markdown, in general. And it was much more sane, as a language, especially when you wanted to extend it.

> It’s meant to be human readable first and only incidentally convertible to actual markup.

If it were incidental, you wouldn’t use it—just go informal and write what suits you, it will be nicer.

No, the only reason for Markdown is so that you can write HTML with a nicer syntax. It’s not incidental at all. Sure, that syntax is intended for human-readability and -authoring, but it’s essential to Markdown that it is actual markup, poorly-defined though it be as a family of lightweight markup languages https://en.wikipedia.org/wiki/Lightweight_markup_language>.

> Plain text is the presentation format

Do you know how many README.md files there are on GitHub that are essentially HTML soup? It’s a bit sad, really. It doesn’t invalidate the intention of what you’re saying, but I would say that Markdown is noticeably less about plain text being the presentation format than it was twenty years ago.

Re: If it is worth keeping, save it in Markdown

#248

The other major alternative to consider is RTF. I standardised on that about 10y ago, planning for a 30y horizon. It is a more complex format than Markdown, still text-based, but biased towards WYSIWYG presentation and editing, while Markdown is usually not WYSIWYG in the editor. Both formats suffer from a lack of standardisation, though Markdown seems to have more problems in practice - I've never had an issue cause…

> It is a more complex format than Markdown

Depending on what one means by “Markdown” and how completely you want to support RTF, I might argue RTF is way simpler than Markdown. Certainly it’ll be more consistent.

Markdown is far better suited for human authoring; RTF is a data format, not a markup language. And you can cut a lot of corners with Markdown and it mostly won’t bite you. But if you want to do things properly, Markdown gets rather complicated, whereas RTF stays comparatively simple after the initial parsing/serialising cost, especially if you exclude newer features like XML markup.

Re: If it is worth keeping, save it in Markdown

#249
post #203

Earlier quoted context omitted.

I think they're mixing the GH web ui with the syntax. You can paste an image right into the editor and it does a really good job of inserting it right where you need to. It is really good UX that I miss when editing markdown locally. Obsidian also does a decent job, but not quite as smooth.

Sounds like powerful lock-in for Github. How could such a project ever decamp to Gitlab or Codeberg?

Sounds like powerful UX others could also supports. Its all web stanards.

Re: If it is worth keeping, save it in Markdown

#250

Earlier quoted context omitted.

Markdown is also missing: - Diagrams - Math - Any custom blocks - like Figures, algorithms, image boxes, etc - Numbered chapters / sections (Eg Chapter 1, Appendix A, etc). - Semantic references For readmes, thats fine I guess. But I miss all those features when I'm writing proper blog posts, articles and documentation. There are various hacky workarounds. But as soon as you start using bespoke markdown extensions, y…

i do believe obsidian support all those (well maybe not all) but thats added 'on top' of basic markdown, so when you open your markdown file in some other program it looks weird

More importantly, when that specific plugin stops being maintained/updated, you’ll have Markdown files which can’t be properly presented/read.
Post reply on HN