Loading src/coliverter/__init__.py +2 −0 Original line number Diff line number Diff line from coliverter.app import app from coliverter.convert import convert src/coliverter/app.py +0 −39 Original line number Diff line number Diff line from pathlib import Path from typing import Annotated import typer from coliverter.FileFormat import FileFormat app = typer.Typer() @app.command() def main( markdown_path: Annotated[ Path | None, typer.Argument( help="Path to the input Markdown file. If None, read Markdown from STDIN." ), ] = None, output_path: Annotated[ Path | None, typer.Argument( help="Path to the output file. If None, write output to STDOUT." ), ] = None, file_format: Annotated[ FileFormat | None, typer.Option( help="Format of the output file. If None, infer from extension in output path. If inferring is not possible, default to html." ), ] = None, ) -> None: """ Convert Markdown files into other formats, using the organization identity of Fachschaft Computerlinguistik. """ if file_format is None: try: file_format = FileFormat[output_path.suffix if output_path else None] except KeyError: file_format = FileFormat.HTML # TODO Implement this print(markdown_path, output_path, file_format) src/coliverter/convert.py 0 → 100644 +41 −0 Original line number Diff line number Diff line from pathlib import Path from typing import Annotated import typer from coliverter.FileFormat import FileFormat from coliverter.app import app @app.command() def convert( markdown_path: Annotated[ Path | None, typer.Argument( help="Path to the input Markdown file. If None, read Markdown from STDIN." ), ] = None, output_path: Annotated[ Path | None, typer.Argument( help="Path to the output file. If None, write output to STDOUT." ), ] = None, file_format: Annotated[ FileFormat | None, typer.Option( help="Format of the output file. If None, infer from extension in output path. If inferring is not possible, default to html." ), ] = None, ) -> None: """ Convert Markdown files into other formats, using the organization identity of Fachschaft Computerlinguistik. """ if file_format is None: try: file_format = FileFormat[output_path.suffix if output_path else None] except KeyError: file_format = FileFormat.HTML # TODO Implement this print(markdown_path, output_path, file_format) Loading
src/coliverter/__init__.py +2 −0 Original line number Diff line number Diff line from coliverter.app import app from coliverter.convert import convert
src/coliverter/app.py +0 −39 Original line number Diff line number Diff line from pathlib import Path from typing import Annotated import typer from coliverter.FileFormat import FileFormat app = typer.Typer() @app.command() def main( markdown_path: Annotated[ Path | None, typer.Argument( help="Path to the input Markdown file. If None, read Markdown from STDIN." ), ] = None, output_path: Annotated[ Path | None, typer.Argument( help="Path to the output file. If None, write output to STDOUT." ), ] = None, file_format: Annotated[ FileFormat | None, typer.Option( help="Format of the output file. If None, infer from extension in output path. If inferring is not possible, default to html." ), ] = None, ) -> None: """ Convert Markdown files into other formats, using the organization identity of Fachschaft Computerlinguistik. """ if file_format is None: try: file_format = FileFormat[output_path.suffix if output_path else None] except KeyError: file_format = FileFormat.HTML # TODO Implement this print(markdown_path, output_path, file_format)
src/coliverter/convert.py 0 → 100644 +41 −0 Original line number Diff line number Diff line from pathlib import Path from typing import Annotated import typer from coliverter.FileFormat import FileFormat from coliverter.app import app @app.command() def convert( markdown_path: Annotated[ Path | None, typer.Argument( help="Path to the input Markdown file. If None, read Markdown from STDIN." ), ] = None, output_path: Annotated[ Path | None, typer.Argument( help="Path to the output file. If None, write output to STDOUT." ), ] = None, file_format: Annotated[ FileFormat | None, typer.Option( help="Format of the output file. If None, infer from extension in output path. If inferring is not possible, default to html." ), ] = None, ) -> None: """ Convert Markdown files into other formats, using the organization identity of Fachschaft Computerlinguistik. """ if file_format is None: try: file_format = FileFormat[output_path.suffix if output_path else None] except KeyError: file_format = FileFormat.HTML # TODO Implement this print(markdown_path, output_path, file_format)