Coder Social home page Coder Social logo

markdown2docx's Introduction

Markdown2docx

Table of Contents

Purpose

Markdown2docx will take a plain text markdown document and create a Word .docx file.

Minimal Usage

from Markdown2docx import Markdown2docx
project = Markdown2docx('README')
project.eat_soup()
project.save()

You can optionally save a copy in HTML format alongside the .docx output, and print out the default styles.

from Markdown2docx import Markdown2docx
project = Markdown2docx('README')
project.eat_soup()
project.write_html()  # optional
print(type(project.styles()))
for k, v in project.styles().items():
    print(f'stylename: {k} = {v}')
project.save()

default styles

These are the default styles applied to the document:

  • stylename: style_table = {'Medium Shading 1 Accent 3'}
  • stylename: style_quote = {'Body Text'}
  • stylename: style_body = {'Body Text'}
  • stylename: style_quote_table = {'Table Grid'}
  • stylename: toc_indicator = {'contents'}

Token substitution and commands

For details about token substitution, refer to hello.md

Create a table of contents.

The TOC will be inserted on the first and only the first match where a paragraph contains the TOC indicator. By default this is literally the word 'contents'. When the user opens the .docx document, it will display 'Right-click to update field.'

For developers.

Use a virtualenv. For extra dev tools, use:

bash
$ pip install -e .[dev]

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.