-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Ajout du composant header_dsfr
Tags : feat, doc, test Pourquoi ? - permettre l'utilisation du composant header_dsfr Quoi ? - Ajout du template nécessaires pour le header_dsfr - Ajout d'un flat_header.Rmd pour l'implementation du header_dsfr (doc + test) - modification du fluidPage_dsfr : rajout du parametre header - modification du tempalte fluidPage : rajout du parametre header - ajout d'un header à l'application de demo Tickets ticket #35
- Loading branch information
1 parent
ad0759e
commit 7d80947
Showing
20 changed files
with
459 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# WARNING - Generated by {fusen} from /dev/v1.7.2/composant/flat_header.Rmd: do not edit by hand | ||
|
||
#' header_dsfr | ||
#' | ||
#' @param intitule la partie "intitule" du bloc marque | ||
#' @param officiel la partie "officiel" du bloc marque | ||
#' @param url l url de redirection - optionnel | ||
#' @param titre le texte de description de l url - optionnel | ||
#' @param nom_site_service le nom du site ou du service - optionnel | ||
#' @param baseline le texte sous le nom de site/service - optionnel | ||
#' @param class un classe a ajouter si necessaire ("fr-m-1w" correspond a une margin de 1w sur tous les cotés) - optionnel, par defaut "fr-container" (centré) (voir le Systeme de design de l'Etat "fondamentaux-techniques/espacements") | ||
#' @return html | ||
#' @export | ||
#' | ||
#' @examples | ||
|
||
#' header_dsfr( | ||
#' intitule = "Prefet de", | ||
#' officiel = "Bretagne", | ||
#' ) | ||
header_dsfr <- function( | ||
intitule, officiel, url = "/", titre = NULL, nom_site_service = NULL, baseline = NULL, class = "fr-container" | ||
) { | ||
|
||
# check les params | ||
assertthat::assert_that(is.character(intitule)) | ||
assertthat::assert_that(is.character(officiel)) | ||
#TODO verifier que l url est valide | ||
|
||
header_dsfr_template( | ||
class = class, | ||
intitule = intitule, | ||
officiel = officiel, | ||
url = url, | ||
titre = titre, | ||
nom_site_service = nom_site_service, | ||
baseline = baseline | ||
) %>% | ||
parse_html() | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# WARNING - Generated by {fusen} from /dev/v1.7.2/composant/flat_header.Rmd: do not edit by hand | ||
|
||
#' header_dsfr_template | ||
#' @param intitule la partie "intitule" du bloc marque | ||
#' @param officiel la partie "officiel" du bloc marque | ||
#' @param url l url de redirection | ||
#' @param titre le texte de description de l url | ||
#' @param nom_site_service le nom du site ou du service - optionnel | ||
#' @param baseline le texte sous le nom de site/service - optionnel | ||
#' @param class un classe a ajouter si necessaire (".fr-m-1w" pour #TODO) - optionnel | ||
#' @importFrom htmltools htmlTemplate | ||
#' @return html | ||
#' @noRd | ||
header_dsfr_template <- function( | ||
intitule, officiel, url, titre, nom_site_service, baseline, class | ||
){ | ||
|
||
htmltools::htmlTemplate( | ||
filename = system.file( | ||
"v1.7.2", | ||
"composant", | ||
"entete.html", | ||
package = "shinygouv" | ||
), | ||
class = class, | ||
intitule = intitule, | ||
officiel = officiel, | ||
url = url, | ||
titre = titre, | ||
nom_site_service = nom_site_service, | ||
baseline = baseline | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: "header dsfr" | ||
output: rmarkdown::html_vignette | ||
vignette: > | ||
%\VignetteIndexEntry{header-dsfr} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
%\VignetteEncoding{UTF-8} | ||
--- | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>" | ||
) | ||
``` | ||
|
||
```{r setup} | ||
library(shinygouv) | ||
``` | ||
|
||
<!-- WARNING - This vignette is generated by {fusen} from /dev/v1.7.2/composant/flat_header.Rmd: do not edit by hand --> | ||
|
||
# header_dsfr_template | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# header_dsfr | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.