-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Click is far more popular and maintained than docopt.
- Loading branch information
Showing
10 changed files
with
100 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""md2pdf CLI.""" | ||
from importlib.metadata import version | ||
from pathlib import Path | ||
|
||
import click | ||
|
||
from md2pdf.core import md2pdf | ||
|
||
|
||
@click.command(name="md2pdf") | ||
@click.argument("md_file_path", type=click.Path(exists=True)) | ||
@click.argument("pdf_file_path", type=click.Path()) | ||
@click.option("--css", "css_file_path", type=click.Path(exists=True)) | ||
@click.version_option(version=version("md2pdf")) | ||
def cli(md_file_path, pdf_file_path, css_file_path): | ||
"""md2pdf command line tool.""" | ||
md2pdf( | ||
pdf_file_path, | ||
md_file_path=md_file_path, | ||
css_file_path=css_file_path, | ||
base_url=Path.cwd(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
"""md2pdf tests defaults.""" | ||
from pathlib import Path | ||
|
||
# Test files paths | ||
INPUT_CSS = 'tests/resources/input.css' | ||
INPUT_MD = 'tests/resources/input.md' | ||
OUTPUT_PDF = 'tests/resources/output.pdf' | ||
INPUT_CSS = Path("tests/assets/input.css") | ||
INPUT_MD = Path("tests/assets/input.md") | ||
OUTPUT_PDF = Path("tests/assets/output.pdf") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters