[docs] Revise documentation building instructions and move to FAQ.md.

This commit is contained in:
Varun Gandhi
2020-09-05 17:30:57 -07:00
parent 3fe3500d98
commit ae8db93dd0
2 changed files with 30 additions and 21 deletions

View File

@@ -159,24 +159,3 @@ view of the available documentation. In particular, the documents titled
[Debugging the Swift Compiler](docs/DebuggingTheCompiler.md) and
[Continuous Integration for Swift](docs/ContinuousIntegration.md) are very
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.

View File

@@ -68,6 +68,36 @@ This very depends on what X is, but some broad guidelines are:
- Use `grep -i -r "mypattern" .`.
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
### How do I format my changes?