Skip to main content
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

Release files for docxbuilder 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docxbuilder 1.2.0
File Size Uploaded
docxbuilder-1.2.0.tar.gz 68.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for docxbuilder 1.2.0
File Interpreter ABI Platform
docxbuilder-1.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size:142.0 kB

Release files / docxbuilder-1.2.0.tar.gz

Download URL docxbuilder-1.2.0.tar.gz
Size 68.5 kB
Tags Source
SHA-256 checksum
How to use checksums
06a1cc585f06f1ff6810000acf4f23c7f52c504cd3b980f92ce4343882ce2b0d
BLAKE2b-256 checksum
How to use checksums
c41bdee7dc480072c52492551e90da5196c0a5cd2632d4c66f0196b179760404
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / docxbuilder-1.2.0-py2.py3-none-any.whl

Download URL docxbuilder-1.2.0-py2.py3-none-any.whl
Size 73.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a458e050d5f5689c17eba4c2680e551b1a22d00380a81ce72b15a5bde439c4bd
BLAKE2b-256 checksum
How to use checksums
4c329fe10ca86bf0eb4c2bb494ba9dc1b3bfdda6bbb6da5b309d7db8ae73d02a
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.5

1 release file

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page