added shutil

This commit is contained in:
Paul 2023-04-07 20:44:52 +02:00
parent 6286ebc7f6
commit e11e808613
2 changed files with 19 additions and 1 deletions

View File

@ -11,7 +11,12 @@ 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 as pdfkit uses wkhtmltopdf you will need it. See https://pypi.org/project/pdfkit/ for instructions
# Usage # Usage as commandline util
python mlwerke2pdf_shutil.py -u URL -o PDF_OUTPUT_PATH
use the base / table of contents of a text like http://www.mlwerke.de/me/me04/me04_459.htm as URL
# Usage as Python module
## create MLWerke Object: ## create MLWerke Object:
mlwerk = mlwerke2pdf.MLWerk(URL) mlwerk = mlwerke2pdf.MLWerk(URL)

13
mlwerke2pdf_shutil.py Normal file
View File

@ -0,0 +1,13 @@
import mlwerke2pdf
import argparse
parser = argparse.ArgumentParser(
prog='MLWerke2PDF',
description='convert texts on http://www.mlwerke.de into Portable Document Format files',
epilog='published under GPL-3 at https://git.roteserver.de/humorhenker/mlwerke2pdf')
parser.add_argument('-u', '--url', dest='url', help='base / table of contents of a text like http://www.mlwerke.de/me/me04/me04_459.htm', required=True)
parser.add_argument('-o', '--pdfpath', dest='pdfpath', help='path for the output pdf', required=True)
args = parser.parse_args()
mlwerke2pdf.MLWerk(args.url).text2pdf(args.pdfpath)