<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Coffee]]></title><description><![CDATA[Coffee]]></description><link>https://coffeetext.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a81929455911e60a31e11d1/e02a7768-fb18-4146-bacc-8e7e795977c8.png</url><title>Coffee</title><link>https://coffeetext.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 24 Nov 2026 13:12:06 GMT</lastBuildDate><atom:link href="https://coffeetext.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to export Markdown to a good-looking PDF on the Mac]]></title><description><![CDATA[Set margins, headers, page breaks and landscape, keep tables, maths and code, and fix a blank PDF, with Pandoc, Print to PDF or an editor.]]></description><link>https://coffeetext.hashnode.dev/how-to-export-markdown-to-a-good-looking-pdf-on-the-mac</link><guid isPermaLink="true">https://coffeetext.hashnode.dev/how-to-export-markdown-to-a-good-looking-pdf-on-the-mac</guid><category><![CDATA[markdown]]></category><category><![CDATA[MacOSDevelopment]]></category><category><![CDATA[pdf]]></category><dc:creator><![CDATA[Pedro “PT” Thomaz]]></dc:creator><pubDate>Sun, 22 Nov 2026 23:47:14 GMT</pubDate><content:encoded><![CDATA[<blockquote>
<p>Checked November 2026 against the official help pages linked below, and what Coffee does against its own code. Coffee isn't affiliated with Obsidian, Typora or iA Writer.</p>
</blockquote>
<p>For a quick PDF, open the file in any app that shows Markdown as a formatted page, and use File, then Print, then Save as PDF. For control over margins, headers, page breaks and landscape pages, use Pandoc, or an editor whose PDF export has those settings. Markdown itself has no page settings, so everything below is set in the tool, not in the file.</p>
<h2>What makes a PDF look good</h2>
<p>It's a short list:</p>
<ul>
<li>Margins wide enough that lines of text aren't too long to read</li>
<li>Headings that never sit alone at the bottom of a page</li>
<li>Page numbers, once there's more than a page or two</li>
<li>Tables and images that fit the page width</li>
<li>No Markdown left showing, including front matter at the top of the file</li>
</ul>
<h2>Three ways to make the PDF</h2>
<h3>Print to PDF</h3>
<p>Every Mac can <a href="https://support.apple.com/guide/mac-help/save-a-document-as-a-pdf-on-mac-mchlp1531/mac">save anything printable as a PDF</a>: File, Print, then the PDF menu at the bottom of the dialog. It's free and takes seconds. What you get depends on how the app you printed from lays out a page, and you usually have little say in that.</p>
<h3>Pandoc</h3>
<p><a href="https://pandoc.org/MANUAL.html">Pandoc</a> is free and scriptable, and it's what to use if you make the same kind of document often. The basic command is short:</p>
<pre><code class="language-plaintext">pandoc notes.md -o notes.pdf
</code></pre>
<p>That goes through LaTeX by default, so you need a LaTeX engine installed, and it looks like a LaTeX paper. To style it with CSS instead, go through HTML:</p>
<pre><code class="language-plaintext">pandoc notes.md -t html --pdf-engine=weasyprint -o notes.pdf
</code></pre>
<p>Its manual also lists Typst and others as engines. The results can be excellent, but expect an evening of setup the first time.</p>
<h3>An editor with PDF export</h3>
<p>Most Markdown editors can do this, and they differ in how much control you have.</p>
<table>
<thead>
<tr>
<th>App</th>
<th>PDF options</th>
<th>Control over the look</th>
</tr>
</thead>
<tbody><tr>
<td><a href="https://obsidian.md/help/pdf">Obsidian</a></td>
<td>Page size, margin preset, landscape, downscale. Desktop only</td>
<td>CSS snippets. Exports always use light styling</td>
</tr>
<tr>
<td><a href="https://support.typora.io/Export/">Typora</a></td>
<td>Paper size, margins, headers and footers with page numbers</td>
<td>Uses your theme, with custom CSS for print</td>
</tr>
<tr>
<td><a href="https://ia.net/writer/support/preview/export-share-print">iA Writer</a></td>
<td>Page size, title page, headers and footers with page numbers</td>
<td>Built-in templates, or <a href="https://ia.net/writer/support/preview/templates">your own</a> in HTML, CSS and JavaScript</td>
</tr>
<tr>
<td>Coffee</td>
<td>A4 or Letter, title page, page numbers always on</td>
<td>Three templates, nothing to customise</td>
</tr>
</tbody></table>
<p>Obsidian's help page doesn't mention page numbers. Community plugins such as <a href="https://community.obsidian.md/plugins/better-export-pdf">Better Export PDF</a> add them.</p>
<p>If you want a look of your own, Typora and iA Writer let you build one and Coffee doesn't.</p>
<h2>PDF export settings, one at a time</h2>
<h3>Margin settings</h3>
<p>Margins are a setting of the tool, never of the Markdown. With Pandoc's LaTeX route, pass them as a variable:</p>
<pre><code class="language-plaintext">pandoc notes.md -V geometry:margin=2cm -o notes.pdf
</code></pre>
<p>Through HTML, set them in CSS with <code>@page { margin: 2cm; }</code>. Typora has a margin setting, and Obsidian has presets.</p>
<p>Coffee's margins come with the template and can't be changed: about 24 mm at the sides in Clean and Letterhead, and about 19 mm in Minimal.</p>
<h3>Headers and footers</h3>
<p>Pandoc's LaTeX route can load a LaTeX package for running headers through <code>--include-in-header</code>, which is LaTeX work rather than Markdown. Through HTML, CSS page margin boxes such as <code>@bottom-center</code> hold page numbers or a title, and WeasyPrint supports them. Typora and iA Writer have header and footer settings with page numbers.</p>
<p>Coffee's footer is the page number, on every page, centred in Clean and Letterhead and in the corner in Minimal. There's no running header. Letterhead puts your name from Settings and today's date at the top of the first page only.</p>
<h3>Page breaks</h3>
<p>Markdown has no page-break mark. Each tool has its own:</p>
<ul>
<li><strong>Pandoc to LaTeX:</strong> <code>\newpage</code> on a line of its own.</li>
<li><strong>Anything that goes through HTML:</strong> an empty element styled with CSS, such as <code>&lt;div class="page"&gt;&lt;/div&gt;</code> with <code>.page { break-after: page; }</code> in your stylesheet.</li>
</ul>
<p>Coffee has neither, and HTML in a note prints as text, so don't add one there. Coffee starts a new page when one is full, and it keeps each heading with at least two lines of what follows it, which is the break most people are after.</p>
<h3>Landscape pages</h3>
<p>With Pandoc's LaTeX route, <code>-V classoption=landscape</code> turns the whole document. Through HTML, CSS can do it with <code>@page { size: A4 landscape; }</code>. Obsidian has a landscape switch.</p>
<p>Coffee's PDFs are portrait only. For a wide table, export to Word from the same menu and set the page to landscape there.</p>
<h3>Paper size</h3>
<p>Pandoc takes <code>-V papersize=a4</code> or <code>letter</code>. Print to PDF uses the paper size chosen in the print dialog. Coffee offers A4 or Letter.</p>
<h3>The document title</h3>
<p>Pandoc takes the title from a <code>title:</code> line in the front matter. Many editors use the file name.</p>
<p>Coffee uses the note's file name, for the PDF's own title and for the title page if you turn one on. To change it, rename the note before you export.</p>
<h3>A custom stylesheet</h3>
<p>With Pandoc through HTML, pass your CSS with <code>--css style.css</code>. Typora uses your theme and takes extra CSS for print, Obsidian takes CSS snippets, and iA Writer has templates of your own.</p>
<p>Coffee doesn't take custom CSS or fonts. You choose one of three templates, and that's all the styling there is.</p>
<h2>What formatting makes it into the PDF</h2>
<p>This depends on the tool, so here's what to check, and what Coffee does.</p>
<h3>Tables</h3>
<p>Pipe tables work in Pandoc and nearly every editor. Wide ones are the problem: keep to about five columns on a portrait page, or turn the page.</p>
<p>In Coffee, tables print with a bold header row, and columns follow their alignment colons. All columns are the same width, and bold or links inside a cell print as their Markdown, so keep cells plain. There's more on writing them in <a href="https://coffeetext.app/blog/markdown-tables-guide">the Markdown tables guide</a>.</p>
<h3>Images</h3>
<p>Local images usually come through. Images on the web depend on the tool fetching them while it exports.</p>
<p>Coffee includes images stored with the note, scaled down to fit the page, and leaves out images on the web. See <a href="https://coffeetext.app/blog/images-in-markdown-mac">images in Markdown</a> for keeping them with the note.</p>
<h3>Code and syntax highlighting</h3>
<p>Pandoc highlights fenced code blocks that name a language. Editors that print a styled preview usually keep its colours.</p>
<p>Coffee prints code blocks in a monospaced font on a grey band, without syntax colours. Inline <code>code</code> gets the same grey.</p>
<h3>Footnotes</h3>
<p>Pandoc supports <code>[^1]</code> footnotes. Plain CommonMark doesn't, so some editors print the brackets as they are.</p>
<p>Coffee prints each reference as a superscript number and moves the notes to the end of the document. More on the syntax in <a href="https://coffeetext.app/blog/extended-markdown-footnotes-task-lists">footnotes and task lists</a>.</p>
<h3>Equations and maths</h3>
<p>Pandoc's LaTeX route handles <code>$…$</code> maths as LaTeX does. Through HTML, maths needs a maths option, and results vary by engine.</p>
<p>Coffee draws <code>$$</code> blocks and inline <code>$…$</code> as formulas in the PDF. See <a href="https://coffeetext.app/blog/math-equations-in-markdown">maths in Markdown</a>.</p>
<h3>Diagrams, tasks and callouts</h3>
<p>Mermaid code usually needs a plugin or a filter. Coffee draws Mermaid flowcharts, pie charts and sequence diagrams as charts, and prints task lists, quotes, callouts and highlights.</p>
<h3>What gets left out</h3>
<p>In Coffee, front matter is left out, and so are HTML comments, unless they're inside code. Links are coloured, but they aren't clickable in the PDF, so spell out any address the reader needs. Answers from the calculator print beside their lines, unless calculations are off.</p>
<h2>When PDF export isn't working</h2>
<h3>The PDF export is blank</h3>
<ul>
<li><strong>The app printed too early.</strong> An app that prints a preview may not have finished drawing it. Wait until the preview shows, then print again.</li>
<li><strong>It printed the wrong pane.</strong> Some editors print the source when the cursor is in it. Print from the preview, or use the app's own export.</li>
<li><strong>There's nothing to print.</strong> A file that's only front matter or comments has no body. Coffee leaves both out, so such a note gives a page with nothing but its number.</li>
<li><strong>The note is locked.</strong> Coffee won't export or print a <a href="https://coffeetext.app/blog/password-protect-notes-mac">private note</a> until you unlock it.</li>
</ul>
<h3>Formatting is lost in the PDF</h3>
<p>Printing from a plain text editor, such as TextEdit, gives you the raw Markdown with every <code>#</code> and <code>*</code> showing. Print from an app that draws Markdown, or export instead of printing. If only some syntax is lost, it's probably an extension, such as footnotes or <code>==highlights==</code>, that the tool doesn't read.</p>
<h3>Images are missing</h3>
<p>Check that the image paths are relative to the file and that the images are on the disk. An image on the web won't come through in Coffee, and may not elsewhere.</p>
<h3>A table runs off the page</h3>
<p>Cut columns, shorten headings, or turn the page to landscape in a tool that can.</p>
<h2>Editing Markdown before you export</h2>
<p>Markdown is plain text, so edit it in any app and export when it reads right. Coffee saves the note and exports it as it is at that moment, so there's no separate copy to keep in step. The two checks that help most: read the last page, as a line alone on a page is the most common flaw, and look at headings near the foot of each page.</p>
<h2>In Coffee</h2>
<p>Press ⌘E, choose a template, and export. There's no styling to do, and that's the whole idea. Pictures of all three templates are in <a href="https://coffeetext.app/blog/markdown-to-pdf-mac">the original article</a>.</p>
<ul>
<li><strong>Clean</strong> is the default, with centred page numbers.</li>
<li><strong>Letterhead</strong> puts your name from Settings and today's date above a thin rule on the first page.</li>
<li><strong>Minimal</strong> has narrower margins and moves the page number to the corner.</li>
</ul>
<p>You can add a title page with the note's title, your name and the date. Coffee lays out the PDF itself rather than printing a web view, which is how it keeps headings with what follows them. File, then Print, uses the same layout with the Clean template. On iPhone and iPad, Coffee makes the PDF from its HTML export instead, on A4 pages with 2 cm margins and without the Mac's templates.</p>
<p>The limits, in one place:</p>
<ul>
<li><strong>No custom fonts or CSS.</strong> If you need your company's typeface, this isn't the tool.</li>
<li><strong>Fixed margins, portrait pages, and no page-break mark.</strong></li>
<li><strong>Images on the web are left out.</strong></li>
<li><strong>Table columns are all the same width,</strong> and formatting inside cells isn't applied.</li>
<li><strong>Links aren't clickable in the PDF.</strong></li>
</ul>
<p>Coffee also exports Word, EPUB, HTML, Markdown and plain text.</p>
<h2>Tips that work in any app</h2>
<ul>
<li><strong>Use one top-level heading.</strong> Start the document with a single <code>#</code>, then use <code>##</code> for sections. Most tools build their layout from this.</li>
<li><strong>Keep tables narrow.</strong> If a table has more than five or so columns, it's probably going to be cramped on a portrait page.</li>
<li><strong>Check images first.</strong> Make sure they're stored locally, and at a size that won't print blurry.</li>
<li><strong>Read the last page.</strong> A single line left on its own page is the most common flaw, and cutting a few words usually fixes it.</li>
</ul>
<h2>Questions</h2>
<h3>How do I add a page break in Markdown for a PDF?</h3>
<p>Markdown has no page-break mark, so it depends on the tool. With Pandoc to LaTeX, put <code>\newpage</code> on a line of its own. In tools that go through HTML, use an empty element styled with <code>break-after: page</code>. Coffee has no page-break mark and breaks pages by itself, keeping headings with what follows.</p>
<h3>How do I change the margins of a Markdown PDF?</h3>
<p>In the tool, not the file. With Pandoc, add <code>-V geometry:margin=2cm</code>. Through HTML, use <code>@page { margin: 2cm; }</code> in CSS. Coffee's margins are fixed by its three templates, and Minimal has the narrowest.</p>
<h3>Can a Markdown PDF have headers and footers?</h3>
<p>Yes, if the tool has them. Typora and iA Writer have header and footer settings with page numbers, and CSS page margin boxes do it through HTML. Coffee puts a page number on every page, and its Letterhead template adds your name and the date to the first page.</p>
<h3>Why is my Markdown PDF blank?</h3>
<p>Usually the app printed before its preview was drawn, or printed the source pane, or the file has nothing outside front matter and comments. Wait for the preview, or export rather than print.</p>
<h3>Can I export Markdown to PDF in landscape?</h3>
<p>With Pandoc, add <code>-V classoption=landscape</code>. Through HTML, use <code>@page { size: A4 landscape; }</code>. Obsidian has a landscape switch. Coffee's PDFs are portrait only.</p>
<hr />
<p>Written by Pedro Thomaz, who makes Coffee, a Markdown editor for the Mac on macOS 15 or later, and for iPhone and iPad. It's free for 14 days with no card or account, then €3 a month, €29 a year, or €79 once with two years of updates. More at <a href="https://coffeetext.app">https://coffeetext.app</a></p>
<p><em>First published on the</em> <a href="https://coffeetext.app/blog/markdown-to-pdf-mac"><em>Coffee blog</em></a><em>. This article was written with AI help and checked by the author.</em></p>
]]></content:encoded></item><item><title><![CDATA[Why AI tools work so well with Markdown files]]></title><description><![CDATA[Markdown is plain text with visible structure, so a tool can read it, edit it and show a diff with no converter.]]></description><link>https://coffeetext.hashnode.dev/why-ai-tools-work-so-well-with-markdown-files</link><guid isPermaLink="true">https://coffeetext.hashnode.dev/why-ai-tools-work-so-well-with-markdown-files</guid><category><![CDATA[markdown]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Pedro “PT” Thomaz]]></dc:creator><pubDate>Sun, 22 Nov 2026 12:21:12 GMT</pubDate><content:encoded><![CDATA[<blockquote>
<p>Checked November 2026 against the Claude Code, Cursor, AGENTS.md, Markdown, CommonMark and Microsoft documentation linked below. Coffee isn't affiliated with any of them.</p>
</blockquote>
<p>Markdown is plain text, so an AI tool can open a file, read exactly what's there, change a few characters and save it, with no converter in between. The structure is written in the text itself, as <code>#</code> and <code>-</code> and <code>|</code>, so the model sees it directly. And the result can be compared line by line with ordinary tools, so you can check what happened.</p>
<p>None of this is a measurement. I'm not citing a study that shows models write better from Markdown, and I'd be wary of anyone quoting a percentage. What follows is how the format and the tools work, which you can verify for yourself.</p>
<h2>The file is the text</h2>
<p><a href="https://daringfireball.net/projects/markdown/">John Gruber's original description</a> of Markdown sets readability as the goal: a document should be publishable as plain text, without looking as if it's been marked up. <a href="https://commonmark.org/">CommonMark</a> calls it a plain text format for structured documents.</p>
<p>That has a practical effect for a tool. The bytes on disk are the words on the page. Compare a Word file, which <a href="https://learn.microsoft.com/en-us/office/open-xml/word/structure-of-a-wordprocessingml-document">Microsoft's documentation</a> describes as a zip package of parts, with the body in an XML file where each piece of text sits inside paragraph and run elements. Tools can work with that, and plenty do, but something has to unpack it, understand it and put it back together correctly.</p>
<p>With Markdown, the plainest tools are enough. Agents such as <a href="https://code.claude.com/docs/en/overview">Claude Code</a> read files, edit files and run commands, and they don't need to know anything about your note app for that to work.</p>
<h2>The structure is visible</h2>
<p>A heading in Markdown is the characters <code>## </code> at the start of a line. A list item starts with <code>- </code>. A table is pipes and dashes. Nothing is hidden in styles or metadata, so what the model reads is what it can change, and the structure travels with the words.</p>
<p>Anthropic's own advice points the same way. For instruction files, <a href="https://code.claude.com/docs/en/memory">its docs</a> recommend grouping instructions under Markdown headers and bullets, since organised sections are easier for Claude to follow than dense paragraphs. That's guidance about one kind of file for one tool, but the reasoning carries: headings tell a reader of any kind where things are.</p>
<h2>AI tools already use it for their own instructions</h2>
<p>The clearest sign is that the tools chose it for themselves. <code>CLAUDE.md</code> is a Markdown file that <a href="https://code.claude.com/docs/en/memory">Claude Code reads at the start of every session</a>. <a href="https://agents.md/">AGENTS.md</a> describes itself as standard Markdown with no required fields, and lists many tools that support it. <a href="https://cursor.com/docs/context/rules">Cursor</a> reads it too, as a simple Markdown alternative to its structured rules.</p>
<p>So when you ask one of these tools to work on your notes, it's handling the same format as its own instructions. There's more on those files in <a href="https://coffeetext.app/blog/editing-claude-md-agents-md">editing a CLAUDE.md or AGENTS.md</a>.</p>
<h2>You can see what it changed</h2>
<p>An AI edit you can't check is a risk, and this may be the most useful property of all. Since Markdown is text, Git and other diff tools can compare two versions and show what's different:</p>
<pre><code>git diff --word-diff notes.md
</code></pre>
<p>You also get <a href="https://coffeetext.app/blog/undo-one-ai-edit">hunk-by-hunk undo</a>, history, and the ability to <a href="https://coffeetext.app/blog/review-claude-cursor-markdown-changes">review the whole edit</a> in whichever app you like. A binary format needs its own comparison feature, and you're relying on that feature being good.</p>
<h2>The files outlast the tool</h2>
<p>The <a href="https://www.markdownguide.org/getting-started/">Markdown Guide</a> makes the case that Markdown files are portable and that you can still read them in a text editor if your app stops working. That matters more than usual with AI tools, which change quickly. You can use one this month and a different one next month on the same folder, since neither owns the files.</p>
<p>The same goes for the <a href="https://coffeetext.app/blog/connect-notes-to-ai-mcp">standard way of connecting tools to notes</a>. Coffee's MCP server hands a note over as its Markdown text, which any client can read.</p>
<h2>Where Markdown doesn't help</h2>
<p>Fair is fair: the format has real limits with AI tools.</p>
<p><strong>Long paragraphs make poor diffs.</strong> Git compares lines, and a paragraph in Markdown is often one long line. A tool that changes one word produces a diff of two walls of text unless you ask for <code>--word-diff</code>.</p>
<p><strong>Plain text doesn't make the answer true.</strong> A model can read a note perfectly and still change a number, drop a sentence or misquote a name. Markdown makes that easier to catch, and does nothing to prevent it. <a href="https://coffeetext.app/blog/review-claude-cursor-markdown-changes">Read the changes</a>.</p>
<p><strong>Dialects differ.</strong> CommonMark exists because implementations diverged, so a document can render differently from one system to another. A tool may write a table, a footnote or a task list your app doesn't show the way you expect.</p>
<p><strong>Images are only links.</strong> A Markdown file holds a path to an image, not the image. A tool reading the note sees the path and whatever alt text you wrote, unless it opens the picture separately.</p>
<p><strong>The syntax can get in the way of answers.</strong> In Coffee's Ask feature, notes go to Apple's on-device model as plain text with the Markdown removed, because otherwise the model repeats the syntax back in its answers. So the markup isn't automatically an advantage for every model or every task.</p>
<p><strong>Tables are awkward to edit by hand.</strong> Each row is one line of pipes, and changing a column means changing every row. A model doesn't mind this, but you do when you're checking its work.</p>
<h2>What this means for your notes</h2>
<p>If you want to use AI tools on your writing, the useful step is keeping it in plain files in a folder you control, rather than switching to any particular app. Obsidian, Typora, iA Writer and others <a href="https://coffeetext.app/blog/markdown-editor-mac-plain-local-files">work that way</a>, and so does Coffee. Then put the folder in Git, and every tool gets the same plain text, with a record you can check.</p>
<h2>Questions</h2>
<h3>Do AI models understand Markdown better than other formats?</h3>
<p>I can't point to a measurement that settles this. What can be said is that Markdown is plain text with visible structure, needs no conversion, and is what tools such as Claude Code and Cursor use for their own instruction files.</p>
<h3>Is plain text just as good as Markdown for AI tools?</h3>
<p>For reading and editing, a plain text file works the same way. Markdown adds headings, lists and tables, in a form both people and models can read, and that structure is what you'd otherwise lose.</p>
<h3>Can AI tools work with Word files?</h3>
<p>Many can, using a converter or a library. The difference is the extra step: a <code>.docx</code> is a zip package of XML parts, so a change has to be made and saved back through that structure.</p>
<h3>Why does a small AI edit show as a huge diff?</h3>
<p>Git compares lines, and a Markdown paragraph is often a single line, so one changed word marks the whole paragraph. Use <code>git diff --word-diff</code> to see only the words that changed.</p>
<h3>Does Markdown make AI edits safer?</h3>
<p>It makes them easier to check, which isn't the same thing. You can see every change with ordinary tools, but you still have to <a href="https://coffeetext.app/blog/keep-ai-from-wrecking-notes">look at them</a>.</p>
<hr />
<p>Written by Pedro Thomaz, who makes Coffee, a Markdown editor for the Mac on macOS 15 or later, and for iPhone and iPad. It's free for 14 days with no card or account, then €3 a month, €29 a year, or €79 once with two years of updates. More at <a href="https://coffeetext.app">https://coffeetext.app</a></p>
<p><em>First published on the <a href="https://coffeetext.app/blog/why-ai-tools-work-with-markdown">Coffee blog</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to keep Excalidraw sketches inside Markdown notes on the Mac]]></title><description><![CDATA[Three ways to keep a drawing with a Markdown note: an .excalidraw file, an SVG or PNG export, or a Mermaid block.]]></description><link>https://coffeetext.hashnode.dev/how-to-keep-excalidraw-sketches-inside-markdown-notes-on-the-mac</link><guid isPermaLink="true">https://coffeetext.hashnode.dev/how-to-keep-excalidraw-sketches-inside-markdown-notes-on-the-mac</guid><category><![CDATA[markdown]]></category><category><![CDATA[excalidraw]]></category><category><![CDATA[Productivity]]></category><dc:creator><![CDATA[Pedro “PT” Thomaz]]></dc:creator><pubDate>Sun, 22 Nov 2026 12:19:37 GMT</pubDate><content:encoded><![CDATA[<blockquote>
<p>Checked November 2026 against <a href="https://github.com/excalidraw/excalidraw">Excalidraw's repository</a> and the <a href="https://github.com/zsviczian/obsidian-excalidraw-plugin">Obsidian Excalidraw plugin's repository</a>, and what Coffee does against its own code. Coffee isn't affiliated with Excalidraw or Obsidian.</p>
</blockquote>
<p>A sketch often says more than the paragraph next to it: three boxes and two arrows for how a system fits together, a rough floor plan, a circle around the part of a plan that worries you. Markdown is text, so it can't hold a drawing itself. What it can do is point at one, and there are three good ways to set that up.</p>
<h2>Three ways to keep a sketch with a note</h2>
<table>
<thead>
<tr>
<th>Way</th>
<th>What's in the folder</th>
<th>Can you edit the sketch later?</th>
<th>Where it shows</th>
</tr>
</thead>
<tbody><tr>
<td>An <code>.excalidraw</code> file</td>
<td>The drawing as JSON</td>
<td>Yes, in any app that reads the format</td>
<td>In apps that draw the format inside a note</td>
</tr>
<tr>
<td>An SVG or PNG export</td>
<td>A picture</td>
<td>Only if you also keep the original</td>
<td>Anywhere Markdown images work</td>
</tr>
<tr>
<td>A Mermaid block</td>
<td>Text inside the note</td>
<td>Yes, it's text</td>
<td>In apps and sites that render Mermaid</td>
</tr>
</tbody></table>
<p>Many people use two of these: the editable drawing, and a picture of it for places that can't read the drawing.</p>
<h2>The .excalidraw file</h2>
<p><a href="https://github.com/excalidraw/excalidraw">Excalidraw</a> is a free, open-source whiteboard with a hand-drawn look, under the MIT licence. Its repository describes an open format: a drawing saves as an <code>.excalidraw</code> file, which is JSON. Inside are the elements (each rectangle, arrow, line, pen stroke and piece of text, with its position, colour and the seed that gives it its wobble), the view settings, and any pictures placed on the board.</p>
<p>Because it's a plain file, it can live in your notes folder next to the note it belongs to:</p>
<pre><code>Trip/
  Trip plan.md
  Trip plan.excalidraw
</code></pre>
<p>It syncs, backs up and moves with the rest of your notes, and you can open it again in excalidraw.com to keep drawing. What a plain Markdown editor won't do is show it: to most apps, a link to an <code>.excalidraw</code> file is a link to a file, not a picture.</p>
<h3>Obsidian's Excalidraw plugin</h3>
<p>The <a href="https://github.com/zsviczian/obsidian-excalidraw-plugin">Excalidraw plugin for Obsidian</a> draws boards inside the vault and embeds them in notes with the usual embed syntax, such as <code>![[image.excalidraw|100]]</code> for a smaller one. Its README says drawings are now stored in Markdown files, and it calls plain <code>.excalidraw</code> files "legacy", with settings for keeping the two in step. So if you mix apps, check which of the two formats your drawings are in.</p>
<h2>Export a picture: SVG or PNG</h2>
<p>Excalidraw exports to PNG, SVG and the clipboard. A picture goes in a note the standard way, and shows in almost every editor, on GitHub, and in a static site:</p>
<pre><code>![How the parts fit together](Trip/route.svg)
</code></pre>
<p>SVG stays sharp at any size and is usually small. PNG is the safer choice for places that won't show SVG. Either way, keep the <code>.excalidraw</code> file beside it, because a picture can't be opened as a drawing again.</p>
<p>The Obsidian plugin can make that copy for you: its README says it can write a PNG or SVG each time a drawing is saved and keep it in sync. For more on paths and folders for pictures, see <a href="https://coffeetext.app/blog/images-in-markdown-mac">images in Markdown on the Mac</a>.</p>
<h2>Mermaid, when the sketch is really a diagram</h2>
<p>If what you'd draw is boxes joined by arrows, Mermaid may suit it better. You write the diagram as text in a code block, and an app that supports it draws the picture:</p>
<pre><code>```mermaid
flowchart LR
  Idea --&gt; Draft --&gt; Review --&gt; Done
```
</code></pre>
<p>The diagram lives inside the note, so search finds its words and a diff shows what changed. It won't do a floor plan, a doodle or a circle drawn around something, and the layout is chosen for you. <a href="https://coffeetext.app/blog/mermaid-diagrams-markdown">Mermaid diagrams in Markdown</a> covers the syntax and where it renders.</p>
<h2>Coffee's Whiteboard</h2>
<p>Coffee, a Mac app for Markdown notes, has a built-in whiteboard that works with <code>.excalidraw</code> files and draws them inside your notes. Its <a href="https://coffeetext.app/help/whiteboard">help page on whiteboards</a> has a picture of one in a note.</p>
<h3>Making a board</h3>
<p>Choose File › New Whiteboard…, or type / in a note and choose Whiteboard. Give it a name, and Coffee saves an <code>.excalidraw</code> file beside the note and puts this line where the caret was:</p>
<pre><code>![[Trip plan.excalidraw]]
</code></pre>
<p>The note shows the drawing under that line, fitted to the drawing and no wider than the text, in light or dark to match the note. Click it and the board opens in its own window. File › Open Whiteboard… opens an <code>.excalidraw</code> file from your notes folder or anywhere else.</p>
<h3>Drawing</h3>
<p>The toolbar has select, rectangle, ellipse, diamond, arrow, line, pen, text and an eraser, with the same single keys as Excalidraw: V, R, O, D, A, L, P, T and E. There are five colours, a fill, a bold line, zoom and Fit. Double-click a shape to write in it, or empty board to add text. Shift keeps squares, circles and straight angles, ⌘Z undoes and a whole drag is one step.</p>
<p>There's nothing to save. A change is written a moment after you make it, and the drawing in the note follows. If the file changes elsewhere while the board is open, say on another Mac, Coffee shows that version when you have nothing unsaved. If you'd changed it too, the other version stays and yours is kept beside it with "(Coffee)" in its name.</p>
<h3>The same files as Excalidraw</h3>
<p>Coffee writes Excalidraw's own JSON, in the order Excalidraw writes its fields, and keeps every field and element it doesn't use as it was. A board made in Coffee opens in excalidraw.com, and one made there opens in Coffee. Copy and paste works between the two too, because Coffee reads and writes Excalidraw's clipboard.</p>
<h3>What it leaves out</h3>
<p>Coffee's whiteboard is smaller than Excalidraw, and it's worth knowing where:</p>
<ul>
<li>Arrows don't attach to shapes. Move a box and its arrows stay where they were.</li>
<li>You can't rotate. A shape turned in Excalidraw is drawn turned, but Coffee can't turn one.</li>
<li>A picture placed on a board in Excalidraw is kept in the file but shown as a faint box.</li>
<li>It reads <code>.excalidraw</code> files, not the Markdown format the Obsidian plugin uses for new drawings.</li>
<li>There's no export to SVG or PNG. Open the board in excalidraw.com for that.</li>
</ul>
<p>If you draw a lot, Excalidraw itself does more. What Coffee adds is the drawing inside the note, in a Mac editor, without a browser tab or a plugin. For boards of cards and arrows rather than sketches, Coffee also has a <a href="https://coffeetext.app/blog/canvas-markdown-notes-mac">canvas in the JSON Canvas format</a>.</p>
<h2>Questions</h2>
<h3>Can Markdown hold a drawing?</h3>
<p>Not by itself. Markdown points at a file: an image, or a drawing file such as <code>.excalidraw</code> in apps that show one. Mermaid is the exception, a diagram written as text inside the note.</p>
<h3>Where should I keep .excalidraw files?</h3>
<p>Beside the note they belong to, or in one folder for drawings. They're ordinary files, so they sync and back up with the rest of your notes.</p>
<h3>Should I keep the .excalidraw file or a PNG?</h3>
<p>Both, if the note will be read somewhere that can't draw the format. The <code>.excalidraw</code> file is the one you can edit, and the PNG or SVG is the one everything can show.</p>
<h3>Does Coffee open drawings from excalidraw.com?</h3>
<p>Yes. Save the drawing as an <code>.excalidraw</code> file, put it in your notes folder, and link it from a note with <code>![[Name.excalidraw]]</code>, or open it with File › Open Whiteboard….</p>
<h3>Can Coffee export a board as SVG or PNG?</h3>
<p>No. Open the <code>.excalidraw</code> file in excalidraw.com and export it there.</p>
<hr />
<p>Written by Pedro Thomaz, who makes Coffee, a Markdown editor for the Mac on macOS 15 or later, and for iPhone and iPad. It's free for 14 days with no card or account, then €3 a month, €29 a year, or €79 once with two years of updates. More at <a href="https://coffeetext.app">https://coffeetext.app</a></p>
<p><em>First published on the <a href="https://coffeetext.app/blog/excalidraw-sketches-markdown-notes-mac">Coffee blog</a>.</em></p>
]]></content:encoded></item></channel></rss>