markdown-it-py icon indicating copy to clipboard operation
markdown-it-py copied to clipboard

Improve CI interface

Open westurner opened this issue 5 years ago • 6 comments

Is your feature request related to a problem? Please describe.

Use case: Render a snippet of markdown in a file on disk into HTML.

Describe the solution you'd like

A commandline interface to parse markdown and render HTML (and optionally configure markdown-it-py first)

Describe alternatives you've considered

I could write a script with an argparse.ArgumentParser and use that; but that might as well just be a console_scripts entry_point in markdown-it-py; in which case an actual argparse.ArgumentParser is justifiied.

Additional context

None

westurner avatar Oct 01 '20 14:10 westurner

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Oct 01 '20 14:10 welcome[bot]

Heya, note there is already a CLI interface (accepts a file or starts in interactive mode):

$ markdown-it
markdown-it-py [version 0.1.0] (interactive)
Type Ctrl-D to complete input, or Ctrl-C to exit.
>>> > **hallo** there!
...
<blockquote>
<p><strong>hallo</strong> there!</p>
</blockquote>

Its not particularly well documented though, and it can't be configured, so indeed these could be improved.

See: https://github.com/executablebooks/markdown-it-py/blob/master/markdown_it/cli/parse.py

chrisjsewell avatar Oct 01 '20 14:10 chrisjsewell

I should've looked more closely for the entry_point in setup.py.

  • #54 (Pending merge)
    • [ ] DOC: cli.parse: Add description and maybe also epilog with usage examples https://docs.python.org/3/library/argparse.html#description
    • [ ] DOC: README.md: Include output of markdown-it -h under e.g. Usage > CLI

westurner avatar Oct 01 '20 14:10 westurner

  • [ ] ENH: Add output path(s)?
  • [ ] ENH: Add way to do configuration
    • Discussion: INI / TOML / YAML / Python and/or lots of --args-to-test

westurner avatar Oct 01 '20 14:10 westurner

  • [ ] "BUG: cli.parse: return 0 for non-error" https://github.com/executablebooks/markdown-it-py/pull/55 (pending merge)

westurner avatar Oct 01 '20 16:10 westurner