A documentation generator for Swift projects

Overview

swift-doc

CI

A package for generating documentation for Swift projects.

Given a directory of Swift files, swift-doc generates HTML or CommonMark (Markdown) files for each class, structure, enumeration, and protocol as well as top-level type aliases, functions, and variables.

Example Output

Requirements

Command-Line Utility

swift-doc can be used from the command-line on macOS and Linux.

Installation

Homebrew

Run the following command to install using Homebrew:

$ brew install swiftdocorg/formulae/swift-doc

If you already have swift-doc installed, run the following command to upgrade your installation:

$ brew upgrade swift-doc

If installing or upgrading fails with the message Error: Failed to download resource "swift-doc", try resetting your installation with the following commands:

$ brew uninstall swift-doc
$ brew untap swiftdocorg/formulae
$ brew install swiftdocorg/formulae/swift-doc

Docker

You can run swift-doc from the latest Docker image with the following commands:

$ docker pull swiftdoc/swift-doc:latest
$ docker run -it swiftdoc/swift-doc

Manually

Run the following commands to build and install manually:

$ git clone https://github.com/SwiftDocOrg/swift-doc
$ cd swift-doc
$ make install

If you're on Ubuntu Linux, you may need to first install the prerequisites by running the following command:

$ apt-get update
$ apt-get install -y libxml2-dev graphviz

Usage

OVERVIEW: A utility for generating documentation for Swift code.

USAGE: swift doc <subcommand>

OPTIONS:
  --version               Show the version.
  -h, --help              Show help information.

SUBCOMMANDS:
  generate                Generates Swift documentation
  coverage                Generates documentation coverage statistics for Swift
                          files
  diagram                 Generates diagram of Swift symbol relationships

Note: The swift driver provides extensibility through subcommands. If you type an unknown subcommand like swift foo, the system looks for a command called swift-foo in your PATH. This mechanism allows swift-doc to be run either directly or as swift doc.

swift-doc generate

OVERVIEW: Generates Swift documentation

USAGE: swift doc generate [<inputs> ...] --module-name <module-name> [--output <output>] [--format <format>] [--base-url <base-url>]

ARGUMENTS:
  <inputs>                One or more paths to a directory containing Swift files. 

OPTIONS:
  -n, --module-name <module-name>
                          The name of the module 
  -o, --output <output>   The path for generated output (default:
                          .build/documentation)
  -f, --format <format>   The output format (default: commonmark)
  --base-url <base-url>   The base URL used for all relative URLs in generated
                          documents. (default: /)
  --minimum-access-level <minimum-access-level>
                          The minimum access level of the symbols which should
                          be included. (default: public)
  -h, --help              Show help information.

The generate subcommand takes one or more paths and enumerates them recursively, collecting all Swift files into a single "module" and generating documentation accordingly. Any hidden directories are skipped, including .git and other directories with paths starting with a dot (.). Top-level Tests directories are skipped as well.

$ swift doc generate path/to/SwiftProject --module-name SwiftProject
$ tree .build/documentation
$ documentation/
├── Home
├── (...)
├── _Footer.md
└── _Sidebar.md

By default, output files are written to .build/documentation in CommonMark / GitHub Wiki format, but you can change that with the --output and --format option flags.

$ swift doc generate path/to/SwiftProject/Sources --module-name SwiftProject --output Documentation --format html
$ Documentation/
├── (...)
└── index.html

By default, swift-doc includes only symbols declared as public or open in the generated documentation. To include internal or private declarations, pass the --minimum-access-level flag with the specified access level.

swift-doc coverage

OVERVIEW: Generates documentation coverage statistics for Swift files

USAGE: swift doc coverage [<inputs> ...] [--output <output>]

ARGUMENTS:
  <inputs>                One or more paths to a directory containing Swift files.

OPTIONS:
  -o, --output <output>   The path for generated report 
  --minimum-access-level <minimum-access-level>
                          The minimum access level of the symbols which should
                          be included. (default: public)
  -h, --help              Show help information.

The coverage subcommand generates documentation coverage statistics for Swift files.

$ git clone https://github.com/SwiftDocOrg/SwiftSemantics.git

$ swift run swift-doc coverage SwiftSemantics/Sources --output "dcov.json"
$ cat dcov.json | jq ".data.totals"
{
  "count": 207,
  "documented": 199,
  "percent": 96.1352657004831
}

$ cat dcov.json | jq ".data.symbols[] | select(.documented == false)"
{
  "file": "SwiftSemantics/Supporting Types/GenericRequirement.swift",
  "line": 67,
  "column": 6,
  "name": "GenericRequirement.init?(_:)",
  "type": "Initializer",
  "documented": false
}
...

