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

FR: Supporting flavor-specific filtering #202

Open
svilupp opened this issue Aug 23, 2022 · 0 comments
Open

FR: Supporting flavor-specific filtering #202

svilupp opened this issue Aug 23, 2022 · 0 comments

Comments

@svilupp
Copy link
Contributor

svilupp commented Aug 23, 2022

Existing:
At the moment, you can include/exclude lines based on type, eg, Markdown, Notebook, script.
Example: a=1 #md will only be included in the Markdown outputs

Request:
It would be valuable to be able to filter out certain lines based on flavors of these types.
Wish: a=1 #mdq will only be included in QuartoFlavor Markdown outputs but no other Markdown
Where:

  • #md defines the type (no breaking change)
  • suffix q/c/d etc. would represent the respective flavors

Same for exclusion command.

Possible implementation:

  • Refactor the following if-conditions to produce the right regex for each type&flavour combination
  • For a given type+flavor, let's say Markdown + QuartoFlavor (code "mdq"), you would filter out any lines with a different type (!nb, !jl of any flavor) and you would filter out all "!md " or "!md "
  • With such logic, you don't need to know all flavors / produce conditions for all flavors, you simply include/filter based on the selected flavor

I'm happy to open the PR if there is an interest.

Benefits:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant