Bundown is a fast all-in-one Markdown runtime and bundler.
You can install bundown
(bd
) globally using Bun:
bun i -g bundown
Bundown runs TS, JS, and Shell code. It pretty-prints and syncs code in almost any language.
bundown run
to run a Markdown file from a path or URLbundown sync
to pack/unpack code between files and Markdownbundown -h
to view helpbundown upgrade
to update Bundown
See what's planned in the roadmap.
- Improvements
bundown --print
uses improved box drawing for run & sync code printing.
- Features
bundown run <file>
now aliasesbundown <file>
.bundown sync
synchronizes Markdown codeblocks with actual code files using file tags in the codeblock metadata:--file <file>
(-f
) in a codeblock meta header sets the corresponding file.bundown <file>
does not run code blocks with a--file
flag.bundown sync <file> <dir>
(over)writes files in<dir>
with corresponding codeblocks from<file>
.bundown sync <url> <dir>
downloads and over(writes) the files in<dir>
with codeblocks from<url>
.bundown sync --print
(-p
) pretty-prints the synced files.
bundown https://example.com/file.md
runs a Markdown file from a URL.bundown --tag <tag> <file>
(-t
) runs only code blocks with the specified tag.--tag <tag>
(-t
) in a codeblock meta header tags the codeblock with<tag>
.bundown <file>
does not run code blocks with a--tag
flag.
bundown
auto-detects operating system and only runs corresponding codeblocks.--os <os>
in a codeblock meta header tags the codeblock with<os>
.linux
andmacos
/darwin
are supported<os>
tags.
bundown <dir>
auto-detects the best potential default file likereadme.md
and runs it.
- Improvements
bundown
now has a block-level args parser for advanced features.bundown
now uses abstract syntax trees to parse and manipulate Markdown.bundown --print
uses syntax highlighting for code blocks and rich text.
- Languages
bundown
can print and sync:c
,cuda
,c
,c#
,css
,diff
,go
,graphql
,.gitignore
,html
,arduino
,java
,javascript
,json
,jsx
,kotlin
,less
,lua
,makefile
,markdown
,objective-c
,perl
,php
,python
,r
,ruby
,rust
,scss
,shell
,sql
,svg
,swift
,toml
,tsx
,typescript
,xml
,vb.net
,wasm
,yaml
, and many aliases for the aforementioned.
- Improvements
bundown upgrade
fixed.
- Improvements
bundown
checks that the user hasbun@^1.0.24
installed and reports a helpful error message if not.
- Improvements
bundown upgrade
upgradesbundown
to the latest version.
- Improvements
package.json
now lists runtime dependencies.
- Features
bundown --version
(-v
) prints the version ofbundown
installed.bundown --print <file>
(-p
) pretty-prints the Markdown and syntax highlighted code blocks.bundown --help
(-h
) prints a help message.
- Improvements
bundown
now uses ANSI colors for more helpful usage messages & pretty-printing.
- Features
bundown
recognizes languages regardless of case, allowing uppercase language names in code blocks.
- Improvements
bundown
now uses a single parser loop to run faster in less lines of code.
- Features
bundown
can run multiple instances at once.bundown
returns the same exit code as the code it ran.
- Improvements
bundown
has developer tooling includingbiome
code formatting viabundown
and a.gitignore
file.
- Improvements
bundown
doesn't skip a code block if a supported language is specified in full but has extra whitespace/content on the language line.
- Features
bundown <file>
runs TypeScript, JavaScript, and Shell code blocks in Markdown files.bundown
can be installed globally usingnpm
,bun
,pnpm
, oryarn
and run from anywhere.
If you have any bugs, feature requests, etc. please open a discussion, issue or pull request as appropriate.
Before you open a PR, use this script to format the code with biome
. We use an opinionated style guide, aimed at maximizing the intuitive readability of code and minimizing noisy syntax - follow it.
We also have a roadmap of planned features and bugs we'd like to fix if you'd like to pick one up:
See what's already been done in the changelog. Please suggest changes.
- Features
bundown sync <url> <file>
downloads and over(writes) the Markdown file from<url>
into<file>
.bundown sync <dir> <file>
(over)writes codeblocks in<file>
with corresponding files from<dir>
.--no-new-blocks
does not create new codeblocks in<file>
for files in<dir>
without corresponding codeblocks.
bundown sync bundown.md .
is used to sync thebundown
codebase from a single file.bundown sync --delete
deletes files/blocks in the destination that don't exist in the source.bundown --interactive <file>
(-i
) pretty-prints each code block before running with a Y/N prompt to run it.bundown
detects potentially unsafe code and prompts the user to run interactively if so.bundown
uses source mapping to deliver helpful and traceable error messages when code blocks or individual lines of code fail.bundown ai
uses the core runtime, pretty-printing, and safe execution to deliver a great private, local, open-source alternative interface to LLM chat/search/code apps.... | bundown
can be used to pipe Markdown intobundown
instead of using a file path.bundown tasks
allows you to view and manage task lists.bundown.config.md
allows a user to set a custom color theme for Bundown.
- Improvements
bundown
should safely escape the content of Shell code when compiling to TS.bundown --print
visually formats Markdown segments (code, links, etc.) beyond just syntax highlighting.bundown --print
supports GFM style autolinks.bundown --print
supports GFM style task lists.bundown --print
supports GFM style tables.bundown --print
supports GFM style footnotes.bundown --print
converts emoji codes like:fire:
to actual emojis.bundown --print
pretty-prints math e.g. replacing common TeX characters e.g.\pi
toπ
.
- Languages
bundown
shares variables and functions between code blocks, regardless of language.bundown
can print and sync:sass
,zig
,assembly
,haskell
,lisp
,clojure
,julia
,brainfuck
,latex
, and more?bundown
can run:python
,c#
,c
,c
,zig
,rust
,php
,go
,ruby
,lua
,assembly
,wasm
,lisp
,clojure
,julia
,brainfuck
, and more?
If you have Bundown installed, you can run any of the following scripts with bundown -t <script>
We use biome
to format our code.
To format all files in the project, make sure you have biome
installed and run:
bun x biome format --write .