在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):jmaupetit/md2pdf开源软件地址(OpenSource Url):https://github.com/jmaupetit/md2pdf开源编程语言(OpenSource Language):Python 77.1%开源软件介绍(OpenSource Introduction):Convert Markdown files to PDF with styles. InstallationThe easiest way to go is to use pip: $ pip install md2pdf UsageAs a CLI
For example, try to generate the project documentation with: $ md2pdf README.md README.pdf Optionally, you may load an external style (restricted to CSS2): $ md2pdf --css tests/resources/input.css README.md README.pdf As a libraryYou can use from md2pdf.core import md2pdf
md2pdf(pdf_file_path,
md_content=None,
md_file_path=None,
css_file_path=None,
base_url=None) Function arguments:
With DockerInstall Docker Pull the image: $ docker pull jmaupetit/md2pdf Now run your image: $ docker run --rm -v $PWD:/app jmaupetit/md2pdf --css styles.css INPUT.MD OUTPUT.PDF Troubleshooting on MacOSXEnsure, Weasyprint is fully functional before using md2pdf. You will find installation instructions in the project documentation: https://weasyprint.readthedocs.io/en/latest/install.html In a few words, here are the few steps you will need to follow:
$ brew install cairo pango gdk-pixbuf libxml2 libxslt libffi MiscUsing custom fonts in stylesWeasyPrint does not support the
Note that you should only define one single custom font, not a substitution list. ContributingHackingClone this project first: $ git clone [email protected]:jmaupetit/md2pdf.git Install it with its dependencies (ideally in a virtual environment): $ cd md2pdf
$ python -m venv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements-dev.txt
(venv) $ python setup.py develop Running the test suiteTo run the test suite with your active python version (virtual environment): (venv) $ pytest Lint the code via: (venv) $ flake8 Release a new versionUpload a new release to PyPI:
License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论