-
Notifications
You must be signed in to change notification settings - Fork 21
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
Renderer: option to show source code #225
Comments
There's a bit of a funky issue here. Basically quarto will look for python blocks, even in indented blocks in a qmd. So we need an escaping strategy to place source code inside qmds. So far using a function like this seems to work: def sanitize(x):
return (x
.replace("{", "{")
.replace("}", "}")
.replace("`", "`")
) It can take a string of source like this...
And turn it into this (I've added code and pre elements):
In this case, quarto doesn't read the source as having a python block to execute. |
Another potential option is to not have the source code rendered, but rather have a link to source code that opens on GitHub. Happy to break that out into another issue if that makes more sense! CC: @ncclementi @gforsyth who are interested in this for ibis docs 👀 |
I randomly came across this issue just now because I was independently frustrated that it wasn't in the Ibis docs. 😂 I actually prefer links to GitHub source, personally. |
Opened a separate issue for a feature to link to github source since it's slightly different than the original opened here. |
Let's add an option to render the source code for an object (inside a collapsed dropdown).
Still thinking about if this should happen by default 🤔
The text was updated successfully, but these errors were encountered: