-
|
Hi, excellent tool, thanks! :) I am however stumped at one particular problem: I'd like to filter away particular sections, by section depth. I couldn't figure out that out even with a lot of trials in the playground. For example I may have this .md: And I want to remove only the level-3 subsection but keep everything else, i.e. the output should be like this: Doing this like for example just leaves me with the headers and not the content. Any help is deeply appreciated :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi! Right now, you’ll need to write a custom function for this. But the next version of mq will have a built-in filter_sections function, so it’ll be much easier. With the new release, you can just do: include "section" | nodes | filter_sections(fn(x): level(x) < 3;) | collect()You can try this feature in the playground: If you want to try it, you can install the latest version with: Hope that helps! If you have any other questions, just let me know! |
Beta Was this translation helpful? Give feedback.
Hi!
Right now, you’ll need to write a custom function for this. But the next version of mq will have a built-in filter_sections function, so it’ll be much easier.
With the new release, you can just do:
You can try this feature in the playground:
Playground
If you want to try it, you can install the latest version with:
Hope that helps! If you have any other questions, just let me know!