inbo / tutorials

A collection of technical tutorials for INBO (and anyone who's interested)
https://inbo.github.io/tutorials/
Creative Commons Attribution 4.0 International
22 stars 9 forks source link

Advice to tutorial writers: YAML key order from index.Rmd is currently not preserved #299

Closed florisvdh closed 2 years ago

florisvdh commented 2 years ago

Knitting with current RStudio (2021.09.2+382, with Pandoc 2.14.0.3) and rmarkdown (2.11) messes up YAML key order in index.md: it's resorted alphabetically. Followed up at https://github.com/rstudio/rmarkdown/issues/2297.

Example:

diff --git a/content/tutorials/spatial_crs_coding/index.md b/content/tutorials/spatial_crs_coding/index.md
index 70e28520..99fd8d8d 100644
--- a/content/tutorials/spatial_crs_coding/index.md
+++ b/content/tutorials/spatial_crs_coding/index.md
@@ -1,17 +1,24 @@
 ---
-title: "Goodbye PROJ.4! How to specify a coordinate reference system in R?"
-description: "Current good practice in specifying a CRS in R"
-authors: [florisvdh]
-date: 2021-07-08
-categories: ["r", "gis"]
-tags: ["gis", "r", "maps"]
-csl: https://raw.githubusercontent.com/citation-style-language/styles/master/research-institute-for-nature-and-forest.csl
-link-citations: TRUE
+authors:
+- florisvdh
 bibliography: bibliography.json
-output: 
+categories:
+- r
+- gis
+csl: "<https://raw.githubusercontent.com/citation-style-language/styles/master/research-institute-for-nature-and-forest.csl>"
+date: 2021-07-08
+description: Current good practice in specifying a CRS in R
+link-citations: true
+output:
   md_document:
     preserve_yaml: true
     variant: gfm+footnotes
+tags:
+- gis
+- r
+- maps
+title: Goodbye PROJ.4! How to specify a coordinate reference system in
+  R?
 ---

Obviously, it's better to not include such changes in your commits and maintain the original order of title - description etc. in index.md.

florisvdh commented 2 years ago

This was solved in the release of rmarkdown 2.12 on 2 March 2022.