Skip to content

About

An opinionated Markdown-formatting action for Drafts on macOS and iOS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

Opinionated Markdown Formatter for Drafts

A small JavaScript action for Drafts that applies a consistent Markdown style to the current draft. It creates a formatted copy, leaves the original and its tags alone, and produces the same result when run again.

The action follows one personal Drafts workflow, so its spacing choices may not match yours. Try it on disposable text before adopting it.

Formatting choices

  • Converts double-underscore bold to double asterisks.
  • Converts single-asterisk emphasis to underscores.
  • Uses - for unordered list items.
  • Uses * * * for horizontal rules.
  • Normalizes blank lines around headings, lists, rules, and indented code blocks.

Install in Drafts

  1. Create a new Drafts action.
  2. Add a Script step.
  3. Copy format-markdown.js into the script step.
  4. Enable Allow Asynchronous Execution for that step.
  5. Run the action on a sample draft and confirm the output matches your preferences.

The action creates and opens a new draft instead of overwriting the source.

Development

The tests run the Drafts script inside a small mocked environment:

npm test

License

MIT. See LICENSE.

About

An opinionated Markdown-formatting action for Drafts on macOS and iOS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages