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

Quarto document/project variable information #1

Open
coatless opened this issue Sep 19, 2024 · 0 comments
Open

Quarto document/project variable information #1

coatless opened this issue Sep 19, 2024 · 0 comments

Comments

@coatless
Copy link
Contributor

function Pandoc(doc)
    quarto.log.output("Filter ran")

    -- https://github.com/quarto-dev/quarto-cli/blob/fa772d3d8e7681f9be0c982577fb2bd263e12b85/src/resources/lua-types/quarto/doc.lua#L9
    quarto.log.output("=== Document Variables ===")

    quarto.log.output("Filter output file:")
    quarto.log.output(quarto.doc.output_file)

    quarto.log.output("Filter input file:")
    quarto.log.output(quarto.doc.input_file)

    quarto.log.output("Output File:")
    quarto.log.output(quarto.doc.project_output_file())

    -- https://github.com/quarto-dev/quarto-cli/blob/fa772d3d8e7681f9be0c982577fb2bd263e12b85/src/resources/lua-types/quarto/project.lua#L12
    quarto.log.output("=== Project Variables ===")
    quarto.log.output("Offset:")
    quarto.log.output(quarto.project.offset)
    quarto.log.output("Directory:")
    quarto.log.output(quarto.project.directory)

    quarto.log.output("Output Directory:")
    quarto.log.output(quarto.project.output_directory)

    -- https://github.com/quarto-dev/quarto-cli/blob/fa772d3d8e7681f9be0c982577fb2bd263e12b85/src/execute/environment.ts#L16
    quarto.log.output("=== OS Environemnt ===")
    quarto.log.output(os.getenv("QUARTO_DOCUMENT_PATH"))
    quarto.log.output(os.getenv("QUARTO_PROJECT_DIR"))

    return doc
end

Gives:

Filter ran
=== Document Variables ===
Filter output file:
/Users/ronin/Documents/GitHub/quarto/project/subfolder/template.ipynb
Filter input file:
/Users/ronin/Documents/GitHub/quarto/project/subfolder/template.qmd
Output File:
subfolder/template.ipynb
=== Project Variables ===
Offset:
..
Directory:
/Users/ronin/Documents/GitHub/quarto/project
Output Directory:
/Users/ronin/Documents/GitHub/quarto/project
=== OS Environemnt ===
/Users/ronin/Documents/GitHub/quarto/project/subfolder
/Users/ronin/Documents/GitHub/quarto/project
Output created: template.ipynb
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