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

Kramdown warnings #967

Merged
merged 2 commits into from Oct 29, 2016

Conversation

Projects
None yet
3 participants
@gpakosz
Member

gpakosz commented Oct 23, 2016

Summary

This PR does two things in two commits:

  • tell which item and rep produces a kramdown warning
  • implements warning filtering (see #675) as kramdown itself as no warning switches

To do

The :warning_filters array should be documented on https://nanoc.ws as part of the filters reference documentation.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Oct 23, 2016

Member

Looks good! There’s a couple of style issues that Travis CI complains about still.

Member

ddfreyne commented Oct 23, 2016

Looks good! There’s a couple of style issues that Travis CI complains about still.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Oct 23, 2016

Member

Does it make sense to provide the warning filters via the configuration file, rather than arguments to the filter call? That’d make the dup dance unnecessary, and I guess it’d avoid having to copy the filter warnings if you call the :kramdown filter more than once…

Member

ddfreyne commented Oct 23, 2016

Does it make sense to provide the warning filters via the configuration file, rather than arguments to the filter call? That’d make the dup dance unnecessary, and I guess it’d avoid having to copy the filter warnings if you call the :kramdown filter more than once…

@gpakosz

This comment has been minimized.

Show comment
Hide comment
@gpakosz

gpakosz Oct 23, 2016

Member

I took your comments into account.

Well in my setup, I was already doing e.g in nanoc.yaml.

# erb filter options
erb:
  trim_mode: '<>'

and then when filtering

filter :erb, @config[:erb] || {}

A quick grep didn't really exhibit existing filters reading their options straight from @config, do you want to introduce a new behavior? (which kinda opens other questions like @config[:kramdown][:warning_filters] or @config[:kramdown_warning_filters] 🤔 ?)

Member

gpakosz commented Oct 23, 2016

I took your comments into account.

Well in my setup, I was already doing e.g in nanoc.yaml.

# erb filter options
erb:
  trim_mode: '<>'

and then when filtering

filter :erb, @config[:erb] || {}

A quick grep didn't really exhibit existing filters reading their options straight from @config, do you want to introduce a new behavior? (which kinda opens other questions like @config[:kramdown][:warning_filters] or @config[:kramdown_warning_filters] 🤔 ?)

@connorshea

This comment has been minimized.

Show comment
Hide comment
@connorshea

connorshea Oct 27, 2016

This is awesome, I've wanted this myself. Thanks @gpakosz!

connorshea commented Oct 27, 2016

This is awesome, I've wanted this myself. Thanks @gpakosz!

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Oct 29, 2016

Member

I’m OK with leaving it as a filter argument, as it’s more flexible, and still leaves open the option for using the configuration in the way you described.

Is this still WIP or is it ready to go?

Member

ddfreyne commented Oct 29, 2016

I’m OK with leaving it as a filter argument, as it’s more flexible, and still leaves open the option for using the configuration in the way you described.

Is this still WIP or is it ready to go?

@ddfreyne ddfreyne merged commit e51fb4b into nanoc:master Oct 29, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gpakosz gpakosz deleted the gpakosz:kramdown-warnings branch Feb 28, 2017

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