Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
nef is a command-line toolset that creates Xcode Playgrounds, verifies them by compiling, and exports Markdown, Jekyll sites, and Carbon snippets.
nef is an open-source macOS command-line toolset from the Bow Swift project that turns Xcode Playgrounds into compilable documentation, then exports it as Markdown, Jekyll sites, and Carbon code snippets.
nef, short for Nefertiti, is a toolset for creating documentation in the form of Xcode Playgrounds. It takes Xcode Playgrounds as input and produces compile-time verified documentation, Markdown files that Jekyll can consume to generate websites, and Carbon snippets for sharing code. It runs on macOS and is built with Swift Package Manager; the project is maintained by the Bow Swift team, and it is inspired by ΛNK for Kotlin and tut for Scala.
nef playground generates an Xcode Playground with support for Bow, the functional programming library for Swift; --name and --output control the result, and --platform switches between iOS and macOS.--podfile or a Cartfile with --cartfile to create a playground with your own dependencies; Bow versions, branches, and commits are selectable via --bow-version, --bow-branch, and --bow-commit.nef compile --project verifies playgrounds from the terminal, with a --use-cache flag to reuse downloaded dependencies; nef clean --project removes compilation artifacts.nef ipad --name PlaygroundName --package Package.swift --output builds an iPad Swift Playgrounds Book with external dependencies defined in a Swift Package.nef markdown --project --output converts playground pages to a Markdown project, using single-line //: and multiline /*: */ comment syntax for content.nef jekyll produces Markdown files and a sidebar.yml menu, with // nef:begin:header and // nef:begin:hidden commands to control page metadata and hide supporting code.nef carbon --project --output exports verified code as Carbon images; configuration covers background colors, 23 themes including dracula and monokai, sizes 1 through 5, 13 fonts, line numbers, and watermark.brew install nef), Swift Package Manager as a macOS library, an Xcode Editor Extension from the App Store, an iPad app called nef Playgrounds, and a GitHub badge that lets users try projects on iPad.nef compile --project YourPlayground to fail a build when a documented example stops compiling.nef jekyll, including a sidebar derived from your Xcode Playground structure.The typical workflow is: create a nef Playground with nef playground (or convert an existing one with nef playground --playground), write Swift code with Markdown comments, then run one of the export commands. For Jekyll output, nef finds every Xcode Playground in the project, treats each as a section, converts each page to Markdown, and adds a sidebar.yml. The // nef:begin: and // nef:end comment markers control header metadata and hidden sections.
The preferred method is Homebrew with brew install nef; the command warns about missing dependencies. You can also consume nef as a Swift Package Manager library in a macOS project, install the Xcode Editor Extension from the App Store, or use the nef Playgrounds app on iPad.
Yes. nef compile --project compiles playgrounds from the command line, which is designed for Continuous Integration scenarios. The --use-cache option reuses already downloaded dependencies, and nef clean removes previous build results.
Yes. You can pass a Podfile or Cartfile to nef playground to include your own dependencies, and nef ipad builds Playground Books from a Package.swift. For the Bow library specifically, you can pin a version, branch, or commit hash.
nef is open source under the Apache License 2.0. It is developed by the Bow Swift community, and contributions are accepted via issues, pull requests, and the Bow Gitter channel.
