Giter VIP home page Giter VIP logo

docxbuilder's Introduction

docxbuilder

Documentation Status

Docxbuilder is a Sphinx extension to build docx formatted documents.

Note

This extension is developed based on sphinx-docxbuilder. Though, there is no compatibility between these extensions.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.