mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[docs] Revise documentation building instructions and move to FAQ.md.
This commit is contained in:
21
README.md
21
README.md
@@ -159,24 +159,3 @@ view of the available documentation. In particular, the documents titled
|
|||||||
[Debugging the Swift Compiler](docs/DebuggingTheCompiler.md) and
|
[Debugging the Swift Compiler](docs/DebuggingTheCompiler.md) and
|
||||||
[Continuous Integration for Swift](docs/ContinuousIntegration.md) are very
|
[Continuous Integration for Swift](docs/ContinuousIntegration.md) are very
|
||||||
helpful to understand before submitting your first PR.
|
helpful to understand before submitting your first PR.
|
||||||
|
|
||||||
### Building Documentation
|
|
||||||
|
|
||||||
To read the compiler documentation, start by installing the
|
|
||||||
[Sphinx](http://sphinx-doc.org) documentation generator tool by running the
|
|
||||||
command:
|
|
||||||
|
|
||||||
easy_install -U "Sphinx < 2.0"
|
|
||||||
|
|
||||||
Once complete, you can build the Swift documentation by changing directory into
|
|
||||||
[docs](https://github.com/apple/swift/tree/master/docs) and typing `make`. This
|
|
||||||
compiles the `.rst` files in the [docs](https://github.com/apple/swift/tree/master/docs)
|
|
||||||
directory into HTML in the `docs/_build/html` directory.
|
|
||||||
|
|
||||||
Many of the docs are out of date, but you can see some historical design
|
|
||||||
documents in the `docs` directory.
|
|
||||||
|
|
||||||
Another source of documentation is the standard library itself, located in
|
|
||||||
`stdlib`. Much of the language is actually implemented in the library
|
|
||||||
(including `Int`), and the standard library gives some examples of what can be
|
|
||||||
expressed today.
|
|
||||||
|
|||||||
@@ -68,6 +68,36 @@ This very depends on what X is, but some broad guidelines are:
|
|||||||
- Use `grep -i -r "mypattern" .`.
|
- Use `grep -i -r "mypattern" .`.
|
||||||
2. Go through the [Documentation Index](/docs/README.md).
|
2. Go through the [Documentation Index](/docs/README.md).
|
||||||
|
|
||||||
|
### How do I build the documentation as HTML?
|
||||||
|
|
||||||
|
You can build the ReST formatted documentation as HTML using Sphinx. Follow
|
||||||
|
[Sphinx's installation instructions][] and check that `sphinx-build` is
|
||||||
|
available on your `PATH`:
|
||||||
|
|
||||||
|
[Sphinx's installation instructions]: https://www.sphinx-doc.org/en/master/usage/installation.html
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sphinx-build --version
|
||||||
|
```
|
||||||
|
|
||||||
|
If that succeeds, you can build the documentation using `make`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make -C docs
|
||||||
|
```
|
||||||
|
|
||||||
|
(Tested with `sphinx-build` version 3.2.1.)
|
||||||
|
|
||||||
|
This compiles the `.rst` files in the `docs` directory into HTML in the
|
||||||
|
`docs/_build/html` directory.
|
||||||
|
|
||||||
|
For the Markdown documentation, you can view the rendered HTML directly on
|
||||||
|
GitHub. For example, this file is rendered on GitHub at
|
||||||
|
https://github.com/apple/swift/tree/master/docs/HowToGuides/FAQ.md .
|
||||||
|
|
||||||
|
HTML documentation for the standard library on Darwin platforms is hosted on the
|
||||||
|
[Apple Developer website](https://developer.apple.com/documentation/swift/swift_standard_library).
|
||||||
|
|
||||||
## Pull Request Workflow
|
## Pull Request Workflow
|
||||||
|
|
||||||
### How do I format my changes?
|
### How do I format my changes?
|
||||||
|
|||||||
Reference in New Issue
Block a user