Skip to content

Commit 539cd97

Browse files
committed
Add final revisions for the qualification exam
1 parent bebb699 commit 539cd97

322 files changed

Lines changed: 43534 additions & 22168 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 0 additions & 18 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# See <https://git-scm.com/docs/gitignore>.
22

3+
_freeze/
4+
_targets/
35
.auth/
46
.quarto/
57
.temp/
68
.ssh/
7-
_targets/
8-
# docs/
99
.Rapp.history
1010
.RData
1111
.Renviron

.obsidian/workspace.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,21 @@
3434
},
3535
"pinned": true
3636
}
37+
},
38+
{
39+
"id": "0f3fffc213ca6f8b",
40+
"type": "leaf",
41+
"state": {
42+
"type": "markdown",
43+
"state": {
44+
"file": "qmd/list-of-abbreviations.qmd",
45+
"mode": "source",
46+
"source": false
47+
}
48+
}
3749
}
3850
],
39-
"currentTab": 1
51+
"currentTab": 2
4052
}
4153
],
4254
"direction": "vertical"
@@ -113,7 +125,7 @@
113125
"state": {
114126
"type": "backlink",
115127
"state": {
116-
"file": "qmd/chapter-1.qmd",
128+
"file": "qmd/list-of-abbreviations.qmd",
117129
"collapseAll": false,
118130
"extraContext": false,
119131
"sortOrder": "alphabetical",
@@ -130,7 +142,7 @@
130142
"state": {
131143
"type": "outgoing-link",
132144
"state": {
133-
"file": "qmd/chapter-1.qmd",
145+
"file": "qmd/list-of-abbreviations.qmd",
134146
"linksCollapsed": false,
135147
"unlinkedCollapsed": true
136148
}
@@ -149,7 +161,7 @@
149161
"state": {
150162
"type": "outline",
151163
"state": {
152-
"file": "qmd/chapter-1.qmd"
164+
"file": "qmd/list-of-abbreviations.qmd"
153165
}
154166
}
155167
}
@@ -169,9 +181,12 @@
169181
"obsidian-grammarly-plugin:Enable Grammarly": false
170182
}
171183
},
172-
"active": "8356ee2ff131600b",
184+
"active": "0f3fffc213ca6f8b",
173185
"lastOpenFiles": [
186+
"qmd/chapter-1.qmd",
174187
"qmd/chapter-6.qmd",
188+
"README.html",
189+
"README.knit.md",
175190
"Ecology-of-sleep-and-circadian-phenotypes-of-the-Brazilian-population.tex",
176191
"Ecology-of-sleep-and-circadian-phenotypes-of-the-Brazilian-population.pdf",
177192
"index.pdf",
@@ -180,8 +195,6 @@
180195
"index.lot",
181196
"index.lof",
182197
"index.aux",
183-
"tesesusp.cls",
184-
"index.tex",
185198
"qmd/appendice-ch-6.knit.md",
186199
"qmd/appendice-ch-6_files/figure-pdf/unnamed-chunk-36-1.png",
187200
"qmd/appendice-ch-6_files/figure-pdf/unnamed-chunk-31-1.png",
@@ -215,7 +228,6 @@
215228
"qmd/acknowledgments.knit.md",
216229
"qmd/inscription.knit.md",
217230
"qmd/errata.knit.md",
218-
"renv/library/R-4.3/x86_64-w64-mingw32/targets/tar_watch/about.md",
219-
"renv/library/R-4.3/x86_64-w64-mingw32/targets/paper/paper.md"
231+
"renv/library/R-4.3/x86_64-w64-mingw32/targets/tar_watch/about.md"
220232
]
221233
}

R/_dev.R

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,32 @@
2929
# rutils:::bbt_scan_citation_keys()
3030
# rutils:::bbt_write_quarto_bib()
3131
# rutils:::set_quarto_speel_check()
32-
# rutils:::gather_words_from_spell_check()
33-
# rutils:::spell_check_quarto()
34-
# rutils:::update_quarto_wordlist()
32+
# rutils:::gather_words_from_spell_check(pattern = "\\.qmd$|\\.Rmd$")
33+
# rutils:::spell_check_quarto(pattern = "\\.qmd$|\\.Rmd$")
34+
# rutils:::update_quarto_wordlist(pattern = "\\.qmd$|\\.Rmd$")
3535
# rutils:::clean_quarto_mess()
3636
# rutils:::quarto_status("drafting")
3737
# spelling::spell_check_files("index.qmd")
3838
# urlchecker::url_check()
3939
# urlchecker::url_update()
4040

