crisfeim / cli-swiftdown

๐Ÿ› ๏ธ A Swift-based article generator for technical writing in .swift files. Comments become prose. Code stays as code.

Repository from Github https://github.comcrisfeim/cli-swiftdownRepository from Github https://github.comcrisfeim/cli-swiftdown

Swiftdown

status: archived maintenance: inactive type: cli-tool

Because Markdown was too mainstream.

Swiftdown lets you write entire technical articles using Swift files. Comments become prose. Code stays as code.

Motivation

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.

Features

  • // and /// comments are treated as narrative content.
  • Code blocks are preserved with syntax highlighting.
  • Generates a standalone .html file (no assets or dependencies).
  • Command-line usage.

๐Ÿ“น Demo

demo-1.mp4

๐Ÿ“ฆ Installation

Clone this repo and build:

git clone https://github.com/crisrojas/swiftdown
cd swiftdown
swift build -c release

Then add the binary to your path or use directly from .build/release/swiftdown.

Usage

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-blog

Alternatively, you can also serve the contents:

~ swiftdown serve your-swift-blog

๐Ÿง‘โ€๐Ÿ’ป Use Cases

  • Technical blog posts written entirely in Swift.
  • Annotated code walkthroughs.
  • Educational examples and tutorials.
  • Reproducible code + prose workflows for teams.

๐Ÿ›ฃ๏ธ Roadmap

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?

License

MIT โ€” You are free to use, modify, and distribute this project. Attribution is required.

Credits

  • Theme toggle styles adapted from theme-toggles by Alfred Jones โ€” MIT License.
  • Syntax highlighting provided by Splash by John Sundell.

About

๐Ÿ› ๏ธ A Swift-based article generator for technical writing in .swift files. Comments become prose. Code stays as code.

License:Other


Languages

Language:Swift 53.3%Language:CSS 24.1%Language:HTML 15.1%Language:JavaScript 7.4%Language:Shell 0.1%