Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rinoh --format option is broken ("Unknown format 'reStructuredText'") #284

Closed
haferburg opened this issue Aug 30, 2021 · 3 comments
Closed
Labels
bug rinoh Command line tool

Comments

@haferburg
Copy link

haferburg commented Aug 30, 2021

http://www.mos6581.org/rinohtype/master/quickstart.html

$ rinoh --format reStructuredText demo.txt
Unknown format 'reStructuredText'. Run `rinoh --list-formats` to find out which formats are supported.

$ rinoh --list-formats
Supported input file formats:
- CommonMark (.md) [built-in]
- reStructuredText (.rst) [built-in]

What's going on?

I was able to solve it by changing the file extension to .rst. Why not provide a demo.rst in the first place?

@egamida
Copy link

egamida commented Aug 30, 2021

It looks like it links to an external file. Perhaps copy the original file in the repo updated as demo.rst or, add a new demo file, update demo instructions to rename, or update formats to include .txt.

@brechtm brechtm added bug rinoh Command line tool labels Sep 2, 2021
@brechtm brechtm changed the title Quickstart example doesn't work properly rinoh --format option is broken ("Unknown format 'reStructuredText'") Sep 2, 2021
@brechtm
Copy link
Owner

brechtm commented Sep 2, 2021

Thanks for the report. This is a regression. In addition to a fix, we need to add a test.

Why not provide a demo.rst in the first place?

Because docutils already serves this sample file. I guess it could be included in the rinohtype documentation.

or update formats to include .txt.

Not all .txt files are reStructuredText files, so we can't do that. We could have rinoh feed to file to each of the parsers and go with the first one that doesn't report any syntax errors. Still not fail proof, but it may provide a better user experience nonetheless.

brechtm added a commit that referenced this issue Mar 9, 2022
The argument needs to be compared case-insensitive
@brechtm
Copy link
Owner

brechtm commented Mar 9, 2022

rinoh will now assume reStructuredText if the extension is not known.

@brechtm brechtm closed this as completed Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rinoh Command line tool
Projects
None yet
Development

No branches or pull requests

3 participants