-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1333 from chrissimpkins/readthedocs
- Loading branch information
Showing
130 changed files
with
1,636 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
build: | ||
image: latest | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: Doc/source/conf.py | ||
fail_on_warning: false | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
formats: all | ||
|
||
# Optionally set the version of Python and requirements required to build your docs | ||
python: | ||
version: 3.8 | ||
install: | ||
- requirements: Doc/docs-requirements.txt | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# fontTools Documentation | ||
|
||
The fontTools project documentation updates continuously on Read the Docs as the project source changes. | ||
|
||
The documentation is hosted at https://fonttools.readthedocs.io/. | ||
|
||
## Contents | ||
|
||
- [How to Build Local Documentation](#how-to-build-local-documentation) | ||
- [Contributing to the fontTools Documentation](#contributing-to-the-documentation) | ||
- [Documentation License](#documentation-license) | ||
|
||
## How to Build Local Documentation | ||
|
||
### Install Dependencies | ||
|
||
You must have a Python 3 interpreter and the `pip` Python package manager installed on your system to build the fontTools documentation. | ||
|
||
Pull the fontTools project source files, create a Python virtual environment, and then install fontTools and the documentation build dependencies by executing the following commands in the root of the fontTools source repository: | ||
|
||
``` | ||
$ pip install -e . [all] | ||
$ pip install -r Doc/docs-requirements.txt | ||
``` | ||
|
||
### Build Documentation | ||
|
||
**With `make`**: execute the following command in the root of the repository: | ||
|
||
``` | ||
$ make docs | ||
``` | ||
|
||
**Without `make`**: execute the following command in the **`Doc` directory**: | ||
|
||
``` | ||
$ sphinx-build -b html source build | ||
``` | ||
|
||
Open the `Doc/build/html/index.html` file in your browser to view the documentation home page. | ||
|
||
## Contributing to the Documentation | ||
|
||
We highly encourage contributions! Please follow the instructions below to improve the documentation. | ||
|
||
### Python Docstring Style | ||
|
||
We recommend the use of Python docstrings that follow [the Google Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#381-docstrings). Our documentation build approach parses appropriately formatted docstrings into formatted documentation files. | ||
|
||
#### Function Documentation Example | ||
|
||
```python | ||
def fetch_bigtable_rows(big_table, keys, other_silly_variable=None): | ||
"""Fetches rows from a Bigtable. | ||
Retrieves rows pertaining to the given keys from the Table instance | ||
represented by big_table. Silly things may happen if | ||
other_silly_variable is not None. | ||
Args: | ||
big_table: An open Bigtable Table instance. | ||
keys: A sequence of strings representing the key of each table row | ||
to fetch. | ||
other_silly_variable: Another optional variable, that has a much | ||
longer name than the other args, and which does nothing. | ||
Returns: | ||
A dict mapping keys to the corresponding table row data | ||
fetched. Each row is represented as a tuple of strings. For | ||
example: | ||
{'Serak': ('Rigel VII', 'Preparer'), | ||
'Zim': ('Irk', 'Invader'), | ||
'Lrrr': ('Omicron Persei 8', 'Emperor')} | ||
If a key from the keys argument is missing from the dictionary, | ||
then that row was not found in the table. | ||
Raises: | ||
IOError: An error occurred accessing the bigtable.Table object. | ||
""" | ||
``` | ||
*Source: [Google Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md) (CC BY-SA 3.0)* | ||
|
||
#### Class Documentation Example | ||
|
||
```python | ||
class SampleClass(object): | ||
"""Summary of class here. | ||
Longer class information.... | ||
Longer class information.... | ||
Attributes: | ||
likes_spam: A boolean indicating if we like SPAM or not. | ||
eggs: An integer count of the eggs we have laid. | ||
""" | ||
|
||
def __init__(self, likes_spam=False): | ||
"""Inits SampleClass with blah.""" | ||
self.likes_spam = likes_spam | ||
self.eggs = 0 | ||
|
||
def public_method(self): | ||
"""Performs operation blah.""" | ||
``` | ||
*Source: [Google Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md) (CC BY-SA 3.0)* | ||
|
||
### Build Local Documentation and Review Your Changes | ||
|
||
Build a local set of HTML documentation files with the instructions above and review your changes. | ||
|
||
### Submit a Pull Request | ||
|
||
Submit a Github pull request with your proposed improvements to the documentation. | ||
|
||
Thanks for your contribution! | ||
|
||
## Documentation License | ||
|
||
The fontTools documentation is released under a [CC BY-SA 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sphinx == 3.0.2 | ||
sphinx_rtd_theme == 0.4.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ afmLib | |
###### | ||
|
||
.. automodule:: fontTools.afmLib | ||
:inherited-members: | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ agl | |
### | ||
|
||
.. automodule:: fontTools.agl | ||
:inherited-members: | ||
:members: | ||
:undoc-members: |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
########### | ||
specializer | ||
########### | ||
|
||
.. automodule:: fontTools.cffLib.specializer | ||
:inherited-members: | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
##### | ||
width | ||
##### | ||
|
||
.. automodule:: fontTools.cffLib.width | ||
:inherited-members: | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
####### | ||
builder | ||
####### | ||
|
||
.. automodule:: fontTools.colorLib.builder | ||
:inherited-members: | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
###### | ||
errors | ||
###### | ||
|
||
.. automodule:: fontTools.colorLib.errors | ||
:inherited-members: | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
######## | ||
colorLib | ||
######## | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
builder | ||
errors | ||
|
||
.. automodule:: fontTools.colorLib | ||
:inherited-members: | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.