diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 4740ebf..316af52 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -11,14 +11,14 @@ name: R-CMD-check jobs: R-CMD-check: runs-on: macOS-latest - + env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - + steps: - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@v2 - name: Install tools run: | @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v2 - name: Install dependencies - run: remotes::install_deps(dependencies = TRUE, type = "mac.binary") + run: remotes::install_deps(dependencies = TRUE) shell: Rscript {0} - name: Install gouvdown fonts to mac os diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index a2e8a24..0d2fcdb 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -10,9 +10,9 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@v2 - name: Install tools run: | @@ -37,7 +37,7 @@ jobs: - name: Install dependencies run: | - remotes::install_deps(dependencies = TRUE, type = "mac.binary") + remotes::install_deps(dependencies = TRUE) remotes::install_dev("pkgdown") shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 74493b3..d30811f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,10 +1,10 @@ Package: gouvdown Title: French Government Design System for R Markdown -Version: 0.0.0.9000 +Version: 0.0.0.9001 Authors@R: c(person(given = "Maël", family = "Theulière", - role = c("aut", "cre"), + role = c("aut"), email = "mael.theuliere@gmail.com"), person(given = "Romain", family = "Lesur", @@ -15,6 +15,10 @@ Authors@R: family = "Vroylandt", role = "aut", email = "tvroylandt@gmail.com"), + person(given = "Juliette", + family = "Engelaere-Lefebvre", + role = c("aut", "cre"), + email = "juliette.engelaere@developpement-durable.gouv.fr"), person(family = "République Française", role = "cph"), person(family = "ThinkR", diff --git a/NEWS.md b/NEWS.md index d59160b..962fc2f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# gouvdown 0.0.0.9001 + +* Update 4 logos for regional prefecture + +* Add Word template for creating a docx letter (`lettre_word()`) + # gouvdown 0.0.0.9000 * Add new output_format and template for creating docx letter diff --git a/R/word.R b/R/word.R index 113cc7d..a450441 100644 --- a/R/word.R +++ b/R/word.R @@ -22,7 +22,7 @@ #' \code{rmarkdown::\link{render}()}. #' @export #' -#' @examples + lettre_word <- function(reference_docx = pkg_resource("docx", "template_lettre.docx"), ...){ rmarkdown::word_document(reference_docx = reference_docx, ...) } diff --git a/inst/resources/blocs_marque/prefecture_r84/84-auvergne-rhone-alpes-RVB.png b/inst/resources/blocs_marque/prefecture_r84/84-auvergne-rhone-alpes-RVB.png index 7a35525..2eba68b 100644 Binary files a/inst/resources/blocs_marque/prefecture_r84/84-auvergne-rhone-alpes-RVB.png and b/inst/resources/blocs_marque/prefecture_r84/84-auvergne-rhone-alpes-RVB.png differ diff --git a/inst/resources/blocs_marque/prefecture_r94/94-corse-RVB.png b/inst/resources/blocs_marque/prefecture_r94/94-corse-RVB.png index 67843e9..2be3de1 100644 Binary files a/inst/resources/blocs_marque/prefecture_r94/94-corse-RVB.png and b/inst/resources/blocs_marque/prefecture_r94/94-corse-RVB.png differ diff --git a/man/add_plot_header.Rd b/man/add_plot_header.Rd index aa19c50..44b6fef 100644 --- a/man/add_plot_header.Rd +++ b/man/add_plot_header.Rd @@ -23,7 +23,7 @@ Add a logo to a plot library(ggplot2) p <- ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width)) + - geom_point(aes(color = Species, shape = Species)) + geom_point(aes(color = Species, shape = Species)) add_plot_header(p, gglogo("marianne")) } diff --git a/man/check_fonts_in_r.Rd b/man/check_fonts_in_r.Rd index 4515be0..03d41ee 100644 --- a/man/check_fonts_in_r.Rd +++ b/man/check_fonts_in_r.Rd @@ -30,10 +30,17 @@ check_fonts_in_r(import = FALSE) # Test if working library(ggplot2) -ggplot(mtcars) + geom_point(aes(cyl, mpg)) + labs(title = "Mon titre avec Marianne", - x = "lab X avec Spectral", y = "Lab Y avec Spectral") + - theme(title = element_text(family = "Marianne"), - axis.title.x = element_text(family = "Spectral"), - axis.title.y = element_text(family = "Spectral")) +ggplot(mtcars) + + geom_point(aes(cyl, mpg)) + + labs( + title = "Mon titre avec Marianne", + x = "lab X avec Spectral", + y = "Lab Y avec Spectral" + ) + + theme( + title = element_text(family = "Marianne"), + axis.title.x = element_text(family = "Spectral"), + axis.title.y = element_text(family = "Spectral") + ) } } diff --git a/man/create_header_html_gouv.Rd b/man/create_header_html_gouv.Rd index ff7daee..9dc3e22 100644 --- a/man/create_header_html_gouv.Rd +++ b/man/create_header_html_gouv.Rd @@ -25,5 +25,5 @@ an html file create html_gouv bootstrap header } \examples{ -create_header_html_gouv(logo = "gouvernement") +create_header_html_gouv(logo = 'gouvernement') } diff --git a/man/figures/palettes-1.png b/man/figures/palettes-1.png index 8774a6d..5df2630 100644 Binary files a/man/figures/palettes-1.png and b/man/figures/palettes-1.png differ diff --git a/man/fonts-dependencies.Rd b/man/fonts-dependencies.Rd index a97b293..b265e9d 100644 --- a/man/fonts-dependencies.Rd +++ b/man/fonts-dependencies.Rd @@ -28,8 +28,10 @@ Markdown output formats or Shiny applications. library(htmltools) library(gouvdown) -tag <- p("The quick brown fox jumps over the lazy dog", - style = "font-family: 'Marianne', Arial, sans-serif") +tag <- p( + "The quick brown fox jumps over the lazy dog", + style = "font-family: 'Marianne', Arial, sans-serif" +) tag <- attachDependencies(tag, marianne_font_dep()) diff --git a/man/gglogo.Rd b/man/gglogo.Rd index 3cd3c0d..d24f2c8 100644 --- a/man/gglogo.Rd +++ b/man/gglogo.Rd @@ -49,8 +49,9 @@ parameters are provided. library(grid) header <- gglogo("marianne", x = 0, y = 1) -vp <- viewport(x = 0.22, y = 0.78, width = 0.2, height = 0.2, just = c("right", - "bottom")) +vp <- viewport(x = 0.22, y = 0.78, + width = 0.2, height = 0.2, + just = c("right", "bottom")) pushViewport(vp) grid.draw(header) } diff --git a/man/gouv_colors.Rd b/man/gouv_colors.Rd index bf01b7d..8eaea8b 100644 --- a/man/gouv_colors.Rd +++ b/man/gouv_colors.Rd @@ -19,6 +19,7 @@ requested hex code. } \examples{ gouv_colors("a1") + } \references{ \url{https://www.gouvernement.fr/charte/charte-graphique-les-fondamentaux/les-couleurs} diff --git a/man/gouv_palettes.Rd b/man/gouv_palettes.Rd index 417ac7b..e0d790c 100644 --- a/man/gouv_palettes.Rd +++ b/man/gouv_palettes.Rd @@ -11,12 +11,7 @@ A named list with 23 palettes. gouv_palettes } \description{ -\if{html}{\out{
}}\preformatted{pal <- gouvdown::gouv_palettes -labels <- names(pal) -do.call(pals::pal.bands, - c(pal, list(labels = labels, gap = 0.2, main = "gouvdown palettes")) -) -}\if{html}{\out{
}} +\figure{palettes-1.png} } \references{ \url{https://www.gouvernement.fr/charte/charte-graphique-les-fondamentaux/les-couleurs} diff --git a/man/theme_gouv.Rd b/man/theme_gouv.Rd index 0d25ba2..34a7ea4 100644 --- a/man/theme_gouv.Rd +++ b/man/theme_gouv.Rd @@ -93,9 +93,14 @@ All font sizes are set in points and colors are either a color name or a hex cod \dontrun{ library(ggplot2) ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width)) + - geom_point(aes(color = Species, shape = Species)) + - labs(x = "Sepal Length", y = "Sepal Width", title = "Sepal Length-Width", - subtitle = "with theme_gouv()") + theme_gouv() + - scale_color_gouv_discrete() + geom_point(aes(color = Species, shape = Species)) + + labs( + x = "Sepal Length", y = "Sepal Width", + title = "Sepal Length-Width", + subtitle = "with theme_gouv()" + ) + + theme_gouv() + + scale_color_gouv_discrete() } + } diff --git a/man/theme_gouv_map.Rd b/man/theme_gouv_map.Rd index 2273093..aa3ac7e 100644 --- a/man/theme_gouv_map.Rd +++ b/man/theme_gouv_map.Rd @@ -66,8 +66,10 @@ library(ggplot2) library(sf) demo(nc, ask = FALSE, echo = FALSE) -ggplot(data = nc) + geom_sf(aes(fill = BIR79)) + theme_gouv_map() + - scale_color_gouv_continuous() + labs(title = "North Carolina SIDS", - subtitle = "with theme_gouv_map()") +ggplot(data = nc) + + geom_sf(aes(fill = BIR79)) + + theme_gouv_map() + + scale_color_gouv_continuous() + + labs(title = "North Carolina SIDS", subtitle = "with theme_gouv_map()") } } diff --git a/man/theme_grey_gouv.Rd b/man/theme_grey_gouv.Rd index ef39e40..8d81a93 100644 --- a/man/theme_grey_gouv.Rd +++ b/man/theme_grey_gouv.Rd @@ -19,9 +19,14 @@ ggplot2 grey theme with French government design template \dontrun{ library(ggplot2) ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width)) + - geom_point(aes(color = Species, shape = Species)) + - labs(x = "Sepal Length", y = "Sepal Width", title = "Sepal Length-Width", - subtitle = "with gouv_theme()") + theme_grey_gouv() + - scale_color_gouv_discrete(palette = "pal_gouv_fr") + geom_point(aes(color = Species, shape = Species)) + + labs( + x = "Sepal Length", y = "Sepal Width", + title = "Sepal Length-Width", + subtitle = "with gouv_theme()" + ) + + theme_grey_gouv() + + scale_color_gouv_discrete(palette = "pal_gouv_fr") } + }