Use Cases for Markdown

There’s been quite a bit of talk on the podcast about markdown and the apps that use it (including Drafts and Obsidian). I guess I’m just not getting it or understanding the use cases. I get that it’s a way to apply formatting to plain text in a way that it is recognized by other apps that then apply the formatting, but how does it get from one to another? In other words, I would type ** before and after text I want in bold, and the text would be in bold, but the ** would still remain (which isn’t completely WYSIWYG). How does markdown text apply formatting elsewhere in such a way as the text is bolded, but the ** is dropped? Is that done through Actions when it sends the text to the other app? I don’t like markdown visually, so I’m wondering what benefit there is to using it in spite of this. Thanks!

1 Like

There are a couple of options here. Some markdown editors will type in a live preview mode (Obsidian just got this, Typora, Bear I think) where the ** will disappear when you leave that line leaving only the formatting behind. When you return to the line, the Markdown formatting characters reappear.

For me, Markdown is just a plain text way of keeping notes. The files are small, easily searchable, openable on any device, and probably won’t become out of date.

The other option is to export it into a file with all the formatting and none of the markdown characters. Many Markdown editors will do that, like Drafts.

4 Likes

Markdown is a subset of HTML. Everything you can do in Markdown has a direct counterpart in HTML. However, Markdown is much easier to read and write that HTML. Markdown was originally designed for writing prose which would become HTML (such a blog posts or this forum post). The idea was that one could create and edit the document in their plain text editor of choice and then pass that plain text Markdown source through a Markdown parser which would convert it to HTML for display in a browser.

However, over time people began to create Markdown editors, and/or Markdown syntax highlighters for plain text editors. A syntax highlighter is helpful when working on code to identify the various parts and types with the code. Therefore, different words will be formatted with different styles (bold, color, etc.). When using a code editor, the full syntax is still displayed, but yes, of course bold text in a Markdown document would be displayed as bold. However, then converted to HTML the syntax (**) would be converted to an HTML tag (<strong>) which would (usually) cause the text to be displayed as bold in a browser. Of course, the browser doesn’t display the HTML tags themselves, only the formatting that they tags imply. Many Markdown editors have a preview mode which displays the rendered HTML in a webview.

Some more sophisticated Markdown editors actually combine the edit view and preview into a single view. Often only the line (or word) that your cursor is on is displayed as raw text, while the rest of the document is displayed as the rendered HTML.

I suppose your confusion comes from seeing Markdown being used more and more in contexts where is never needs to be converted to HTML (most of the use cases discussed on this forum). However, as Markdown provides for a simple linking mechanism, it makes for a great way to create an interlinked knowledgebase with plain text. So long as your Markdown editor is in preview mode, you can easy read and navigate through the various documents. At the same time, the underlying document is just a plain text file, not some proprietary format which requires you to pay for a specific software license to be able to access/read/edit. Therefore, it is relatively simple to read and navigate in an edit mode as well. In fact, many people never use Markdown outside of edit mode.

6 Likes

Yes, I would love to use Drafts to write web site content, rather than do it through the browser. However, my web site isn’t on WordPress. Would I have to get the Pro version to create an Action that would convert it to HTML for pasting into the web site CMS? How would that work?

An example as to how this can work:

I take a note in Drafts using Markdown syntax, and copy the note over into Filevine, my firm’s legal case management system. Filevine’s note-entry box is a plain-text field, but when I hit the “Save” button, any Markdown syntax is converted (such as to bold, headers, links, etc.) and looks nice in the final note.

(Actually, I said “any” Markdown syntax is converted, but Filevine supports a limited subset of Markdown. It covers everything I need, though — bold, headers, links, etc.)

@LawyerSteve Marked2 is a markdown previewer by Brett Terpstra. It does a lot of cool stuff … but one of them is you can convert to HTML. Just copy/paste into your web editor.

Marked2: https://marked2app.com

1 Like

That depends on what system you are using for your site. If your CMS supports Markdown, then you only need to provide the Markdown. If your CMS supports HTML, then you would need to convert it to HTML first. If your CMS supports some other language, then it probably won’t work for you.

