yihui / litedown

A lightweight version of R Markdown
https://yihui.org/litedown/
Other
130 stars 1 forks source link

Rmd yaml header ignores "subtitle" #13

Closed jangorecki closed 1 day ago

jangorecki commented 6 days ago

Reporting, in case that was overlooked

---
title: nice title
subtitle: nice subtitle
author: nice author
output:
  litedown::html_format:
    meta:
      css: [default, snap]
      js: [snap]
---

if it is out of scope feel free to close

yihui commented 3 days ago

I had subtitle in mind (like abstract in #7). It's trivially easy to add to the template. I've been thinking what to do when it's not provided. Currently the template doesn't support conditional insertion, i.e., I can't do $if (subtitle)$ <div class="subtitle"><h2>$subtitle$</h2></div> $end$ like Pandoc does. Of course, it's harmless to have an empty div in the HTML output.

One possibility of making the templating system more flexible is to use litedown::fuse(), so we can do `{r} if (!is.null(subtitle)) ...`. I'm not sure if that would be an overkill.

Anyway, subtitle will be supported.

yihui commented 1 day ago

Done. Thanks!