Python package to convert Markdown files to other formats.
Project description
markdown-convert
Python package to convert Markdown files to other formats.
With markdown-convert
, you can easily convert a Markdown file to PDF
with the following features:
- User-defined CSS styles.
- Customizable document margins.
- Live PDF compilation.
- Manual insertion of page breaks.
To start using it, simply pip install markdown-convert
.
Usage example
from markdown_convert import MarkdownFile
MarkdownFile("markdown.md").to_pdf() # One time conversion
MarkdownFile("markdown.md").live_pdf() # Real-time conversion
Documentation
MarkdownFile
init
md_path
- Path to the Markdown file.css_path='css/default.css'
- Path to the CSS file.margin_h=62
- Horizontal margin of the PDF file.margin_v=60
- Vertical margin of the PDF file.
use
-
plugin
- Name of the extension to add to the set of used extensions.The extensions
extra
andsane_lists
are included by default.
to_html
-
output_path=None
- Path to the output HTML file.If not specified, the HTML file will have the same name, but with the
.html
extension.
to_pdf
-
output_path=None
- Path to the output PDF file.If not specified, the PDF file will have the same name, but with the
.pdf
extension.
live_pdf
-
(Takes no arguments).
The PDF file will be updated whenever the Markdown file changes on disk.
Contributing
See CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.