While there are plenty of tools for assessing test coverage for code, we weren't able to find anything analogous for documentation coverage. To this end, we've contrived a simple JSON format inspired by llvm-cov.

If you know of an existing standard that you think might be better suited for this purpose, please reach out by opening an Issue!

swift-doc diagram

OVERVIEW: Generates diagram of Swift symbol relationships

USAGE: swift doc diagram [<inputs> ...]

ARGUMENTS:
  <inputs>                One or more paths to a directory containing Swift files.

OPTIONS:
  --minimum-access-level <minimum-access-level>
                          The minimum access level of the symbols which should
                          be included. (default: public)
  -h, --help              Show help information.

The diagram subcommand generates a graph of APIs in DOT format that can be rendered by GraphViz into a diagram.

$ swift run swift-doc diagram Alamofire/Source > Alamofire.gv
$ head Alamofire.gv
digraph Anonymous {
  "Session" [shape=box];
  "NetworkReachabilityManager" [shape=box];
  "URLEncodedFormEncoder" [shape=box,peripheries=2];
  "ServerTrustManager" [shape=box];
  "MultipartFormData" [shape=box];

  subgraph cluster_Request {
    "DataRequest" [shape=box];
    "Request" [shape=box];

$ dot -T svg Alamofire.gv > Alamofire.svg

Here's an excerpt of the graph generated for Alamofire:

Excerpt of swift-doc-api Diagram for Alamofire

GitHub Action

This repository also hosts a GitHub Action that you can incorporate into your project's workflow.

The CommonMark files generated by swift-doc are formatted for publication to your project's GitHub Wiki, which you can do with github-wiki-publish-action. Alternatively, you could specify HTML format to publish documentation to GitHub Pages or bundle them into a release artifact.

Inputs

  • inputs: A path to a directory containing Swift (.swift) files in your workspace. (Default: "./Sources")
  • format: The output format ("commonmark" or "html") (Default: "commonmark")
  • module-name: The name of the module.
  • base-url: The base URL for all relative URLs generated in documents. (Default: "/")
  • output: The path for generated output. (Default: "./.build/documentation")

Example Workflow

# .github/workflows/documentation.yml
name: Documentation

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - name: Generate Documentation
        uses: SwiftDocOrg/swift-doc@master
        with:
          inputs: "Sources"
          module-name: MyLibrary
          output: "Documentation"
      - name: Upload Documentation to Wiki
        uses: SwiftDocOrg/github-wiki-publish-action@v1
        with:
          path: "Documentation"
        env:
          GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

Development

Web Assets

CSS assets used by the HTML output format are processed and generated by PostCSS. To make changes to these assets, you'll need to have Node.js and a package manager, such as npm, installed on your machine.

Navigate to the .node directory and run npm install to download the required tools and libraries.

$ cd .node
$ npm install

Note: package.json is located at a hidden .node subdirectory to prevent Xcode from displaying or indexing the contents of node_modules when opening the main project.

From the .node directory, run the watch script to start watching for changes to files in the Assets folder. Whenever an asset source file is added, removed, or updated, its corresponding (unoptimized) product is automatically generated in the Sources/swift-doc/Generated folder.

$ npm run watch

When you're happy with the results, commit any changes to the source files in Assets as well as the generated files in Sources/swift-doc/Generated.

$ git add Assets Sources/swift-doc/Generated
$ git commit

Release Process

The following information is primarily for the benefit of project maintainers. That said, if you have any suggestions for how to improve this process, please let us know by opening an issue.

Follow these steps to release a new version of swift-doc:

  • Verify that the latest commit passed all CI checks.
  • Update the Changelog by creating a new heading for the release and modifying the last path component for the unreleased link reference.
  • Update the version constant in the command-line executable.
  • Create a new commit with the message "Bump version to $VERSION", where $VERSION is a SemVer-compatible version number.
  • Tag that commit with the tag name "$VERSION"
  • Run the command git push origin master --tags
  • Create a new release that corresponds to the new tag.

Known Issues

  • Xcode cannot run unit tests (U) when opening the swift-doc package directly, as opposed first to generating an Xcode project file with swift package generate-xcodeproj. (The reported error is: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib). As a workaround, you can install the latest toolchain and enable it in "Xcode > Preferences > Components > Toolchains". Alternatively, you can run unit tests from the command line with swift test.

License

MIT

Contact

Mattt (@mattt)

Comments
  • Add asset pipeline for CSS

    Add asset pipeline for CSS

    Closes #44

    Notable decisions:

    • Using Parcel v2 alpha, since v1 was ridden with CSS-related bugs. Parcel community seems to have given up on v1 for PostCSS.
    • Source files placed under ./Sources/web/css. Hesitated with folder name casing...
    • Output files are in ./Assets

    Pending questions:

    • From the issue:

    Alternatively, we can just copy the files into the built documentation directory, and have our HTML point to where they'll be. Inlining CSS was something I did primarily to get beta 1 out the door.

    The swift-doc utility needs to know the path of the CSS file to copy over inside of run(), is that something we can do today with the current SPM limitations? Perhaps I am missing something.

    • If we use an external CSS path, we need to adapt the import path depending on whether the page is Home or a subpage.
    opened by kaishin 27
  • Github Action Consistently breaks

    Github Action Consistently breaks

    So 1. Thank you @mattt for all of your help on Twitter! My documentation looks amazing now! I'm not totally sure if my issue is related to #78 as we were discussing. It's very difficult for me to diagnose because it instantly fails Screen Shot 2020-04-16 at 10 01 41 PM

    Ignore the fact that I'm using the Action from my fork because the error persists when I use swiftDocOrg/swift-doc@master

    I'm wondering if there is anyway I could find a more comprehensive error log to see if this is in fact related to #78?

    bug question 
    opened by ApplebaumIan 24
  • Fatal error: could not load resource bundle

    Fatal error: could not load resource bundle

    While generating format html with the current latest version getting Illegal instruction: 4.

    Using latest Xcode Version 12.0.1 (12A7300) swift-doc version: 1.0.0-beta.5

    this is my command: swift-doc generate somePath --module-name testing --output public --format html

    Error: Fatal error: could not load resource bundle: /usr/local/bin/swift-doc_swift-doc.bundle: file swift_doc/resource_bundle_accessor.swift, line 7 Illegal instruction: 4

    Let me know if I am missing something.

    bug 
    opened by vishcshah 22
  • CI: add Windows to the CI matrix

    CI: add Windows to the CI matrix

    This adds the CI support for the Windows platform. Although this may successfully build in CI, some changes are going to be needed beyond getting it to build. Those are already in review.

    opened by compnerd 19
  • build: add a GHA for packaging swift-doc on Windows

    build: add a GHA for packaging swift-doc on Windows

    This adds a GitHub Action to package swift-doc for Windows for easy distribution. It installs to [WindowsVolume]\Library\Developer\SwiftDoc by default. This is currently not configurable, though it likely should be. However, this is the simplest configuration possible and co-locates the swift-doc package with the location of the Swift toolchain on Windows.

    opened by compnerd 13
  • dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib

    dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib

    Environment

    Xcode 11.4

    Steps

    • Pull the latest swift-doc from master
    • Open Package.swift
    • Run swift-doc target or unit tests for SwiftDoc library

    Observed result

    dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib Referenced from: /Users/kean/Library/Developer/Xcode/DerivedData/swift-doc-enlnpuwdeszizwbdykidcjodocbk/Build/Products/Debug/swift-doc Reason: image not found

    Related

    https://github.com/realm/SwiftLint/issues/3105

    opened by kean 12
  • html support

    html support

    Spent the day attempting to add HTML support using [HTMLKit](https://github.com/vapor-community/HTMLKit

    Very rudimentary html page created from the top level symbols

    fork is: https://github.com/thecb4/swift-doc.git

    If you think it's worth it, I can keep going.

    <!DOCTYPE html>
    <html>
    	<head>
    		<title>Swift Documentation</title>
    		<meta property='og:title' content='Swift Documentation'>
    			<meta name='twitter:title' content='Swift Documentation'>
    				<meta name='author' content='thebc4'>
    					<meta name='twitter:creator' content='_thecb4'>
    						<meta name='viewport' content='width=device-width, initial-scale=1.0'>
    							<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css' type='text/css'>
    							</head>
    							<body>
    								<nav class='navbar navbar-light bg-light'>
    									<span class='navbar-brand mb-0 h1'>swift-doc</span>
    								</nav>
    								<div class='p-3'>
    									<div class='row'>
    										<div class='col-2'>
    											<div class='nav flex-column nav-pills' id='v-pills-tab' role='tablist' aria-orientation='vertical'>
    												<a class='nav-link active' id='v-pills-Generic-tab' data-toggle='pill' href='#v-pills-Generic' role='tab' aria-controls='v-pills-Generic' aria-selected='false'>Generic</a>
    												<a class='nav-link' id='v-pills-Type-tab' data-toggle='pill' href='#v-pills-Type' role='tab' aria-controls='v-pills-Type' aria-selected='false'>Type</a>
    												<a class='nav-link' id='v-pills-Contextual-tab' data-toggle='pill' href='#v-pills-Contextual' role='tab' aria-controls='v-pills-Contextual' aria-selected='false'>Contextual</a>
    												<a class='nav-link' id='v-pills-SourceFile-tab' data-toggle='pill' href='#v-pills-SourceFile' role='tab' aria-controls='v-pills-SourceFile' aria-selected='false'>SourceFile</a>
    												<a class='nav-link' id='v-pills-Unknown-tab' data-toggle='pill' href='#v-pills-Unknown' role='tab' aria-controls='v-pills-Unknown' aria-selected='false'>Unknown</a>
    												<a class='nav-link' id='v-pills-Relationship-tab' data-toggle='pill' href='#v-pills-Relationship' role='tab' aria-controls='v-pills-Relationship' aria-selected='false'>Relationship</a>
    												<a class='nav-link' id='v-pills-Predicate-tab' data-toggle='pill' href='#v-pills-Predicate' role='tab' aria-controls='v-pills-Predicate' aria-selected='false'>Predicate</a>
    												<a class='nav-link' id='v-pills-API-tab' data-toggle='pill' href='#v-pills-API' role='tab' aria-controls='v-pills-API' aria-selected='false'>API</a>
    												<a class='nav-link' id='v-pills-CompilationCondition-tab' data-toggle='pill' href='#v-pills-CompilationCondition' role='tab' aria-controls='v-pills-CompilationCondition' aria-selected='false'>CompilationCondition</a>
    												<a class='nav-link' id='v-pills-Module-tab' data-toggle='pill' href='#v-pills-Module' role='tab' aria-controls='v-pills-Module' aria-selected='false'>Module</a>
    												<a class='nav-link' id='v-pills-Identifier-tab' data-toggle='pill' href='#v-pills-Identifier' role='tab' aria-controls='v-pills-Identifier' aria-selected='false'>Identifier</a>
    												<a class='nav-link' id='v-pills-Symbol-tab' data-toggle='pill' href='#v-pills-Symbol' role='tab' aria-controls='v-pills-Symbol' aria-selected='false'>Symbol</a>
    												<a class='nav-link' id='v-pills-Component-tab' data-toggle='pill' href='#v-pills-Component' role='tab' aria-controls='v-pills-Component' aria-selected='false'>Component</a>
    											</div>
    										</div>
    										<div class='col-10'>
    											<div class='tab-content' id='v-pills-tabContent'>
    												<div class='tab-pane fade show active' id='v-pills-Generic' role='tabpanel' aria-labelledby='v-pills-Generic-tab'>
    													<h2>Generic</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Type' role='tabpanel' aria-labelledby='v-pills-Type-tab'>
    													<h2>Type</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Contextual' role='tabpanel' aria-labelledby='v-pills-Contextual-tab'>
    													<h2>Contextual</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-SourceFile' role='tabpanel' aria-labelledby='v-pills-SourceFile-tab'>
    													<h2>SourceFile</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Unknown' role='tabpanel' aria-labelledby='v-pills-Unknown-tab'>
    													<h2>Unknown</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Relationship' role='tabpanel' aria-labelledby='v-pills-Relationship-tab'>
    													<h2>Relationship</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Predicate' role='tabpanel' aria-labelledby='v-pills-Predicate-tab'>
    													<h2>Predicate</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-API' role='tabpanel' aria-labelledby='v-pills-API-tab'>
    													<h2>API</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-CompilationCondition' role='tabpanel' aria-labelledby='v-pills-CompilationCondition-tab'>
    													<h2>CompilationCondition</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Module' role='tabpanel' aria-labelledby='v-pills-Module-tab'>
    													<h2>Module</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Identifier' role='tabpanel' aria-labelledby='v-pills-Identifier-tab'>
    													<h2>Identifier</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Symbol' role='tabpanel' aria-labelledby='v-pills-Symbol-tab'>
    													<h2>Symbol</h2>
    												</div>
    												<div class='tab-pane fade' id='v-pills-Component' role='tabpanel' aria-labelledby='v-pills-Component-tab'>
    													<h2>Component</h2>
    												</div>
    											</div>
    										</div>
    									</div>
    								</div>
    								<footer class='footer fixed-bottom py-4 bg-dark text-white-50'>
    									<div class='container text-center'>
    										<small>Copyright &copy; swift-doc</small>
    									</div>
    								</footer>
    								<script src='https://code.jquery.com/jquery-3.4.1.slim.min.js'></script>
    								<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js'></script>
    								<script src='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js'></script>
    							</body>
    						</html>
    
    opened by thecb4 12
  • Implement an asset pipeline for CSS, JavaScript, and images

    Implement an asset pipeline for CSS, JavaScript, and images

    opened by mattt 11
  • "File name too long" errors when saving Alamofire docs as HTML

    Just tried running this on Alamofire.

    swift doc generate Source --output swiftdoc --format html --module-name Alamofire

    (The --module-name requirement isn't documented, so perhaps the docs need to be updated?)

    The command generates some HTML but also prints many lines of "Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" and then prints a final error:

    Error: Error Domain=NSCocoaErrorDomain Code=514 "The item couldn’t be saved because the file name “DataResponseSerializerProtocol_DownloadResponseSerializerProtocol_ResponseSerializer_DataPreprocessor_PassthroughPreprocessor_GoogleXSSIPreprocessor_ResponseSerializer_DownloadResponseSerializerProtocol_DataRequest_DownloadRequest_DataRequest_DataResponseSerializer_DownloadRequest_StringResponseSerializer” is invalid." UserInfo={NSFilePath=/Users/user/Desktop/Code/Alamofire/swiftdoc/DataResponseSerializerProtocol_DownloadResponseSerializerProtocol_ResponseSerializer_DataPreprocessor_PassthroughPreprocessor_GoogleXSSIPreprocessor_ResponseSerializer_DownloadResponseSerializerProtocol_DataRequest_DownloadRequest_DataRequest_DataResponseSerializer_DownloadRequest_StringResponseSerializer, NSUnderlyingError=0x7ff552cf9f70 {Error Domain=NSPOSIXErrorDomain Code=63 "File name too long"}}

    I know there are a lot of types in the file, but that's a heck of a file name. 😆

    bug documentation enhancement 
    opened by jshier 11
  • Error: No available formula or cask with the name

    Error: No available formula or cask with the name "swiftdocorg/formulae/swift-doc".

    According to the formula given in the README...

    % brew install swiftdocorg/formulae/swift-doc 
    Error: No available formula or cask with the name "swiftdocorg/formulae/swift-doc".
    ==> Searching for similarly named formulae...
    Error: No similarly named formulae found.
    

    How come?

    opened by rudifa 9
  • Add end-to-end tests for command-line interface

    Add end-to-end tests for command-line interface

    Verifies that generated all.css contains the :root string on CI. It doesn't do any actual CSS parsing to verify its full validity, only does a simple grep check, but I hope this will be enough to prevent issues like #198 in the future.

    continuous integration 
    opened by MaxDesiatov 9
  • Fix included symbols

    Fix included symbols

    Some parts of the code base were still using the former logic from before we introduced the --minimum-access-level flag.

    This pull request will clean up all those usages and switch to the correct logic. It also fixes #301.

    opened by Lukas-Stuehrk 0
  • Displaying documentation coverage with GitHub Action?

    Displaying documentation coverage with GitHub Action?

    After a quick look at action.yml I'm not sure if it's possible to use the action just for documentation coverage checks? It would be great to use the action to check whether documentation coverage decreased in a PR against its base branch. Also, the action could log current coverage value with a diff.

    enhancement design 
    opened by MaxDesiatov 0
  • Error to load CSS in Index.html [Fix] [CSS]

    Error to load CSS in Index.html [Fix] [CSS]

    Hi! I believe there is an error generating the path to the 'all.css' file. A '/' is being placed at the very beginning, and this is not allowing it to be properly loaded into index.html.

    Result after build documentation: <link rel="stylesheet" type="text/css" href="/all.css" media="all" />

    Expected result: <link rel="stylesheet" type="text/css" href="all.css" media="all" />

    opened by TiagoSAmaral 2
  • Feature request: Declarations with a documentation comment containing `:nodoc:` are excluded from the documentation.

    Feature request: Declarations with a documentation comment containing `:nodoc:` are excluded from the documentation.

    would be great to add this to swift-doc.

    jazzy hides declarations commented with :nodoc: like this

    def self.should_document?(doc)
          return false if doc['key.doc.comment'].to_s.include?(':nodoc:')
    
    opened by spnkr 0
  • Support for local html file browsing

    Support for local html file browsing

    I was really excited when I came across this project, but quickly realized generated HTML files can't be browsed locally. In looking at issues I came across this: https://github.com/SwiftDocOrg/swift-doc/issues/25#issuecomment-609439333

    The workaround of running a local web server just won't work for our use case. We are wanting to bundle documentation with a zip of our SDK that will be browsed locally.

    For reasons I can't really take the time to go into, we can't host the source code and documentation publicly.

    It would be really awesome if a new parameter could be added to provide output specifically for local file browsing: swift doc generate -local -f html

    opened by magouyaware 0
Releases(1.0.0-rc.1)
  • 1.0.0-rc.1(Jun 1, 2021)

    Added

    • Added support for generating documentation for private symbols. #266 by @Lukas-Stuehrk.
    • Added anchor links to documentation entries for symbols. #275 by @Lukas-Stuehrk.

    Fixed

    • Fixed links to type declarations. #277 by @Lukas-Stuehrk.
    • Fixed bug that caused operator implementations to appear in the documentation although they should be omitted because of their lower access level. #264 by @Lukas-Stuehrk
    • Fixed bug that caused prefix and postfix operators to be omitted from generated documentation. #262 by @Lukas-Stuehrk.
    • Fixed layout of HTML output on large displays. #251 by @Lukas-Stuehrk and @mattt.

    Changed

    • Changed date formatters to use en_US_POSIX locale instead of current locale. #289 by @mattt.

    Removed

    • Removed Beta from header in HTML output. #291 by @mattt.
    Source code(tar.gz)
    Source code(zip)
    swift-doc-1.0.0-rc.1.big_sur.bottle.1.tar.gz(5.79 MB)
    swift-doc-1.0.0-rc.1.catalina.bottle.1.tar.gz(5.79 MB)
    swift-doc-1.0.0-rc.1.msi(5.48 MB)
  • 1.0.0-beta.6(Apr 26, 2021)

    Added

    • Added support for generating documentation for extensions to external types. #230 by @Lukas-Stuehrk and @mattt.
    • Added support for generating documentation for operators. #228 by @Lukas-Stuehrk and @mattt.
    • Added end-to-end tests for command-line interface. #199 by @MaxDesiatov and @mattt.
    • Added --minimum-access-level option to generate and coverage commands. #219 by @Lukas-Stuehrk.
    • Added support for documenting default implementations. #221 by @Lukas-Stuehrk.
    • Added sourceRange property to Symbol. #237 by @mattt.

    Fixed

    • Fixed public extensions exposing nested code of all access levels. #195 by @Tunous.
    • Fixed broken links in the relationship graph. #226 by @Lukas-Stuehrk.

    Changed

    • Breaking Change Changed minimum Swift version requirements to 5.3 or later. #252 by @mattt.
    • Changed display of code declarations in HTML. #204 by @mattt.
    • Changed serialization of Symbol to encode and decode sourceRange key instead of sourceLocation key. #237 by @mattt.
    • Changed commands to warn when invalid paths are passed. #242 by @Lukas-Stuehrk.

    Deprecated

    • Deprecated Symbol.sourceLocation property. Use Symbol.sourceRange.start instead. #237 by @mattt.
    • Changed the generate command to skip hidden files and top-level Tests directories. #229 by @mattt.
    Source code(tar.gz)
    Source code(zip)
    swift-doc-1.0.0-beta.6.big_sur.bottle.tar.gz(5.77 MB)
    swift-doc-1.0.0-beta.6.catalina.bottle.tar.gz(5.77 MB)
  • 1.0.0-beta.5(Oct 7, 2020)

    Added

    • Added support for Swift 5.3. #183 by @MaxDesiatov and @mattt.

    Fixed

    • Fixed missing GraphViz dependency in Dockerfile. #180 by @MaxDesiatov.
    • Fixed listing of function parameters, when generating CommonMark documentation. #170 by @domcorvasce.
    • Fixed version number for swift-doc command. #159 by @mattt.
    • Fixed relationship diagram to prevent linking to unknown symbols. #178 by @MattKiazyk.
    • Fixed problems in CommonMark output related to escaping emoji shortcode. #167 by @mattt.

    Changed

    • Changed GitHub Action to use prebuilt Docker image. #185 by @mattt and @MaxDesiatov.
    Source code(tar.gz)
    Source code(zip)
    swift-doc-1.0.0-beta.5.catalina.bottle.tar.gz(5.75 MB)
  • 1.0.0-beta.4(Jul 31, 2020)

    Added

    • Added icon for associated type symbols. #145 by @mattt.

    Changed

    • Changed HTML output to show scrollbars only when necessary. #132 by @andrewchang-bird.

    Fixed

    • Fixed runtime error related to networking and processes on Ubuntu Linux. #140 by @JaapWijnen.
    • Fixed whitespace of code listings. #144 by @mbrandonw.
    • Fixed crash when attempting to generate paths with no base URL specified. #127 by @mattpolzin, @kareman, and @mattt.
    • Fixed display of sidebar icons. #145 by @mattt.
    • Fixed inclusion of non-public subclasses of public superclasses. #131 by @MattKiazyk. #116 by @ApolloZhu.
    • Fixed display of bullet list items in documentation discussion parts. #130 by @mattt.
    • Fixed file and directory unexpected permissions. #146 by @niw.
    • Fixed rendering of colon sequences in function signatures as emoji shortcodes (e.g. :on: → 🔛). #149 by @mattt.
    • Fixed declarations for properties without explicit type annotations. #150 by @mattt.
    • Fixed visual regression for adjacent linked tokens in code block. #152 by @mattt.
    • Fixed regression that caused nodes in relationships graph to not have links to their corresponding symbol documentation. #153 by @mattt.
    • Fixed markup for parameter descriptions in HTML output. #156 by @mattt.
    Source code(tar.gz)
    Source code(zip)
    swift-doc-1.0.0-beta.4.catalina.bottle.tar.gz(3.13 MB)
  • 1.0.0-beta.3(May 19, 2020)

    Added

    • Added --base-url option. #65 by @kean and #93 by @mattt.
    • Added asset pipeline for CSS assets. #49 by @kaishin.
    • Add swift-doc version number to command and generated output. #94 by @mattt.

    Changed

    • Changed Home page to display globals for HTML format. #81 by @kean.
    • Changed README to clarify use of swift-doc vs. swift doc on the command line. #89 by @mattt.
    • Changed the generate command to emit a warning if no source files are found. #92 by @heckj
    • Changed CommonMark format output of Home page to include summaries alongside top-level symbols, when available. #97 by @mattt.
    • Changed logging behavior to better communicate errors encountered when generating relationship graphs using GraphViz. #100 by @mattt.
    • Changed HTML format output of Home page to move enumeration cases under initializers. #103 by @mattt.

    Fixed

    • Fixed relationship handling for members of nested types. #62 by @victor-pavlychko.
    • Fixed rendering of type relationships section when no graph data is available. #62 by @victor-pavlychko.
    • Fixed rendering of protocol requirements in the HTML version. #76 by @victor-pavlychko.
    • Fixed default location of sources reference in README #92 by @heckj
    • Fixed indentation of code examples in HTML output. #114 by @samsymons
    • Fixed icons for symbols in HTML output. #115 by @samsymons
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-beta.2(Apr 8, 2020)

    Changed

    • Breaking Change Changed the SwiftDoc GitHub Action to require a secret named GH_PERSONAL_ACCESS_TOKEN (previously GITHUB_PERSONAL_ACCESS_TOKEN). According to the GitHub Help article "Creating and storing encrypted secrets":

      Secret names cannot include any spaces or start with the GITHUB_ prefix. 8837d82 by @mattt.

    • Breaking Change Changed the SwiftDoc GitHub Action to require a module-name parameter and accepts a format parameter. b231c07 by @mattt.
    • Changed output for CommonMark format to omit Home page for output with only a single page. #55 by @mattt.
    • Changed output for CommonMark format to nest sections in Members component. #55 by @mattt.
    • Changed output for CommonMark format to remove initializer clauses from variable and enumeration case declarations. #55 by @mattt.
    • Changed CI tests to build and run with a release configuration for consistency with the executable built with make install. #51 by @mattt.
    • Changed use of print statements, replacing them with a formal logging infrastructure. #52 by @mattt.

    Fixed

    • Fixed bug in SourceFile.Visitor that caused incorrect results when determining the context of symbols parsed from Swift source files. #51 by @mattt.
    • Fixed SwiftDoc GitHub action to build against latest version of swift-doc. 5c0e4e0 by @mattt
    • Fixed output for CommonMark format to escape GitHub Emoji shortcodes #55 by @mattt.
    • Fixed output for CommonMark format to remove duplicate headings for global symbol pages. #55 by @mattt.
    • Fixed documentation for SwiftDoc GitHub Action to clarify that only a single path can be specified for the input parameter. c34ccc1 by @mattt (#19).
    • Fixed coverage subcommand description. #16 by @rastersize.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-beta.1(Apr 8, 2020)

    Added

    • Added HTML output format. #21 by @mattt.

    Changed

    • Breaking Change Changed minimum Swift version requirements to 5.2 or later. #21 by @mattt.
    • Changed command-line interface to provide functionality through subcommands. #21 by @mattt.
    • Changed Package.swift to add swift-doc executable and SwiftDoc library to the list of package products. #21 by @mattt.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Apr 8, 2020)

  • 0.1.0(Apr 8, 2020)

    Added

    • Added initial test suite for SwiftDoc target. #17 by @mattt.

    Changed

    • Changed command-line interface to use swift-argument-parser. #20 by @mattt.

    Fixed

    • Fixed treatment of members of public protocol to be considered public symbols. #17 by @mattt.

    Removed

    • Removed api-inventory subcommand. (This functionality can now be found in its own repository: https://github.com/SwiftDocOrg/swift-api-inventory) #17 by @mattt.
    Source code(tar.gz)
    Source code(zip)
  • 0.0.4(Apr 8, 2020)

    Changed

    • Changed Package.swift to include SwiftDoc library product in manifest. f852a14 by @mattt.
    • Changed documentation workflow to generate docs for SwiftDoc sources only. da04436 by @mattt.

    Fixed

    • Fixed generation to return symbols in consistent order. 97b2347 by @mattt.
    • Fixed how enumeration cases are considered to have public access level. 774faf6 by @mattt.
    Source code(tar.gz)
    Source code(zip)
  • 0.0.3(Apr 8, 2020)

    Added

    • Added CI workflow. ce40367 by @mattt.
    • Added documentation workflow. a47f178 by @mattt.

    Changed

    • Changed documentation generation to filter non-public symbols. 3af57a6 by @mattt.
    Source code(tar.gz)
    Source code(zip)
  • 0.0.2(Apr 8, 2020)

    Added

    • Added "Installation" section to README. 7784bef by @mattt.
    • Added experimental swift-api-diagram executable. 017e920 by @mattt.

    Fixed

    • Fixed division by zero when calculating documentation coverage. #5 by @mattt.
    • Fixed treatment of directories with .swift suffix. #14 by @mattt.
    • Fixed errors in README. #4 by @Dinsen. #6 by @HeEAaD. #10 by @morqon
    Source code(tar.gz)
    Source code(zip)
Owner
SwiftDoc
Documentation and resources for the Swift community
SwiftDoc
Generate Markdown documentation from source code

SourceDocs SourceDocs is a command line tool that generates markdown documentation files from inline source code comments. Similar to Sphinx or Jazzy,

Eneko Alonso 349 Dec 10, 2022
A tiny generator of random data for swift

SwiftRandom SwiftRandom is a tiny help suite for generating random data such as Random human stuff like: names, gender, titles, tags, conversations Ra

Kan Yilmaz 559 Dec 29, 2022
GenStore is a lightweight swift code generator for your resources.

GenStore is a lightweight swift code generator for your resources. GenStore can create classes for your images, colors and localized strings.

null 11 Oct 23, 2021
A software bill of materials (SBoM) generator for Swift packages

Swift Package SBoM A software bill of materials (SBoM) generator for Swift packages. Run this command to print a JSON representation of a CycloneDX SB

Mattt 17 Dec 12, 2022
Swift Quote Generator App

Swift_QuoteGeneratorApp UIKit을 이용하 SWIFT APP 예제 <> </>

null 0 Dec 27, 2021
Forblaze - A Python Mac Steganography Payload Generator

Forblaze - A Python Mac Steganography Payload Generator Author: AsaurusRex Disclaimer DO NOT use this project for purposes other than legitimate red t

null 54 Sep 5, 2022
Simple and blunt static site generator

StaticSite This contains a bunch of helper functions to generate a static site in Swift.

objc.io 33 Dec 15, 2022
qr code generator tool

qr code generator tool Small command line tool for generate and reconition qr codes written in Swift Using Usage: ./qrgen [options] -m, --mode:

Igor 3 Jul 15, 2022
An offline random passcode generator.

Passcode-Generator An offline random passcode generator. Usage Generates random passcode. Install Files and source code could be found in releases. Pr

Vaida 0 Dec 10, 2021
an Apple Watch® BINGO number generator app with histogram and history.

B4-BINGO-Number-Generator an Apple Watch® BINGO number generator app with histogram and history. This is a basic app using the Apple Watch which displ

Thomas Cavalli 1 Dec 7, 2021
SMAP: Swiss Topo Map URL Generator

smap - Swiss Topo Map URL Generator Usage: smap [-b] <image-file-path> Reads fil

Jean-Nicolas 0 Dec 29, 2021
Strong typed, autocompleted resources like images, fonts and segues in Swift projects

R.swift Get strong typed, autocompleted resources like images, fonts and segues in Swift projects Why use this? It makes your code that uses resources

Mathijs Kadijk 8.9k Jan 4, 2023
A Swift port of some of the original PersistentJXA projects by D00MFist

Persistent-Swift This repo is a Swift port of some of the original PersistentJXA projects by D00MFist (https://github.com/D00MFist/PersistentJXA). I p

Cedric Owens 25 Sep 27, 2022
SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

Gymshark 1 Jul 6, 2021
Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects

SwiftyPick ?? ?? Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects. Purpose The idea behind t

Manu Herrera 19 May 12, 2022
FeatureFlags.swift - Tools for easily defining feature flags for your projects

FeatureFlags.swift Tools for easily defining feature flags for your projects Int

Eric Rabil 1 Jan 31, 2022
iOS helper library that contains commonly used code in Uptech iOS projects

iOS helper library that contains commonly used code in Uptech iOS projects.

Uptech 1 Apr 1, 2022
A collection of common tools and commands used throughout the development process, customized for Kipple projects.

KippleTools A collection of common tools and commands used throughout the development process, customized for Kipple projects. ⚠️ The code in this lib

Kipple 10 Sep 2, 2022
BCSwiftTor - Opinionated pure Swift controller for Tor, including full support for Swift 5.5 and Swift Concurrency

BCSwiftTor Opinionated pure Swift controller for Tor, including full support for

Blockchain Commons, LLC — A “not-for-profit” benefit corporation 4 Oct 6, 2022