Skip to main content

API reference documentation generator for FreeType.

Project description

pipeline status PyPI version

FreeType Docwriter

Docwriter is an API documentation generator for the FreeType Library that extracts and builds Markdown docs from the FreeType header files.

Installation

Run pip install docwriter (see (4) below for an automated virtualenv usage). It requires Python >= 3.5 to run.

Steps to Generate Docs

  1. Ensure docwriter is installed using pip.

  2. Clone the freetype2 repository from here.

  3. The FreeType build system can be used to generate the docs:

    sh autogen.sh
    ./configure
    make refdoc
    
  4. Alternatively, step 1 and the make target can be replaced with make refdoc-venv. This installs all requirements automatically in a separate virtual environment. More information on virtualenv usage can be found here.

Development Usage

  1. Clone this repository.

  2. Clone the freetype2 repository from here.

  3. Run pip install -r requirements.txt in your environment (virtualenv recommended).

  4. Copy the include/ directory from freetype2 to docwriter.

  5. Run in the docwriter directory:

    python -m docwriter                      \
            --prefix=ft2                     \
            --title=FreeType-2.9.1           \
            --site=reference                 \
            --output=./docs                  \
            ./include/freetype/*.h           \
            ./include/freetype/config/*.h    \
            ./include/freetype/cache/*.h
    
  6. The markdown files are generated in docs/markdown/. Static site can be built by running mkdocs build in docs/. Read more about Mkdocs here.

Usage Information

docwriter [-h] [-t T] -o DIR [-p PRE] [-s DIR] [-q | -v] files [files ...]

DocWriter Usage information

positional arguments:
  files                 list of source files to parse, wildcards are allowed

optional arguments:
  -h, --help            show this help message and exit
  -t T, --title T       set project title, as in '-t "My Project"'
  -o DIR, --output DIR  set output directory, as in '-o mydir'
  -p PRE, --prefix PRE  set documentation prefix, as in '-p ft2'
  -s DIR, --site DIR    set 'site_dir' in mkdocs.yml [default=site]
  -q, --quiet           run quietly, show only errors
  -v, --verbose         increase output verbosity

Running Tests

To test on all supported Python versions:

  1. Make sure tox is installed:

    pip install tox
    
  2. Ensure that all Python versions that you need to run the tests on are installed.

  3. Run tests:

    tox
    

To run specifc tests, use the -e argument. For example,

tox -e py37,py38

will run tests only on Python 3.7 and 3.8 (assuming they are installed). See tox.ini for all available environments.

More information on running specific tox environments can be found here.

Regression Tests

Regression tests require internet access, git, and other FreeType build dependencies, and are time-consuming. These tests are largely meant to run on Gitlab CI, but can also be run locally:

tox -e regression

License

This library is licensed under the FreeType License.

History

This library was originally written by David Turner as docmaker which collected and presented documentation in HTML. It has since been modified multiple times, including a major refactor to allow multiple output formats. The current docwriter is the biggest rewrite, with lots of changes and additions that allow it to be more flexible, readable, maintainable and usable.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docwriter-1.3.1.tar.gz (70.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docwriter-1.3.1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file docwriter-1.3.1.tar.gz.

File metadata

  • Download URL: docwriter-1.3.1.tar.gz
  • Upload date:
  • Size: 70.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for docwriter-1.3.1.tar.gz
Algorithm Hash digest
SHA256 a6dec71292d2e481b5f28be79344611fa7777cd1fcffb691439021dd72f88f10
MD5 4b9bc82c5a9f8279b656483886189bc2
BLAKE2b-256 6519f1c5497839c30ca23574cc82093e7ca5f8d6e8e159f819a8c65f50c78db3

See more details on using hashes here.

File details

Details for the file docwriter-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: docwriter-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for docwriter-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45832d8e1b889f777bf043e8e9a761a0a3f85c6f01744d603f743b9ec8525f63
MD5 e3bb4638ce65d220ef85a35f99e7b602
BLAKE2b-256 2f85c9e80d7d0eff2d2efc6dc04305938cbc4a7f23f6866d4413e3a79af4b44f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page