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.0.tar.gz (66.3 kB view details)

Uploaded Source

Built Distribution

docxbuilder-1.1.0-py2.py3-none-any.whl (71.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: docxbuilder-1.1.0.tar.gz
  • Upload date:
  • Size: 66.3 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.32.2 CPython/3.7.3

File hashes

Hashes for docxbuilder-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d93ac70af8500d978bbb5cdc9bbc8ca804c58861862e17af5ef0dd249fb11d8e
MD5 f065ef7b73c3f68c257e0ad95597bcfd
BLAKE2b-256 e53334bfbd98a75c3707208332c81cc378b1b0b071c2acc9def47296756f069f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docxbuilder-1.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 71.2 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.32.2 CPython/3.7.3

File hashes

Hashes for docxbuilder-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b932da73a4085b5981f5fb701af7704ab92cb1ab53f49da37ca9285f0578e99e
MD5 ffc0e59afd505d8c3f3dd9fe281e2c68
BLAKE2b-256 60b8ce38534528b2f260da8f485e2b542278e7762e506aa28fee39717bbbaf85

See more details on using hashes here.

Supported by

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