diff --git a/CHANGELOG.md b/CHANGELOG.md
index e8513fc1..863dd4c3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. This change
- bugfix: handling the edge case of string hiccup carefully
- bugfix: handling `:kind/hidden` correctly in notebook generation
- applying `:kindly/options` in all hiccup-based pathways
+- bugfix: using the appropriate Quarto target format in Markdown generation
## [2-beta15] - 2024-07-27
- introducing code-and-value and horizontal layout - WIP (PR #127)
diff --git a/src/scicloj/clay/v2/page.clj b/src/scicloj/clay/v2/page.clj
index 824541be..7b40ee57 100644
--- a/src/scicloj/clay/v2/page.clj
+++ b/src/scicloj/clay/v2/page.clj
@@ -266,30 +266,33 @@
(hiccup.page/html5 head body)))
(defn md [{:as spec
- :keys [items title favicon quarto]}]
- (str
- (->> (cond-> quarto
- ;; Users may provide non-quarto specific configuration (see also html),
- ;; if so this will be added to the quarto front-matter to make them behave the same way
- title (assoc-in [:format :html :title] title)
- favicon (update-in [:format :html :include-in-header :text]
- str ""))
- yaml/generate-string
- (format "\n---\n%s\n---\n"))
- ;; " "
- (hiccup/html
- [:style (styles/main :table)]
- [:style (styles/main :md-main)]
- [:style (styles/main :main)])
- (->> items
- items->deps
- (cons :md-default)
- (include-libs spec [:js :css]))
- (->> items
- (map-indexed
- (fn [i item]
- (prepare/item->md item)))
- (string/join "\n\n"))))
+ :keys [items title favicon quarto format]}]
+ (let [quarto-target (if (= format [:quarto :revealjs])
+ :revealjs
+ :html)]
+ (str
+ "\n---\n"
+ (yaml/generate-string
+ (cond-> quarto
+ ;; Users may provide non-quarto specific configuration (see also html),
+ ;; if so this will be added to the quarto front-matter to make them behave the same way
+ title (assoc-in [:format :html :title] title)
+ favicon (update-in [:format quarto-target :include-in-header :text]
+ str "")))
+ "\n---\n"
+ (hiccup/html
+ [:style (styles/main :table)]
+ [:style (styles/main :md-main)]
+ [:style (styles/main :main)])
+ (->> items
+ items->deps
+ (cons :md-default)
+ (include-libs spec [:js :css]))
+ (->> items
+ (map-indexed
+ (fn [i item]
+ (prepare/item->md item)))
+ (string/join "\n\n")))))
(defn hiccup [{:as spec