Skip to main content

Convert Markdown to docx with token substitution and command output substitution

Project description

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]

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

Markdown2docx-0.1.0.tar.gz (402.7 kB view details)

Uploaded Source

Built Distribution

Markdown2docx-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file Markdown2docx-0.1.0.tar.gz.

File metadata

  • Download URL: Markdown2docx-0.1.0.tar.gz
  • Upload date:
  • Size: 402.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for Markdown2docx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a3a54f75be046e662630c7f2eb570d45cc98ada9892f17e84583db24c10a7510
MD5 9fcd13a4a78ebc9824b55e0304eca3dd
BLAKE2b-256 dd26beba8114665a25e7e643a580d6d9f5e5330eff9f14ee94c6d49532e19ac3

See more details on using hashes here.

File details

Details for the file Markdown2docx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: Markdown2docx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for Markdown2docx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 026504ec82b59b9de2641366157fe11d5f3c4781b28cf6422460126dbbec7472
MD5 b13e396f658483715419144ccd72d4d7
BLAKE2b-256 a8b4f8c36f73e7cad102ea084b076283e5aab099cb36955b0faa81b5285f0e44

See more details on using hashes here.

Supported by

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