Skip to content

Commit bfa83a4

Browse files
authored
Merge pull request #644 from stan-dev/deprecations-vignette
Add vignette on how to handle deprecations with $format()
2 parents 6eee408 + cc86f4e commit bfa83a4

File tree

7 files changed

+438
-1
lines changed

7 files changed

+438
-1
lines changed

R/model.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,9 @@ format <- function(overwrite_file = FALSE,
914914
out_file <- self$stan_file()
915915
}
916916
cat(run_log$stdout, file = out_file, sep = "\n")
917+
if (isTRUE(overwrite_file)) {
918+
private$stan_code_ <- readLines(self$stan_file())
919+
}
917920

918921
invisible(TRUE)
919922
}

_pkgdown.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ articles:
7171
contents:
7272
- cmdstanr-internals
7373
- r-markdown
74+
- deprecations
7475
- profiling
7576
- articles-online-only/opencl
7677

docs/articles/deprecations.html

Lines changed: 276 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
2+
// be compatible with the behavior of Pandoc < 2.8).
3+
document.addEventListener('DOMContentLoaded', function(e) {
4+
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
5+
var i, h, a;
6+
for (i = 0; i < hs.length; i++) {
7+
h = hs[i];
8+
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
9+
a = h.attributes;
10+
while (a.length > 0) h.removeAttribute(a[0].name);
11+
}
12+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
2+
// be compatible with the behavior of Pandoc < 2.8).
3+
document.addEventListener('DOMContentLoaded', function(e) {
4+
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
5+
var i, h, a;
6+
for (i = 0; i < hs.length; i++) {
7+
h = hs[i];
8+
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
9+
a = h.attributes;
10+
while (a.length > 0) h.removeAttribute(a[0].name);
11+
}
12+
});

docs/articles/index.html

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)