41-
# # Pandoc
42-
#
43-
# rmarkdown::pandoc_convert(
44-
# input = "qmd/acknowledgments.qmd",
45-
# from = "markdown",
46-
# to = "latex",
47-
# wd = here::here()
48-
# )
49-
5041
# # Quarto (see <https://quarto.org/docs/projects/quarto-projects.html>)
5142
#
43+
# source(here::here("R", "quarto-pre-render-pdf.R"))
44+
# source(here::here("R", "quarto-pre-render-html.R"))
45+
#
5246
# quarto render
5347
# quarto render --profile pdf
54-
# quarto render --profile pdf --cache-refresh
5548
# quarto render --profile html
56-
# quarto render --profile html --cache-refresh
5749
# quarto publish gh-pages
5850

51+
# # LaTeX
52+
#
53+
# \BeforeBeginEnvironment{}{} # {etoolbox}
54+
# \AtBeginEnvironment{}{}
55+
# \AtEndEnvironment{}{}
56+
# \AfterEndEnvironment{}{}
57+
5958
# # Google Cloud Storage
6059
#
6160
# library(googleCloudStorageR)
@@ -83,6 +82,5 @@
8382
# # TODO
8483
#
8584
# * Document functions.
86-
# * Finish version of 'tesesusp' Quarto format.
87-
# * Document and promote quarto util functions on {rutils}
88-
# * Create check_quarto_urls()
85+
# * Finish version of 'abnt' Quarto format.
86+
# * Create a new R package named {quartoutils}.

R/quarto-post-render-common.R

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# library(checkmate, quietly = TRUE)
2+
# library(here, quietly = TRUE)
3+
# library(yaml, quietly = TRUE)
4+
5+
# Set variables -----
6+
7+
quarto_yml_path <- here::here("_quarto.yml")
8+
quarto_yml_html_path <- here::here("_quarto-html.yml")
9+
quarto_yml_pdf_path <- here::here("_quarto-pdf.yml")
10+
11+
quarto_yml_vars <- yaml::read_yaml(quarto_yml_path)
12+
quarto_yml_html_vars <- yaml::read_yaml(quarto_yml_html_path)
13+
quarto_yml_pdf_vars <- yaml::read_yaml(quarto_yml_pdf_path)
14+
15+
github_user <- "danielvartan"
16+
project_name <- here::here() |> basename() # rstudioapi::getActiveProject()
17+
18+
# Create output folders if they don't exist -----
19+
20+
output_dir_pdf <- here::here(quarto_yml_pdf_vars$project$`output-dir`)
21+
output_dir_html <- here::here(quarto_yml_html_vars$project$`output-dir`)
22+
23+
for (i in c(output_dir_html, output_dir_pdf)) {
24+
if (!checkmate::test_directory_exists(i)) dir.create(i)
25+
}

R/quarto-post-render-html.R

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,11 @@
33
# library(rutils, quietly = TRUE)
44
# library(yaml, quietly = TRUE)
55

6-
# Set variables ----------
6+
source(here::here("R", "quarto-post-render-common.R"))
77

8-
quarto_yml_path <- here::here("_quarto.yml")
9-
quarto_yml_html_path <- here::here("_quarto-html.yml")
10-
quarto_yml_pdf_path <- here::here("_quarto-pdf.yml")
8+
# Copy PDF (if exists) to `output_dir_html` folder ----------
119

12-
quarto_yml_vars <- yaml::read_yaml(quarto_yml_path)
13-
quarto_yml_html_vars <- yaml::read_yaml(quarto_yml_html_path)
14-
quarto_yml_pdf_vars <- yaml::read_yaml(quarto_yml_pdf_path)
15-
16-
github_user <- "danielvartan"
17-
project_name <- here::here() |> basename() # rstudioapi::getActiveProject()
18-
19-
# Set output variables and create output folders if they don't exist ----------
20-
21-
output_dir_html <- here::here(quarto_yml_html_vars$project$`output-dir`)
22-
output_dir_pdf <- here::here(quarto_yml_pdf_vars$project$`output-dir`)
23-
pdf_dir <- here::here("pdf")
24-
25-
for (i in c(output_dir_html, output_dir_pdf, pdf_dir)) {
26-
if (!checkmate::test_directory_exists(i)) dir.create(i) |> invisible()
27-
}
28-
29-
# Copy PDF (if exists) to `docs` folder ----------
30-
31-
pdf_file <- list.files(pdf_dir, full.names = TRUE, pattern = ".pdf$")
10+
pdf_file <- list.files(output_dir_pdf, full.names = TRUE, pattern = ".pdf$")
3211

