Skip to content

ayushsquad/mdo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdo

Contains mdo CLI for previewing Markdown files and folders in your browser.

Install

Global install:

npm install -g @ayushshanker/mdo

One-off usage without installing:

npx @ayushshanker/mdo README.md
pnpm dlx @ayushshanker/mdo README.md
yarn dlx @ayushshanker/mdo README.md

Command Name

The package is published as @ayushshanker/mdo, but the executable command is:

mdo

Usage

Open the current directory in folder mode:

mdo

Open a specific Markdown file:

mdo README.md

Open a folder on a fixed port:

mdo docs --port 3000

Export a Markdown file to HTML instead of opening the browser:

mdo README.md --output README.html

Use a theme:

mdo README.md --theme earthsong
mdo README.md --theme print
mdo README.md --dark

Render math:

Inline: $a_b$ or \(a_b\)

\[
\frac{1}{2}
\]

Modes

File Mode

When you pass a Markdown file, mdo renders it to HTML.

Examples:

mdo README.md
mdo docs/intro.markdown
mdo README.md --output README.html

Folder Mode

When you pass a directory, mdo starts a local preview server and opens a directory listing in your browser.

Examples:

mdo .
mdo docs
mdo docs --port 3000

Flags

  • --dark uses the GitHub dark theme
  • --theme <name> selects github-light, github-dark, belafonte-day, belafonte-night, earth, earthsong, dracula, or print
  • --output <file> writes HTML to disk instead of opening the browser; file mode only
  • --port <port> uses a fixed port for folder mode
  • --help prints usage information
  • --version prints the package version

Notes

  • mdo with no path is the same as mdo .
  • --output only works for file mode
  • Folder mode binds to loopback only and is intended for local preview
  • Math is rendered server-side with MathJax-compatible TeX syntax
  • Inline math supports $...$ and \(...\); display math supports $$...$$ and \[...\]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors