Skip to main content

Sphinx docx builder extension

Project description

Documentation Status

Docxbuilder is a Sphinx extension to build docx formatted documents.

Requirements

Python:

2.7, 3.5 or latter

Sphinx:

1.7.6 or later

Install

Use pip:

pip install docxbuilder

Usage

Add ‘docxbuilder’ to extensions configuration of conf.py:

extensions = ['docxbuilder']

and build your documents:

make docx

You can control the generated document by adding configurations into conf.py:

docx_documents = [
    ('index', 'docxbuilder.docx', {
         'title': project,
         'creator': author,
         'subject': 'A manual of docxbuilder',
     }, True),
]
docx_style = 'path/to/custom_style.docx'
docx_pagebreak_before_section = 1

For more details, see the documentation.

Style file

Generated docx file’s design is customized by a style file (The default style is docxbuilder/docx/style.docx). The style file is a docx file, which defines some paragraph, character, and table styles.

The below lists shows typical styles.

Character styles:

  • Emphasis

  • Strong

  • Literal

  • Hyperlink

  • Footnote Reference

Paragraph styles:

  • Body Text

  • Footnote Text

  • Definition Term

  • Literal Block

  • Image Caption, Table Caution, Literal Caption

  • Heading 1, Heading 2, …, Heading N

  • TOC Heading

  • toc 1, toc 2, …, toc N

  • List Bullet

  • List Number

Table styles:

  • Table

  • Field List

  • Admonition Note

TODO

  • Support math role and directive.

  • Support tabular_col_spec directive.

  • Support URL path for images.

Licence

MIT Licence

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

docxbuilder-1.1.4.tar.gz (67.0 kB view details)

Uploaded Source

Built Distribution

docxbuilder-1.1.4-py2.py3-none-any.whl (71.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file docxbuilder-1.1.4.tar.gz.

File metadata

  • Download URL: docxbuilder-1.1.4.tar.gz
  • Upload date:
  • Size: 67.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for docxbuilder-1.1.4.tar.gz
Algorithm Hash digest
SHA256 51f5c5bfed5eb9e5d08c2ee6f74d10d67162fd766120bde30c22ad6f4fb693d6
MD5 1fb6f1d609f5530b6d36ac71af888553
BLAKE2b-256 a81b7ec01e4ba745465668187ded00e83062fe56a7a29364046d4502ce85b3f4

See more details on using hashes here.

Provenance

File details

Details for the file docxbuilder-1.1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: docxbuilder-1.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 71.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for docxbuilder-1.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 170e3935629d916873c2f698c7a7cda2c7afbac9e52df2138f4244ea210aeba2
MD5 dc340079dcf38c89ee72306119754bc1
BLAKE2b-256 7bf5cdeb414ade54516b80629ae822fc825332ce25f58c193dc62ebb612b1da3

See more details on using hashes here.

Provenance

Supported by

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