Because Markdown was too mainstream.
Swiftdown lets you write entire technical articles using Swift files. Comments become prose. Code stays as code.
Writing in Markdown is fine. But for developers writing about Swift, it's disconnected. Swiftodwn keeps everything in the same medium:
- Write and explain code using
//comments. - Structure your article using code blocks.
- Export to HTML in one command.
All within the comfort of a .swift file.
//and///comments are treated as narrative content.- Code blocks are preserved with syntax highlighting.
- Generates a standalone
.htmlfile (no assets or dependencies). - Command-line usage.
demo-1.mp4
Clone this repo and build:
git clone https://github.com/crisrojas/swiftdown
cd swiftdown
swift build -c releaseThen add the binary to your path or use directly from .build/release/swiftdown.
You need to structure your project as follows:
|- your-swift-blog
|- sources
|- theme
For an example theme see example folder.
Then pass it to the CLI
~ swiftdown build your-swift-blogAlternatively, you can also serve the contents:
~ swiftdown serve your-swift-blog- Technical blog posts written entirely in Swift.
- Annotated code walkthroughs.
- Educational examples and tutorials.
- Reproducible code + prose workflows for teams.
This project started as an experiment. I was tired of copy-pasting code from playgrounds into articles. I thought: why not write articles in Swift, using Swift itself?
The idea has merit, and some real utility, but also caveats.
Still, Swiftdown is mostly feature-complete. If I ever revisit it, Iโd like to add:
- Export to self-contained .html articles
swiftdown Article.swift > article.html - Project navigation, displaying files and folders with their icons.
And overall, a more Xcode-like look and feel. Imagine pointing it at your whole project and having it rendered โ wouldnโt that be cool?
MIT โ You are free to use, modify, and distribute this project. Attribution is required.
- Theme toggle styles adapted from theme-toggles by Alfred Jones โ MIT License.
- Syntax highlighting provided by Splash by John Sundell.
