rundel / parsermd

https://rundel.github.io/parsermd/
Other
76 stars 4 forks source link

Feature Request: Find multiple nodes, markdowns, chunks #14

Closed gadenbuie closed 3 years ago

gadenbuie commented 3 years ago

I might be missing something, but it'd be really nice to have a function like rvest::html_nodes() that will take section, type, or name references and give back a list of nodes or a filtered AST.

Maybe rmd_get_nodes() as a compliment to rmd_get_node()?

parsermd::rmd_get_node(rmd, type_refs = "rmd_chunk")
#> Error in rmd_get_node.rmd_ast(rmd, type_refs = "rmd_chunk") : 
#>  Multiple nodes match the given criteria.
rundel commented 3 years ago

Do you have a particular use case for this? My intention is something like this would be covered by the rmd_subset function (reworking that is on my roadmap to come up with something that looks and acts more like tidyselect).

gadenbuie commented 3 years ago

Oh, rmd_subset() is basically what I was looking for! It makes sense, but I found rmd_get_node() et al. first and was looking for a similarly named function. I'll keep my eye out for updates to that function. Thanks!