Drafts already has the ability to convert Markdown to HTML. In fact that is what the Markdown Mail action does. Rich text email is actually HTML, so that action converts Markdown to HTML and then inserts that HTML into the body of a new mail message. Presumably you would need a custom action to pass the HTML elsewhere. In fact, the documentation shows that the GitHubMarkdown parser is available to call from a Drafts script. You then would need to pass the output of that to your CMS.

I think I just figured it out. I wrote some text in Drafts in Markdown, then clicked the Preview Button at the bottom. In the Preview window I clicked on Tools in the upper left corner, and selected “Copy HTML.” I then pasted it into my CMS. It added a bunch of extra code that I deleted, but other than that . . . . I tried “Copy Rich Text,” and it looked good, except the “H1” tag wasn’t inserted for the header. I think I found my solution. I will continue to test.

2 Likes

Well put.

I don’t believe Bear supports hiding markdown. But Panda does. Panda is basically the development channel for Bear’s editor. It also uses your native file system instead of Bear’s proprietary database, which a minority of people (that I am a part of) might prefer.

1 Like

It took me a long time to come around to using Markdown for anything, but using it to format content for the web (or any other ‘pretty’ format) is a bit of a mythical concept. If you’ve ever used a WYSIWYG editor, there will be plenty of basic things you’d expect to do which Markdown simply cannot handle.

It’s fine for prose, as mentioned above, but as soon as you start adding anything beyond the basic it falls down quickly. For example, two things I do on pretty much every single WordPress post are set some links to open in a new tab/window and float an image to the left or right.

Just look at the inventor’s web site to see what he was solving for!

The one task I have put it to is writing my memoirs in Ulysses, but converting this into styled text in Affinity Publisher is no picnic, I can tell you. The biggest problem? Getting pictures across. But also I struggled with styles. I’ve now fallen back to just the basic bold/italic, headings, and a few bulleted lists and will do the real production work directly in Publisher, with the help of some judicious search and replace on the styles.

1 Like

To me Markdown is a simple rich-ish form of text that can be processed in lots of different ways.

(In md2pptx - which makes slides from Markdown - I tried to make it so the same Markdown file can be processed into eg a (non-slide) document. As an example of aiming for “lots of different ways”.)

Note: Lots of tools emit Markdown - so it’s not just processable in lots of ways but easily create less, too.

2 Likes

I think the biggest strength of markdown is that it’s simple and easy to learn. It can be educated to almost anyone who can type.

But for more professional workflows, it’s hardly going to be enough. Just look at all the extensions and flavours of markdown. It shows that many people are initially drawn by appeal of the simplicity, but quickly want to get more out of it.

Even as the most amateurish blogger, I often has to modify the generated html manually. But I think it’s just not meant to replace html or latex. It’s for people who can live with only the bare minimum.

4 Likes

Would you say the issues are ones of appearance? Or of semantics?

I will say - for the latter - that the ability to embed HTML is handy. (I recently started supporting <video> and <audio> elements as there are no Markdown equivalents, for example. No biggie.)

The point, for me, is similar to that of LaTeX which Markdown actually came to replace in my workflow. That is that I have a non proprietary ‘flat’ version of what I have done saved in what is really plain text. Re-readable into most systems, more importantly readable, directly, by me, and as @SuperTachyon said, simpler than LaTeX.
LaTeX can be read easily in fact in its raw form usually and with experience is almost ‘transparent’. For me the use has drifted some way from Gruber’s original intent. LaTeX is of course, is not suitable for HTML as far as I know but was designed to type set documents, PDFs now really. Many journals still demand Word versions. To me that is quite irritating…
Space used to be an issue, it isn’t now really,
Markdown also makes it easy to go back to a document and re-edit it. I came to find, that once you get fluent the modifications to text one can make, bold, italic etc. are really very very useful. I use italic a lot for example. Species names and citations in particular. To some extent usefulness is user-relative? Some of these advantages are not, frankly, immediately apparent and that I think is the sticking point for markdown and why it is still so ‘niche’?

I haven’t used html yet: I will have to do some at some point, I am not looking forward to the curve.

2 Likes

That is interesting, some good stuff in the replies to you which I enjoyed, I must add something though in relation to what you say there. What the creator says, John Gruber, often quoted by many aficionados and has passed even onto Fletcher Penny’s explanation of his development into Multimarkdown is quite misleading when one is trying to get to grips with it, especially if, like me, one is not a coder or IT guy.

The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

Says John. It is ambiguous though, I know what he means. However it does have formatting instructions which look glaring initially and as you rightly point out and it is really a matter of degree. I wish John would clarify that passage on his page. Unless I am wrong in some way?

If you saw all the code for a text document you would spend an hour looking for the actual ‘words’. In fact at some level they would not be there in a readable form at all. Go down far enough and get the ‘Matrix’ effect still; that is only 0 and 1, well really only electric signals which are there or not there, nothing to read at all even by a machine? Really it is like Russian Dolls, and we just take most of them for granted as it were. Sometimes you will see some strange symbol appear when some code gets crossed further down in the computer or when you copy and paste: sometimes too some markup will become so ‘obvious’ that it starts to ‘look’ like its output. I see ** suchandsuch ** quite often to mean that the word is bolded. It ‘looks’ bolded to me if I see it as a matter of fact now.

3 Likes

Someone was talking the other day about taking paper notes with, I think, octothorpes written for headings. My impression was it became that instinctive to them.

I could see myself writing bullets with asterisks on paper; Doesn’t seem so odd.

2 Likes

@TudorEynon I think that perhaps what you are missing is that John Gruber wrote that from the perspective of someone who was already familiar with the various other markup formats out there. For example, if you have been writing prose in raw HTML for years (which was surprisingly common in the early days), Markdown is a breath of fresh air.

In contrast, for people who have only every used WYSIWYG tools, Markdown could be jarring. As a developer of Markdown tools for the past ~15 years, I have seen many support requests from people who are misunderstanding Markdown syntax because they misunderstand (or have no understanding whatsoever about) the HTML that it is based on. And yet, Markdown is documented by demonstrating the HTML that is generated from the Markdown syntax. IMO Markdown was designed with the presumption that authors of Markdown documents know and understand HTML.

That said, in its simplest form, Markdown is just blocks of plain text separated by blank lines. Anyone can do that without knowing anything about HTML. So it’s easy to get anyone started. The problems come when more complex formatting it needed.

In the end, I think Markdown is great for writing prose for the web as it is easily converted to HTML However, for anything where publishing to HTML is not the end goal, I think Markdown is generally ill-suited. However, I still use it because is it the format I am most intimately familiar with and it has all the benefits of an open, plain text file format. The problem for those who are not so familiar with HTML (and don’t need to publish to HTML) is that there is no widely supported plain text format that fits there needs. Therefore, they either need to use proprietary WYSIWYG formats or learn HTML so that they can better understand and use Markdown.

2 Likes

I switched to Markdown in the last year, having previously used a mix of Word, Pages, plain text, Apple notes, whatever I could get my hands on quickly to be honest.

The main reason I switched to Markdown hasn’t been discussed here, which is just that I wanted copy and paste to carry over format exactly as I intended, and for files to be compatible no matter what device I was working on. Shifting between Windows and Mac is a pain, I was fed up of Gmail’s weird insistence that you can’t have paste options (paste without formatting, paste text only, keep source formatting, etc.).

I have several employers, all running different software (of course :roll_eyes:) and I just wanted somewhere to write text that remained universal and didn’t make me want to kill someone when I was trying to move it somewhere. I even went through a period of using very basic plain text files just to try and eliminate some of this annoyance, but that is a horrible experience :joy:

I grew up in the blogging heyday so I understand html, which may be a barrier to some. But if you’re in a job where you just need to do some writing, and you need it to be able to move it freely without formatting issues, across apps and across platforms, Markdown is great. You don’t even really need to learn markdown language if you just need to write. You probably don’t need to do as much bold emphasis as you want to do anyway :grimacing:

5 Likes

Exactly! Markdown has been extended far beyond its original purpose.

I agree, that is what I said really. I am a fan of Gruber’s and of Markdown for the reasons you give; maybe my reply was too long and not clear enough. Often experts miss obvious sources of misunderstanding exactly because they are experts.

I learnt Markdown for Byword and DEVONthink 3 with no background in HTML at all. For me the curve worked the other way and I understood that was now common. Markdown is ‘just’ blocks of plain text’:as you say, some of that text is though instruction for formatting which, unless you escape it, is removed by a compiler, either available within the app. or potentially if using an editor that only takes plain text.