rinohtype icon indicating copy to clipboard operation
rinohtype copied to clipboard

Clean up matchers

Open brechtm opened this issue 9 years ago • 3 comments

  • should a StyledMatchers have a base?
  • should the default matcher always be used as a fallback, even if a custom matcher is provided?

brechtm avatar Oct 07 '16 15:10 brechtm

Some work was done in 7ed7c1366e4a0996cb7b7b6208ea76a2b1c45805.

brechtm avatar Feb 24 '17 09:02 brechtm

Should a StyledMatcher have a base?

This would be useful in the case where the user provides a custom independent style sheet and a custom matcher (defining just a couple of extra selectors). If the style sheet depends on the default matcher, it is necessary to set it's base to an empty style sheet associated with the default matcher.

For this use case it would be useful if multiple matchers could be associated with a style sheet. ~~This would also more elegantly solve the handling of the matcher required for pygments syntax highlighting.~~ However, if the custom matcher builds on selectors defined in the default style sheet, it makes sense to be able to set it as a base for the custom matcher.

Should the default matcher always be used as a fallback, even if a custom matcher is provided?

While this would be useful for the use case described above, the user should be able to avoid using the default matcher.

brechtm avatar Feb 24 '17 09:02 brechtm

Plan of action: implement support for associating multiple matchers with a style sheet. This will already provide plently of functionality. Consider the ability to specify a base for a matcher when the need arises.

  • [ ] implement support for associating multiple matchers with a style sheet
    • [ ] what should happen when a a matcher is included twice in the hierarchy?
  • [ ] write unit tests
    • [ ] verify that selector lookup starts with the first matcher, then proceeds with the next

brechtm avatar Feb 24 '17 11:02 brechtm