MiaoYan Blog
Notes on writing in plain Markdown and keeping notes as local files, by Tw93.
Writing in Markdown
Syntax, math, diagrams and slides in plain Markdown files.

Choosing a Markdown editor for Mac
What to check in a Mac Markdown editor: plain files, WYSIWYG or split preview, math, sync and speed, with Typora, Obsidian, iA Writer, Bear, Zettlr, VS Code and MiaoYan compared.
Markdown cheat sheet: CommonMark, GFM and extensions
The Markdown syntax you actually use, with examples, what CommonMark and GFM each define, and what MiaoYan renders on top.
LaTeX math in Markdown: syntax, KaTeX and pitfalls
Write inline and block math in Markdown, use common LaTeX constructs, avoid dollar and underscore pitfalls, and see how MiaoYan renders KaTeX.
Mermaid in Markdown: flowchart, sequence, Gantt and timeline examples
Copy-ready Mermaid examples for flowcharts, sequence diagrams, Gantt charts and timelines in Markdown, plus PlantUML and Markmap, and which ones MiaoYan renders offline.
Markdown to slides: --- separators and MiaoYan PPT mode
Turn a Markdown note into a slide deck with --- separators, configure reveal.js options, and compare Marp, reveal.js and Slidev.
Markdown to PDF on Mac
Print a MiaoYan note to a fixed A4 PDF, and switch to Pandoc, Typora, VS Code, or the Mac print dialog for paper size and margins.
Typora alternative for Mac: split preview with MiaoYan
Why people leave Typora, WYSIWYG versus split preview, what carries over (files, math, images) and where each app is stronger.
Chinese-English spacing in Markdown notes
Why Chinese writers add a space around Latin text and digits, the exceptions, and how MiaoYan's Clean Typography command applies it without touching code.
CommonMark vs GFM: which Markdown flavor to write
What CommonMark and GitHub Flavored Markdown each define, what apps add on top, which layer MiaoYan renders, and a test file to check any editor.
Markdown code blocks: fences, language tags and nesting
Write fenced and inline code in Markdown, nest a fence inside a fence, tag languages and diff blocks, and see what MiaoYan's preview highlights.
Collapsible sections in Markdown and GitHub with details
Write a collapsible section in Markdown with details and summary, keep Markdown working inside it, and see how MiaoYan previews and exports it.
Markdown escape characters: backslash, entities and code spans
Which characters a Markdown backslash escapes, when you need it, entities and code spans as alternatives, and the dollar-sign trap in MiaoYan.
Markdown footnotes: syntax, support and fallbacks
Write [^1] footnotes and definitions, see where GitHub, Pandoc and MiaoYan render them, and fix footnotes that show as plain text.
Markdown front matter: YAML, TOML and MiaoYan
Write YAML or TOML front matter for Hugo, Jekyll and Astro, see how GitHub shows it, and what MiaoYan hides in preview and export.
Markdown image syntax: insert, resize and fix paths
Insert images, set width with HTML, keep paths from breaking, and see how MiaoYan stores, previews and exports images.
Markdown line break and new line: soft, hard and <br>
Why a single newline vanishes in Markdown, how backslash, two spaces and <br> differ, and what MiaoYan's Line Break setting changes in preview and export.
Markdown links and anchors: inline, reference, headings
Inline, reference and autolinks, spaces in URLs, heading anchors on GitHub, and how MiaoYan's preview handles fragments and relative links.
Markdown tables: alignment, pipes and line breaks
Write a Markdown table, align columns, escape pipes, break lines in cells, handle wide tables in MiaoYan, and fall back to HTML for merged cells.
Markdown checkbox and checklist: - [ ] and - [x]
Make checkboxes in Markdown with - [ ] and - [x], nest them, see where they render and can be clicked, and find open tasks with ripgrep.
Markmap: turn a Markdown outline into a mind map
Turn headings and lists into a mind map with a markmap fence, what MiaoYan renders offline, which options apply, and how it differs from Mermaid.
PlantUML in Markdown: fences, server rendering and privacy
Write sequence, class and activity diagrams in a plantuml fence, how MiaoYan renders them with plantuml.com, the privacy cost, and local or Mermaid options.
What is Markdown? A plain-text way to format
What Markdown is, where it came from, the ten marks that cover most writing, how it becomes HTML, what it cannot do, and a first note in MiaoYan.
Markdown horizontal line and divider: ---, *** and ___
Three ways to write a horizontal rule, the setext heading trap under a text line, raw HTML, and what --- also does in MiaoYan.
Markdown comments: HTML comments and [//]: # (note)
Write comments in Markdown with <!-- --> or [//]: #, see where they stay hidden or leak, and how MiaoYan handles them in preview and export.
Markdown bold, italic and strikethrough, GitHub included
Write **bold**, *italic* and ~~strikethrough~~ in Markdown, see why emphasis fails next to punctuation or Chinese text, and where GitHub's strikethrough differs from CommonMark.
Markdown underline, color and center text with HTML
Markdown has no underline, color, centering or super/subscript syntax. Use HTML, and see what GitHub strips and what MiaoYan's preview renders.
Markdown blockquotes and nested lists: indent rules
Write blockquotes, lazy lines, nested quotes and [!NOTE] callouts, learn why nested lists need 2, 3 or 4 spaces, and why 4 spaces can become code.
Markdown to HTML: Pandoc, markdown-it and MiaoYan export
Convert Markdown to HTML with Pandoc, cmark-gfm or markdown-it, fragment vs full page, raw HTML safety, and what MiaoYan's HTML export includes.
Markdown to Word: Pandoc, reference.docx and MiaoYan exports
Convert Markdown to a .docx with Pandoc, set fonts including Chinese through a reference document, and what MiaoYan exports instead.
Mermaid flowchart syntax: TD, LR, shapes, edges and subgraphs
Write a Mermaid flowchart in Markdown: pick TD or LR, choose node shapes, label edges, group with subgraphs, and fix the end keyword and quoting errors.
Markdown numbered list and bullet points: syntax and rules
Write a Markdown numbered list or bullet points that render right: start numbers, all-1 lists, marker changes, loose lists, and code inside items.
Markdown indent: why spaces vanish and what works instead
Why leading spaces disappear in Markdown, and how to indent with , a full-width space, text-indent, blockquotes, list content columns, tabs or fences.
Mermaid sequence diagram: syntax, arrows and a login example
Write a Mermaid sequence diagram in Markdown: participants, arrow types, activation, notes, loop and alt blocks, autonumber, plus a login flow and fixes.
Markdown superscript and subscript: what works
Markdown has no superscript or subscript syntax. Learn when to use sup and sub tags, ^ and ~, Unicode characters or LaTeX math, and what renders in MiaoYan.
Mermaid gantt chart: dateFormat, sections and tasks
Write a Mermaid gantt chart in Markdown: dateFormat vs axisFormat, task ids and after, excludes weekends, todayMarker, tickInterval and a full release plan.
Markdown headings: ATX, setext, levels and anchors
Write Markdown headings correctly: the # syntax and its required space, setext underlines and the --- trap, heading levels, anchors, and how MiaoYan's outline works.
Markdown table of contents: manual, [TOC] and generators
Markdown has no TOC syntax. Write anchor links by hand, use [TOC] where it works, or generate one with doctoc, VS Code or Pandoc, and fix links that do not jump.
Excel to Markdown table: paste, convert and check
Turn cells copied from Excel, Numbers or Google Sheets into a Markdown table with a generator, Pandoc or awk, and check merged cells, pipes and line breaks.
Mermaid timeline in Markdown: syntax, sections and examples
Write a Mermaid timeline in Markdown with periods, several events, sections, line breaks, TD direction and colours, plus when to pick a Gantt chart instead.
Markdown definition list: syntax, support and fallbacks
Standard Markdown has no definition list. Learn the colon syntax, which tools render it, and the HTML and table fallbacks that work in MiaoYan.
How to write a README: sections, links and previews
Write a README.md that GitHub renders well: where it is found, a section order that works, relative links, badges, the outline, and what to preview first.
Mermaid ER diagram syntax: entities, crow's foot and keys
Write a Mermaid erDiagram in Markdown: read crow's foot markers, set identifying lines, add PK, FK and UK attributes, and fix common errors with a blog schema.
Markdown highlight text: ==mark== syntax and the mark tag
Highlight text in Markdown with the HTML mark tag, find out where ==text== works, change the colour with CSS, and mark added lines in code with diff.
Markdown callouts: GitHub alerts, Obsidian and more
Write a Markdown callout in GitHub alerts, Obsidian and MkDocs Material or Docusaurus syntax, and see how each looks where the renderer does not know it.
Markdown resume: write a CV in .md and export a PDF
Write your resume as one Markdown file, keep it in git, and export a clean A4 PDF with Pandoc and CSS or MiaoYan, with a full sample and page-break tips.
HTML in Markdown: which tags work and where
Use HTML in Markdown on purpose: CommonMark's HTML block rules, the nine tags GFM filters, what GitHub strips, and which tags work in MiaoYan's preview.
Markdown emoji: Unicode characters vs :shortcodes:
Type emoji as Unicode or as GitHub-style shortcodes, see where each renders, and avoid broken heading anchors when an emoji sits in a heading.
Markdown to image: export a note as a long PNG
Turn a Markdown note into one long PNG for chat or social posts with MiaoYan, a Chrome full-page screenshot, or Pandoc plus DevTools, with width tips.
Mermaid class diagram syntax: classes, relationships, generics
Write a Mermaid classDiagram in Markdown: declare classes and members, set visibility, add generics, pick relationship arrows and cardinality, and preview it.
LaTeX math symbols: Greek letters, arrows, operators and more
A KaTeX-checked list of LaTeX math symbols: Greek letters, operators, relations, arrows, big operators, accents, delimiters and spacing, plus common gotchas.
Markdown to WeChat Official Accounts: styles, code and links
Why WeChat strips stylesheets, code spaces and links, and how MiaoYan's Markdown viewer inlines CSS, turns Mermaid into 2x PNGs and formats reference links.
Convert Word, Google Docs and web pages to clean Markdown
Why Google Docs bolds whole pastes and Word flattens lists, plus three clean routes: MiaoYan's local browser converter, Pandoc with --extract-media, and Mac paste.
Mermaid state diagram syntax: stateDiagram-v2 and examples
Write Mermaid stateDiagram-v2 blocks in Markdown with [*] transitions, composite states, choice diamonds, fork and join bars, concurrent regions and syntax fixes.
Mermaid mindmap and pie chart: shapes, indent and Markmap
Draw Mermaid mindmap and pie charts in Markdown, avoid tab-and-space indentation errors, format node shapes and showData slices, and see when Markmap fits better.
Markdown image hosting: local i/ folder vs Cloudflare R2 and S3
Compare keeping Markdown images in a local i/ folder with uploading to Cloudflare R2 or Amazon S3, and set up MiaoYan's Keychain S3 / R2 uploader on Mac, iPhone and iPad.
LaTeX matrices, cases and aligned equations in Markdown
Write pmatrix, bmatrix, augmented arrays, piecewise cases and dcases, and multi-line aligned equations in Markdown with KaTeX, without losing double backslashes.
Chemical formulas in Markdown with KaTeX mhchem: \ce and \pu
Write upright chemical formulas, ion charges, isotopes, reaction arrows, precipitates and physical units in Markdown with KaTeX mhchem, offline in MiaoYan.
Markdown for academic writing: citations, math and Pandoc
Draft papers in plain Markdown with KaTeX math, mhchem chemistry and footnote popovers in MiaoYan, then compile BibTeX citations to Word or PDF with Pandoc --citeproc.
Managing notes
Keep notes as local files, link them, sync them and find them again.

Local-first Markdown notes: keep them as plain files
Why plain Markdown files in your own folder beat a locked-in notes app, what it costs, and how MiaoYan reads the folder you choose.
Sync Markdown notes across devices without a sync service
Use iCloud Drive, Nutstore, Dropbox or git to sync a Markdown notes folder, set MiaoYan's Note Location, and avoid conflict copies.
Wikilinks: [[note]] links and backlinks in Markdown
How [[wikilinks]] differ from normal Markdown links, what MiaoYan supports, how backlinks are built, and the portability trade-offs.
Markdown notes from the terminal with the miao CLI
Install the miao CLI, learn open, new, search, list and cat, script them, and use them with AI coding agents and the MiaoYan skill.
A lighter Obsidian alternative for Mac
What MiaoYan has and leaves out compared with Obsidian, how to open a vault, and which syntax carries over.
Markdown note version history: MiaoYan, Time Machine, git
How MiaoYan saves and restores note versions, where they live, their limits, and how Time Machine and git cover what it does not.
Export Apple Notes as Markdown and open the files
macOS Tahoe can export a Notes note as Markdown. Sequoia exports PDF only. Check the file, then open it in MiaoYan.
A Bear alternative for Mac: plain Markdown files
Export Bear notes to Markdown, move them into folders MiaoYan reads, and see what you lose without tags and gain with plain files.
Markdown on iPad: files, sync and editors
What an iPad Markdown setup needs, how MiaoYan opens your Mac's iCloud Drive folder, what to check when a note is missing, and other editors.
How to open a .md file on Mac
A .md file is plain text. Open it with TextEdit, Quick Look or a Markdown app, set a default app with Get Info, and avoid the rich text trap.
Zettelkasten with Markdown files: IDs, links and a weekly routine
Run a Zettelkasten in plain Markdown files: Luhmann's slip-box, atomic notes, file names, wikilinks, backlinks in MiaoYan, and when Obsidian fits better.
Obsidian vs Notion: local files or cloud workspace
Compare Obsidian and Notion on where data lives, offline use, sync and prices, collaboration, databases, export and lock-in, then decide which fits.
Export Notion and Evernote to Markdown files
Export Notion as Markdown & CSV and Evernote as ENEX, convert with evernote2md or Yarle, clean file names, images and front matter, then open the folder in MiaoYan.
Daily notes in Markdown: one file per day, plus a script
Set up a Markdown journal as one YYYY-MM-DD.md file per day, with a small template, a shell script for today's note, wikilinks between days and search.
Markdown keyboard shortcuts on Mac: macOS and MiaoYan
Look up the macOS text-editing keys and the MiaoYan V4.11.0 shortcuts for views, formatting, notes, search and export, and remap any of them in System Settings.
AI agent Markdown notes: let Claude Code read them safely
Why plain Markdown files suit Claude Code and Codex, how to give an agent your notes folder with git and read-only tasks, and what MiaoYan's skill covers.
Choosing an open-source Markdown editor for Mac
Compare active MIT, Apache and GPL Markdown editors for Mac: MiaoYan, MarkText, Zettlr, MacDown, CotEditor and VS Code, plus how to check licenses, runtimes and file lock-in.
Markdown app for iPhone: plain files, iCloud sync and reading
How plain .md files and iCloud placeholders behave on iOS, how MiaoYan keeps notes offline and edits on double tap, and how iA Writer, Taio, Obsidian and Bear compare.
An iA Writer alternative for Mac, iPhone and iPad
What iA Writer excels at versus why technical writers switch to MiaoYan for three-column folders, split Mermaid and KaTeX preview, wikilinks and slides on the same files.
Markdown tags and folders: #tags, YAML and plain files
Organize Markdown notes with real folders, inline #tags and YAML frontmatter without lock-in, avoid #123 and hex color traps, and filter with #tag and todo: in MiaoYan.
A Ulysses alternative for Mac, iPhone and iPad: plain .md files
Export Ulysses sheets to standard .md files, clean Markdown XL syntax, and open your library in MiaoYan across Mac, iPhone and iPad without a subscription.
Git for Markdown notes: setup, .gitignore and cloud-sync traps
Manage a plain Markdown notes folder with Git: fix Chinese filename escaping, use word-diff, ignore MiaoYan temp folders, and keep .git out of iCloud Drive.
Search Markdown notes fast with ripgrep, fzf and MiaoYan
Search thousands of plain .md notes from the terminal and GUI: practical ripgrep commands for tasks, tags, wikilinks and front matter, plus MiaoYan's #tag and todo: filters.
Meeting notes in Markdown: dated files, backlinks and tasks
Take and track meeting notes in plain .md files: YYYY-MM-DD file names, four-line templates, [[Project]] backlinks, todo: filters in MiaoYan, and PDF or Word exports.
Automate Markdown notes with Apple Shortcuts, Siri and URLs
Capture, append, open and search plain .md notes on iPhone, iPad and Mac using MiaoYan's Shortcuts actions, Siri phrases, Control Center buttons and miaoyan:// URLs.