3312
if (length(pdf_file) == 1) {
3413
rutils:::copy_file(pdf_file, file.path(output_dir_html, "index.pdf"))
@@ -56,13 +35,13 @@ writeLines(
5635
con = robots_file
5736
)
5837

59-
# Delete unnecessary files and folders ----------
38+
# Delete unnecessary files and folders -----
6039

6140
rutils:::clean_quarto_mess(
62-
wd = here::here(),
6341
file = NULL,
6442
dir = c(".temp", "index_cache", "index_files", "qmd/images"),
65-
ext = NULL,
66-
keep = NULL,
67-
quarto_yaml = NULL
43+
ext = c("aux", "bbx", "cbx", "dbx", "fdb_latexmk", "lbx", "loa", "log",
44+
"pdf", "scss", "tex", "xdv"),
45+
ignore = NULL,
46+
wd = here::here()
6847
)

R/quarto-post-render-pdf.R

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,33 @@
1-
# library(checkmate, quietly = TRUE)
21
# library(here, quietly = TRUE)
32
# library(rutils, quietly = TRUE)
4-
# library(yaml, quietly = TRUE)
53

6-
# Set variables ----------
4+
source(here::here("R", "quarto-post-render-common.R"))
75

8-
quarto_yml_path <- here::here("_quarto.yml")
9-
quarto_yml_html_path <- here::here("_quarto-html.yml")
10-
quarto_yml_pdf_path <- here::here("_quarto-pdf.yml")
6+
# Copy and rename the PDF file (if exists) to `output_dir_pdf` folder -----
117

12-
quarto_yml_vars <- yaml::read_yaml(quarto_yml_path)
13-
quarto_yml_html_vars <- yaml::read_yaml(quarto_yml_html_path)
14-
quarto_yml_pdf_vars <- yaml::read_yaml(quarto_yml_pdf_path)
8+
pdf_file <- list.files(output_dir_pdf, full.names = TRUE, pattern = "\\.pdf$")
159

16-
github_user <- "danielvartan"
17-
project_name <- here::here() |> basename() # rstudioapi::getActiveProject()
18-
19-
# Set output variables and create output folders if they don't exist ----------
20-
21-
output_dir_html <- here::here(quarto_yml_html_vars$project$`output-dir`)
22-
output_dir_pdf <- here::here(quarto_yml_pdf_vars$project$`output-dir`)
23-
pdf_dir <- here::here("pdf")
24-
25-
for (i in c(output_dir_html, output_dir_pdf, pdf_dir)) {
26-
if (!checkmate::test_directory_exists(i)) dir.create(i) |> invisible()
10+
if (length(pdf_file) == 1) {
11+
rutils:::copy_file(pdf_file, file.path(output_dir_pdf, "index.pdf"))
12+
rutils:::copy_file(pdf_file, file.path(output_dir_html, "index.pdf"))
13+
rutils:::delete_file(pdf_file)
2714
}
2815

29-
# Copy PDF file (if exists) to `docs` folder ----------
16+
# Copy and rename the TeX file (if exists) to `output_dir_pdf` folder -----
3017

31-
pdf_file <- list.files(output_dir_pdf, full.names = TRUE, pattern = ".pdf$")
32-
33-
if (length(pdf_file) == 1) {
34-
rutils:::remove_pdf_cover(pdf_file)
35-
36-
rutils:::copy_file(pdf_file, file.path(pdf_dir, "index.pdf"))
37-
rutils:::copy_file(pdf_file, file.path(output_dir_html, "index.pdf"))
18+
tex_file <- list.files(here::here(), full.names = TRUE, pattern = ".tex$")
3819

39-
list.files(here::here(), full.names = TRUE, pattern = ".tex$") |>
40-
rutils:::copy_file(file.path("pdf", "index.tex"))
20+
if (length(tex_file) == 1) {
21+
rutils:::copy_file(tex_file, file.path(output_dir_pdf, "index.tex"))
4122
}
4223

43-
# Delete unnecessary files and folders ----------
24+
# Delete unnecessary files and folders -----
4425

4526
rutils:::clean_quarto_mess(
46-
wd = here::here(),
4727
file = NULL,
4828
dir = c(".temp", "index_cache", "index_files"),
49-
ext = c("aux", "cls", "loa", "log", "pdf", "tex"),
50-
keep = NULL,
51-
quarto_yaml = NULL
29+
ext = c("aux", "bbx", "cbx", "dbx", "fdb_latexmk", "lbx", "loa", "log",
30+
"otf", "pdf", "tex", "xdv"),
31+
ignore = NULL,
32+
wd = here::here()
5233
)

0 commit comments

Comments
 (0)