Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 7784bef

Browse files
committed
Add installation instructions
1 parent c95fc0b commit 7784bef

File tree

1 file changed

+39
-25
lines changed

1 file changed

+39
-25
lines changed

README.md

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,44 @@ for each class, structure, enumeration, and protocol
1111
as well as top-level type aliases, functions, and variables.
1212

1313
For an example of generated documentation,
14-
[check out the Wiki for our fork of Alamofire][alamofire wiki].
14+
[check out the Wiki for our fork of Alamofire][alamofire wiki].
1515

1616
> **Note**:
1717
> Output is currently limited to CommonMark,
1818
> but the plan is to support HTML and other formats as well.
1919
20-
## Usage
20+
## Command-Line Utility
2121

22-
`swift-doc` can be used from the command-line
23-
or in a [GitHub Actions][github actions] workflow.
22+
`swift-doc` can be used from the command-line on macOS and Linux.
2423

25-
### Command-Line Utility
24+
### Installation
2625

27-
To run `swift-doc` from the command-line,
28-
clone the repository
29-
and do `swift run swift-doc` from within the project directory.
26+
#### Homebrew
27+
28+
Run the following command to install using [Homebrew](https://brew.sh/):
3029

3130
```terminal
32-
$ git clone https://github.com/SwiftDocOrg/swift-doc.git
31+
$ brew install swiftdocorg/formulae/swift-doc
32+
```
33+
34+
#### Manually
35+
36+
Run the following commands to build and install manually:
37+
38+
```terminal
39+
$ git clone https://github.com/SwiftDocOrg/swift-doc
3340
$ cd swift-doc
34-
$ swift run swift-doc path/to/SwiftProject/Sources --output Documentation
41+
$ make install
42+
```
43+
44+
### Usage
45+
46+
`swift-doc` takes one or more paths and enumerates them recursively,
47+
collecting all Swift files into a single "module"
48+
and generating documentation accordingly.
49+
50+
```terminal
51+
$ swift doc path/to/SwiftProject/Sources --output Documentation
3552
$ tree Documentation
3653
$ Documentation/
3754
├── Home
@@ -40,36 +57,33 @@ $ Documentation/
4057
└── _Sidebar.md
4158
```
4259

43-
`swift-doc` takes one or more paths and enumerates them recursively,
44-
collecting all Swift files into a single "module"
45-
and generating documentation accordingly.
4660
By default,
4761
output files are written to `.build/documentation`,
4862
but you can change that with the `--output` option flag.
4963

50-
### GitHub Action
64+
## GitHub Action
5165

5266
This repository also hosts a [GitHub Action][github actions]
5367
that you can incorporate into your project's workflow.
5468

55-
The CommonMark files generated by `swift-doc`
69+
The CommonMark files generated by `swift-doc`
5670
are formatted for publication to your project's [GitHub Wiki][github wiki],
57-
which you can do with
71+
which you can do with
5872
[github-wiki-publish-action][github-wiki-publish-action].
5973
Alternatively,
6074
you could publish `swift-doc`-generated documentation to GitHub Pages,
6175
or bundle them into a release artifact.
6276

63-
#### Inputs
77+
### Inputs
6478

65-
- `inputs`:
66-
One or more paths to Swift files in your workspace.
79+
- `inputs`:
80+
One or more paths to Swift files in your workspace.
6781
(Default: `"./Sources"`)
6882
- `output`:
69-
The path for generated output.
83+
The path for generated output.
7084
(Default: `"./.build/documentation"`)
7185

72-
#### Example Workflow
86+
### Example Workflow
7387

7488
```yml
7589
name: Documentation
@@ -95,15 +109,15 @@ jobs:
95109
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
96110
```
97111
98-
* * *
112+
## Experimental Command-Line Tools
99113
100114
In addition to `swift-doc`,
101-
this project currently ships with several, experimental executables
115+
this project currently ships with several, experimental tools
102116
that offer complementary functionality.
103117
It's unclear how all everything will ultimately fit together,
104-
but for now,
118+
but for now,
105119
they're incubating in a shared monorepo
106-
(the intent is for each of them to eventually become
120+
(the intent is for each of them to eventually become
107121
an option, subcommand, or plugin of `swift-doc`).
108122

109123
* * *

0 commit comments

Comments
 (0)