Skip to content

Offer a more generic quarto_extract or extract_code ? #267

@cderv

Description

@cderv

Thanks for the links, loads of rich content in there, e.g. the first code chunk in the last link is as follows:

quarto inspect index.qmd | jq '
  .fileInformation[].codeCells |
  map(
    .metadata = (.metadata | to_entries | map("#| \(.key): \(.value)") | join("\n"))
  ) |
  group_by(.language) |
  map({
    language: .[0].language,
    contents: map(.metadata + "\n" + .source) | join("\n")
  })
'

I wonder if the same job could be achieved with a shorter incantation at some point e.g.

quarto extract --language=Python index.qmd

Originally posted by @Robinlovelace in #389

Related to #208 which is about R code cell

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions