Git Product home page Git Product logo

mistune-docx's Introduction

Mistune Docx Renderer

This tool merges a list of Markdown files into a brand new Docx file !

A template docx can be specified which implies that:

  • The template defaults styles will be used and can be tweaked to change the appereance of the final document (This template needs to have the following styles defined: BasicUserQuote for blockquotes, BasicUserList for lists, BasicUserTable for tables)
  • The template contents will be used as the first page(s) of the final documents

Markdown supported features:

  • Paragraphs
  • Bold and italic text
  • Headers (level 1 to 5)
  • Bullet lists
  • Tables with cells containing simple text (normal, bold or italic)
  • Blockquote
  • Images
  • Mathematical equations (using Sympy rendering)
  • Link
  • Page break

Every feature follow the common Markdown syntax. A list of examples can be seen into the example\ folder. Please remind that special characters such as % or " need to be espaced with a \ to be admissible.

How to use

python generate_doc.py output.docx --template example/template.docx --files examples/*.md

The command requests:

  • The name and location of the output file
  • The name and location of the template file. If not specified, uses the defaults styles of the local Word installation and an empty document.
  • The regex to locate the markdown files. If multiples Markdown files fits the specified regex, they will be prior assembled into one Markdown file following the alphabetic order.

Requirements

This tool has been tested with Python 3.5. See requirements.txt for all the libraries dependencies.

mistune-docx's People

Contributors

mjanv avatar

Watchers

James Cloos avatar

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.