Replies: 2 comments 1 reply
-
You can use a Lua filter: ---
title: "Quarto Playground"
format: gfm
filters:
- add_comment.lua
---
This is a playground for Quarto. -- file: add_comment.lua
function Pandoc(doc)
local comment = pandoc.RawBlock('html', '<!--- Generated file. Do not edit directly. --->')
table.insert(doc.blocks, 1, comment)
return doc
end Note that a comment in Quarto/Pandoc is tricky, depending on what it is for exactly, see: |
Beta Was this translation helpful? Give feedback.
-
Once again, thank you @mcanouil ! I'm not sure I'm doing it right. I've followed the Quick Start documentation for creating a new filter and got this structure: ❯ tree
.
├── add_banner
│ ├── README.md
│ ├── _extensions
│ │ └── add_banner
│ │ ├── _extension.yml
│ │ └── add_banner.lua
│ └── example.qmd
└── index.qmd I've copied your LUA code in file Running I understand from the official doc I need to have a folder ❯ tree
.
├── _extensions
│ └── add_banner
│ ├── _extension.yml
│ └── add_banner.lua
├── index.md
└── index.qmd The last thing I need to do to make it working is to replace in my And now, it works as expected. Once again, many thanks for the great support. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hi all
Did you know if it's possible to inject a warning at the top of the generated file like
// Please don't update this file because it's a generated one. Please update the .qmd file then render it again as .md
?The idea is thus to notify the user to not make changes in a file generated by Quarto but to inform him that he need update the source file and render it again.
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions