markdown_convert
1.0.0
將標記文件從您的命令行轉換為PDF。
pip install markdown-convert markdown-convert是一種優雅的命令行工具,可將Markdown文件轉換為PDF,由驚人的markdown2和weasyprint庫提供支持。
與其他類似工具不同,它僅依靠Python軟件包來完成這項工作,從而消除了在Linux上運行時對任何外部系統級依賴的需求。
如果您正在運行Windows,則只需要從以下鏈接安裝GTK-3運行時:GTK-3運行時。
注意:如果您剛剛安裝了軟件包,則可能需要註銷並登錄以將
markdown-convert命令註冊到您的路徑上。
從您的終端運行markdown-convert -h以查看可用選項:
Usage:
markdown-convert [markdown_file_path] [options]
Options:
--mode=once | live
Convert the markdown file once (default) or live.
--css=[css_file_path]
Use a custom CSS file.
--out=[output_file_path]
Specify the output file path....或從包裝中導入任何功能以在您自己的代碼中使用它們:
from markdown_convert import convert , live_convert
# Convert your Markdown file to PDF once
convert ( 'README.md' , 'style.css' , 'README.pdf' )
# Convert your Markdown file to PDF every time it changes
live_convert ( 'README.md' , 'style.css' , 'README.pdf' )右鍵單擊Markdown文件,然後使用Markdown_Convert_explorer和Windows和Linux的Markdown_convert_nautilus擴展名Convert to PDF 。