Compare commits
1
Commits
fc00034361
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
525a99f411 |
@@ -1,6 +1,6 @@
|
|||||||
# mlwerke2pdf
|
# mlwerke2pdf
|
||||||
|
|
||||||
Python module to convert texts on http://www.mlwerke.de into Portable Document Format files
|
Python module to convert texts on http://www.mlwerke.de or https://www.marxists.org into Portable Document Format files
|
||||||
|
|
||||||
mlwerke2pdf fetches the linked subsites from the given table of contents and concats them to a single pdf
|
mlwerke2pdf fetches the linked subsites from the given table of contents and concats them to a single pdf
|
||||||
|
|
||||||
@@ -9,19 +9,19 @@ converting them to pdf internal links would be possible but rather complex
|
|||||||
|
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
as pdfkit uses wkhtmltopdf you will need it. See https://pypi.org/project/pdfkit/ for instructions
|
uses python modules requests, BeautifulSoup4, urllib and weasyprint
|
||||||
|
|
||||||
# Usage as commandline util
|
# Usage as commandline util
|
||||||
python mlwerke2pdf_shutil.py -u URL -o PDF_OUTPUT_PATH
|
python mlwerke2pdf_shutil.py -u URL -o PDF_OUTPUT_PATH [--dry True optional for not writing any files]
|
||||||
|
|
||||||
use the base / table of contents of a text like http://www.mlwerke.de/me/me04/me04_459.htm as URL
|
use the base / table of contents of a text like https://www.marxists.org/deutsch/archiv/marx-engels/1848/manifest/index.htm as URL
|
||||||
|
|
||||||
# Usage as Python module
|
# Usage as Python module
|
||||||
|
|
||||||
## create MLWerke Object:
|
## create MLWerke Object:
|
||||||
mlwerk = mlwerke2pdf.MLWerk(URL)
|
mlwerk = mlwerke2pdf.MLWerk(URL)
|
||||||
|
|
||||||
use the base / table of contents of a text like http://www.mlwerke.de/me/me04/me04_459.htm as URL
|
use the base / table of contents of a text like https://www.marxists.org/deutsch/archiv/marx-engels/1848/manifest/index.htm as URL
|
||||||
|
|
||||||
## generate a pdf
|
## generate a pdf
|
||||||
mlwerk.text2pdf(PDF_OUTPUT_PATH)
|
mlwerk.text2pdf(PDF_OUTPUT_PATH)
|
||||||
|
|||||||
Reference in new issue
Block a user