Skip to content

Commit

Permalink
[docs] Document feaLib (#1941)
Browse files Browse the repository at this point in the history
[docs] Document feaLib

* Rearrange docs by user intention, highlighting the things you can do with each component.
* Remove reference to lexer and error modules from documentation tree, since they’re not user-facing.
* I’ve added docstrings to the parser even though we only provide access to the user-facing part of the API in the main documentation, just to clarify what some of the more obscure methods do and provide links to the spec.
* AST *is* user-facing if you’re building your own feature files in code, so all classes are documented with the user in mind.
  • Loading branch information
simoncozens committed May 12, 2020
1 parent 089f24d commit ca8703f
Show file tree
Hide file tree
Showing 9 changed files with 444 additions and 126 deletions.
8 changes: 0 additions & 8 deletions Doc/source/feaLib/ast.rst

This file was deleted.

8 changes: 0 additions & 8 deletions Doc/source/feaLib/builder.rst

This file was deleted.

8 changes: 0 additions & 8 deletions Doc/source/feaLib/error.rst

This file was deleted.

49 changes: 36 additions & 13 deletions Doc/source/feaLib/index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
######
feaLib
######
#########################################
feaLib: Read/write OpenType feature files
#########################################

.. toctree::
:maxdepth: 1
fontTools' ``feaLib`` allows for the creation and parsing of Adobe
Font Development Kit for OpenType feature (``.fea``) files. The syntax
of these files is described `here <https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html>`_.

ast
builder
error
lexer
parser
The :class:`fontTools.feaLib.parser.Parser` class can be used to parse files
into an abstract syntax tree, and from there the
:class:`fontTools.feaLib.builder.Builder` class can add features to an existing
font file. You can inspect the parsed syntax tree, walk the tree and do clever
things with it, and also generate your own feature files programmatically, by
using the classes in the :mod:`fontTools.feaLib.ast` module.

.. automodule:: fontTools.feaLib
:inherited-members:
Parsing
-------

.. autoclass:: fontTools.feaLib.parser.Parser
:members: parse
:member-order: bysource

Building
---------

.. automodule:: fontTools.feaLib.builder
:members: addOpenTypeFeatures, addOpenTypeFeaturesFromString

Generation/Interrogation
------------------------

.. _`glyph-containing object`:
.. _`glyph-containing objects`:

In the below, a **glyph-containing object** is an object of one of the following
classes: :class:`GlyphName`, :class:`GlyphClass`, :class:`GlyphClassName`.

.. automodule:: fontTools.feaLib.ast
:member-order: bysource
:members:
:undoc-members:
8 changes: 0 additions & 8 deletions Doc/source/feaLib/lexer.rst

This file was deleted.

8 changes: 0 additions & 8 deletions Doc/source/feaLib/parser.rst

This file was deleted.

0 comments on commit ca8703f

Please sign in to comment.