Dynamically adding a version number to the footer #13001
-
DescriptionI'm migrating from Sphinx to Quarto for Python documentation for Starsim. In general, loving it so far :) However, in Sphinx, you could define variables programatically with Specifically, for a "website", I wanted to be able to write This didn't work, so I thought maybe I could include a My workaround is to call a small Python script that dynamically regenerates Appreciate any help! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 15 replies
-
As the footer of what? Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? The goal is to make it as easy as possible for us to recreate your problem so that we can fix it: please help us help you! Thanks. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
Sorry, I had hoped that was enough information! It's for a "website" (Python documentation, to be specific). Here's the It's more a general question rather than a specific "bug", but something like this illustrates the issue:
|
Beta Was this translation helpful? Give feedback.
-
I don't want the Quarto version, I want the version of my package :) I suppose the pre-render script is the closest to what I'm looking for, although I simply have it in the opposite order (i.e. I have a script that sets the version number and then calls Quarto, rather than Quarto calling a script that sets the version number and then does the build). Would love if you could write shortcodes in Python and R instead of Lua, though. And I'm still not clear why the |
Beta Was this translation helpful? Give feedback.
Ok, that makes sense and yes, it is a block! So let me give a full explanation:
As a very short answer, it's a shortcoming of Quarto that the
include
shortcode doesn't work on markdown values in_quarto.yml
the same way that{{< version >}}
does.Notice that I'm not calling it a bug. That's because it's a design shortcoming. The shortcoming comes when when these two following facts interact:
include
needs to make document inclusions available at the time of engine execution, and soinclude
needs to do its thing very