Skip to content

Commit

Permalink
parse Org's BIBLIOGRAPHY field to YAML frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgant committed May 6, 2024
1 parent c97c8d4 commit e0567a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The package is in the early stages of development, and help from folks with more

### Document options

For now it's best to set `#+OPTIONS: toc:nil` to avoid rendering the table of contents directly in the `.qmd` document. `ox-quarto` will use Org's `TITLE`, `AUTHOR`, and `DATE` fields, if available.
For now it's best to set `#+OPTIONS: toc:nil` to avoid rendering the table of contents directly in the `.qmd` document. `ox-quarto` will use Org's `TITLE`, `AUTHOR`, `DATE`, and `BIBLIOGRAPHY` fields, if available.

- `#+QUARTO_OPTIONS` :: Limited to a single line, pass elements to Quarto's YAML frontmatter (ex., `toc:true toc-depth:2`). These will be inserted after the title, author, and date (when these elements are specified within the Org fields).

Expand Down
4 changes: 3 additions & 1 deletion ox-quarto.el
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ open HTML output from the QMD file in a browser."
(let ((quarto_yml (org-export-data (plist-get info :quarto-frontmatter) info))
(title (org-export-data (plist-get info :title) info))
(date (org-export-data (plist-get info :date) info))
(author (org-export-data (plist-get info :author) info)))
(author (org-export-data (plist-get info :author) info))
(bibliography (org-export-data (plist-get info :bibliography) info)))
(concat
"---\n"
(when title (format "title: \"%s\"\n" title))
(when date (format "date: %s\n" date))
(when author (format "author: \"%s\"\n" author))
(when bibliography (format "bibliography: %s \n" bibliography))
"\n"
(when quarto_yml (format "%s" (f-read-text quarto_yml)))
"\n"
Expand Down

0 comments on commit e0567a5

Please sign in to comment.