Open hodgesmr opened 1 month ago
Unfortunately, your example is not reproducible as you omitted nearly all the structure of your project. Please share a small and fully reproducible example.
As of right now, I cannot reproduce. preview = render.
Render | Preview |
---|---|
Let me know if this is a useful way to provide my reproducible structure.
.
├── _quarto.yml
├── index.qmd
├── posts
│ ├── _metadata.yml
│ └── dummy-post
│ └── index.ipynb
└── posts.qmd
_quarto.yml
:project:
type: website
output-dir: docs
website:
title: "Test Site"
navbar:
right:
- posts.qmd
format:
html:
theme:
- cosmo
header-includes: |
<link href="https://fonts.googleapis.com/css?family=Overpass:300,900" rel="stylesheet">
mainfont: Overpass
toc: true
link-external-newwindow: true
title-prefix: ""
index.qmd
:---
title: "Test Home"
pagetitle: "Test Home"
about:
template: trestles
---
This is a test site.
posts.qmd
:---
title: "Posts"
pagetitle: "Posts on Test Site"
listing:
contents: posts
type: default
sort: "date desc"
fields: [date, title]
date-format: iso
filter-ui: true
---
posts/_metadata.yml
:freeze: auto
title-block-banner: true
format:
html:
link-external-newwindow: true
code-block-bg: true
code-block-border-left: "#3459e6"
highlight-style: github
title-prefix: ""
posts/dummy-post/index.ipynb
:{
"cells": [
{
"cell_type": "raw",
"metadata": {
"vscode": {
"languageId": "raw"
}
},
"source": [
"---\n",
"author: \"Firstname Lastname\"\n",
"title: \"Code Rendering Test\"\n",
"jupyter: python3\n",
"date: 2024-07-21\n",
"---"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def foo(x):\n",
" y = 5\n",
" return x + y"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
With the above structure I see with quarto preview
:
But with quarto render
:
Spotted this too in Firefox webconsole:
Resource URL: file://
...
How are you running these examples? file://
makes me suspect you're double-clicking the HTML file on Windows Explorer or Finder. You should either be using a web server of your own, or quarto preview
. The file:// scheme won't work well for a number of reasons we can't avoid.
Ok, I can repro.
Note one additional bit of strangeness.
If you quarto preview
from the top-level with a clean docs
folder, navigating to the post shows what you see.
But if you instead quarto preview posts/dummy-post/index.ipynb
, you'll find the correct rendering.
I'm not sure what's to blame here.
Here's a screencap showing the issue:
https://github.com/user-attachments/assets/b26b63b1-2906-4d94-84cc-184a2ec04f2c
Bug description
Certain code block styles (eg,
code-block-border-left
andhighlight-style
) appear properly inquarto preview
but are absent inquarto render
when rendering a Jupyter notebook.Steps to reproduce
In
posts/_metadata.yml
:In
posts/2024-07-21-code-notebook/index.ipynb
:When running
quarto preview
:When running
quarto render
:Expected behavior
The output from
quarto render
should implement the code formatting options.Actual behavior
The code formatting options are not implemented when
quarto render
.Your environment
Quarto check output