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

Options from extracted gems are not output via CLI #569

Closed
ashmaroli opened this Issue Jan 21, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@ashmaroli
Copy link
Contributor

ashmaroli commented Jan 21, 2019

After having installed kramdown-2.0.0, running kramdown --help doesn't surface options from the extracted gems.

kramdown --help

I also used a Gemfile and tried again with bundle exec. Still no success!

# Gemfile

gem 'kramdown', '~> 2.0'
gem 'kramdown-parser-gfm'
$ bundle exec kramdown --help

What should a user do to surface options from kramdown-parser-gem gem in the --help output?

@gettalong gettalong self-assigned this Jan 21, 2019

@gettalong

This comment has been minimized.

Copy link
Owner

gettalong commented Jan 21, 2019

kramdown automatically loads a parser if it is used. So kramdown -i GFM still works, as would kramdown -o pdf for the PDF converter.

I'm open to suggestions for making the options of third-party extensions available to the kramdown binary.

@ashmaroli

This comment has been minimized.

Copy link
Contributor Author

ashmaroli commented Jan 21, 2019

A simple route would be a introducing a new flag say -x, --extension [GEM-NAME, [GEM_NAME_2...]]
Usage would be:

$ kramdown -x parser-gfm
# => kramdown options + GFM Parser options

$ kramdown -x parser-gfm, syntax-coderay
# => kramdown options + GFM Parser options + CodeRay options

The binary can abort with an error message if the given extension raises a LoadError exception

@gettalong

This comment has been minimized.

Copy link
Owner

gettalong commented Jan 29, 2019

I have committed a change which allows specifying extensions. Once specified, the options from the extension can be used with the binary and are shown with the --help option.

@gettalong gettalong closed this Jan 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment