Skip to content

Commit

Permalink
feat : propre.brochure (WIP) :
Browse files Browse the repository at this point in the history
1. supression des accents dans l'argument par défaut `made_with` pour que les checks passent sur windows
2. Ajout du badge expérimental à la fonction pour tenir compte de cette difficulté et des soucis de mise en page signalés par Thomas le 21 mars 2021
  • Loading branch information
jengelaere committed Nov 17, 2023
1 parent 46eb92a commit db72d80
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 6 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ Imports:
systemfonts,
utils,
xfun,
pagedown
pagedown,
lifecycle
Suggests:
gouvdown.fonts,
pals,
Expand All @@ -67,6 +68,7 @@ Collate:
'html_gouv.R'
'gitbook_gouv.R'
'gouv_palettes.R'
'gouvdown-package.R'
'logo.R'
'propre_brochure.R'
'skeleton.R'
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ importFrom(ggplot2,margin)
importFrom(ggplot2,theme)
importFrom(glue,glue)
importFrom(here,here)
importFrom(lifecycle,deprecated)
7 changes: 7 additions & 0 deletions R/gouvdown-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
#' @importFrom lifecycle deprecated
## usethis namespace: end
NULL
8 changes: 5 additions & 3 deletions R/propre_brochure.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#' gouvdown PDF brochure - PROPRE style
#' `r lifecycle::badge("experimental")`
#'
#' @inheritParams html_gouv
#' @param ... Additional arguments passed to \code{bookdown::\link{html_document2}()}.
Expand All @@ -16,7 +17,7 @@ propre_brochure <- function(extra_dependencies = list(),
css = NULL,
use_gouvdown_fonts = TRUE,
width_main_column = 15,
made_with = "Ce document a été réalisé avec le package `gouvdown`") {
made_with = "Ce document a ete realise avec le package `{gouvdown}`") {
# init variable
logo_html_fragment <- NULL

Expand Down Expand Up @@ -55,9 +56,10 @@ propre_brochure <- function(extra_dependencies = list(),
made_with_css <- tempfile(fileext = ".css")

writeLines(paste(
paste0(":root {--made-with:", made_with , ";}")
paste0(":root {--made-with:", iconv(made_with, to = "UTF-8") , ";}")
),
con = made_with_css)
con = made_with_css,
useBytes = TRUE)

# render
pagedown::html_paged(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ skeleton.html
skeleton.pdf
www/
header.html
skeleton_files/
1 change: 1 addition & 0 deletions man/figures/lifecycle-archived.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-defunct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-deprecated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-experimental.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-maturing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-questioning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-stable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-superseded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions man/gouvdown-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/propre_brochure.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db72d80

Please sign in to comment.