Skip to content

Commit

Permalink
[docs] adding autosummary extension, restructuring doc pages
Browse files Browse the repository at this point in the history
  • Loading branch information
gferreira committed Feb 8, 2017
1 parent 25cf707 commit c821974
Show file tree
Hide file tree
Showing 19 changed files with 1,256 additions and 41 deletions.
3 changes: 2 additions & 1 deletion documentation/source/conf.py
Expand Up @@ -55,7 +55,7 @@ def __getattr__(cls, name):
# https://github.com/sphinx-doc/sphinx/issues/1254
#
from fontParts.base.base import dynamicProperty
dynamicProperty.__get__ = lambda self, *args, **kwargs: self
dynamicProperty.__get__ = lambda self, *args, **kwargs: self
#
# /MonkeyPatch
# ------------
Expand All @@ -79,6 +79,7 @@ def __getattr__(cls, name):
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
]

autodoc_member_order = 'bysource'
Expand Down
4 changes: 2 additions & 2 deletions documentation/source/environments/objects/normalizers.rst
@@ -1,9 +1,9 @@
.. highlight:: python
.. module:: fontParts.base.normalizers

##########
###########
Normalizers
##########
###########

.. autofunction:: normalizeFileFormatVersion

Expand Down
2 changes: 1 addition & 1 deletion documentation/source/index.rst
Expand Up @@ -12,7 +12,7 @@ Designers
=========

.. toctree::
:maxdepth: 2
:maxdepth: 3

gettingstarted/index
objects/index
Expand Down
82 changes: 80 additions & 2 deletions documentation/source/objects/anchor.rst
Expand Up @@ -5,13 +5,92 @@
Anchor
######

***********
Description
***********

Anchors are single points in a glyph which are not part of a contour. They can be used as reference positions for doing things like assembling components. In most font editors, anchors have a special appearance and can be edited.

::

glyph = CurrentGlyph()
for anchor in glyph.anchors:
print anchor
print anchor

********
Overview
********

Copy
====

.. autosummary::
:nosignatures:

BaseAnchor.copy

Parents
=======

.. autosummary::
:nosignatures:

BaseAnchor.glyph
BaseAnchor.layer
BaseAnchor.font

Identification
==============

.. autosummary::
:nosignatures:

BaseAnchor.name
BaseAnchor.color
BaseAnchor.identifier
BaseAnchor.index

Coordinate
==========

.. autosummary::
:nosignatures:

BaseAnchor.x
BaseAnchor.y

Transformations
===============

.. autosummary::
:nosignatures:

BaseAnchor.transformBy
BaseAnchor.moveBy
BaseAnchor.scaleBy
BaseAnchor.rotateBy
BaseAnchor.skewBy

Normalization
=============

.. autosummary::
:nosignatures:

BaseAnchor.round

Environment
===========

.. autosummary::
:nosignatures:

BaseAnchor.naked
BaseAnchor.changed

*********
Reference
*********

.. autoclass:: BaseAnchor

Expand Down Expand Up @@ -60,4 +139,3 @@ Environment

.. automethod:: BaseAnchor.naked
.. automethod:: BaseAnchor.changed

83 changes: 83 additions & 0 deletions documentation/source/objects/bpoint.rst
Expand Up @@ -5,6 +5,89 @@
bPoint
######

***********
Description
***********

The :class:`bPoint <BaseBPoint>` is a point object which mimics the old “Bezier Point” from RoboFog. It has attributes for :attr:`bcpIn <BaseBPoint.bcpIn>`, anchor, bcpOut and type. The coordinates in bcpIn and bcpOut are relative to the position of the anchor. For instance, if the bcpIn is 20 units to the left of the anchor, its coordinates would be (-20,0), regardless of the coordinates of the anchor itself. Also: bcpIn will be (0,0) when it is “on top of the anchor”, i.e. when there is no bcp it will still have a value. The parent of a bPoint is usually a :class:`Contour <BaseContour>`.



********
Overview
********

Parents
=======

.. autosummary::
:nosignatures:

BaseBPoint.contour
BaseBPoint.glyph
BaseBPoint.layer
BaseBPoint.font

Identification
==============

.. autosummary::
:nosignatures:

BaseBPoint.index

Attributes
==========

.. autosummary::
:nosignatures:

BaseBPoint.type

Points
======

.. autosummary::
:nosignatures:

BaseBPoint.anchor
BaseBPoint.bcpIn
BaseBPoint.bcpOut

Transformations
===============

.. autosummary::
:nosignatures:

BaseBPoint.transformBy
BaseBPoint.moveBy
BaseBPoint.scaleBy
BaseBPoint.rotateBy
BaseBPoint.skewBy

Normalization
=============

.. autosummary::
:nosignatures:

BaseBPoint.round

Environment
===========

.. autosummary::
:nosignatures:

BaseBPoint.naked
BaseBPoint.changed


*********
Reference
*********

.. autoclass:: BaseBPoint

Parents
Expand Down
102 changes: 102 additions & 0 deletions documentation/source/objects/component.rst
Expand Up @@ -5,6 +5,108 @@
Component
#########

***********
Description
***********

A component can be a part of a glyph, and it is a reference to another glyph in the same font. With components you can make glyphs depend on other glyphs. Changes to the base glyph will reflect in the component as well.

The parent of a component is usually a glyph. Components can be decomposed: they replace themselves with the actual outlines from the base glyph. When that happens, the link between the original and the component is broken: changes to the base glyph will no longer reflect in the glyph that had the component.

********
Overview
********

Parents
=======

.. autosummary::
:nosignatures:

BaseComponent.glyph
BaseComponent.layer
BaseComponent.font

Copy
====

.. autosummary::
:nosignatures:

BaseComponent.copy

Identification
==============

.. autosummary::
:nosignatures:

BaseComponent.identifier
BaseComponent.index

Attributes
==========

.. autosummary::
:nosignatures:

BaseComponent.baseGlyph
BaseComponent.transformation
BaseComponent.offset
BaseComponent.scale

Queries
=======

.. autosummary::
:nosignatures:

BaseComponent.bounds
BaseComponent.pointInside

Pens and Drawing
================

.. autosummary::
:nosignatures:

BaseComponent.draw
BaseComponent.drawPoints

Transformations
===============

.. autosummary::
:nosignatures:

BaseComponent.transformBy
BaseComponent.moveBy
BaseComponent.scaleBy
BaseComponent.rotateBy
BaseComponent.skewBy

Normalization
=============

.. autosummary::
:nosignatures:

BaseComponent.decompose
BaseComponent.round

Environment
===========

.. autosummary::
:nosignatures:

BaseComponent.naked
BaseComponent.changed

*********
Reference
*********

.. autoclass:: BaseComponent

Parents
Expand Down

0 comments on commit c821974

Please sign in to comment.