Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mkdocs DSFR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
Numérique et Écologie
Mkdocs DSFR
Commits
9ce1d18a
Commit
9ce1d18a
authored
1 year ago
by
Alexandre Caldato
Browse files
Options
Downloads
Patches
Plain Diff
ajout du strikethrough_replacer.js
parent
09a26b5c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/index.md
+5
-6
5 additions, 6 deletions
docs/index.md
dsfr/base.html
+3
-1
3 additions, 1 deletion
dsfr/base.html
dsfr/js/strikethrough_replacer.js
+16
-0
16 additions, 0 deletions
dsfr/js/strikethrough_replacer.js
with
24 additions
and
7 deletions
docs/index.md
+
5
−
6
View file @
9ce1d18a
...
@@ -10,10 +10,6 @@ source files are written in Markdown, and configured with a single YAML
...
@@ -10,10 +10,6 @@ source files are written in Markdown, and configured with a single YAML
configuration file. Start by reading the [introductory tutorial], then check the
configuration file. Start by reading the [introductory tutorial], then check the
[User Guide] for more information.
[User Guide] for more information.
[
introductory tutorial
]:
getting-started.md
[
User Guide
]:
user-guide/README.md
| Day | Breakfast | Lunch | Dinner |
| Day | Breakfast | Lunch | Dinner |
|-----------|-------------------------|-----------------------|---------------------------|
|-----------|-------------------------|-----------------------|---------------------------|
| Monday | Avocado Toast & Coffee | Grilled Chicken Salad | Spaghetti Carbonara |
| Monday | Avocado Toast & Coffee | Grilled Chicken Salad | Spaghetti Carbonara |
...
@@ -26,7 +22,7 @@ configuration file. Start by reading the [introductory tutorial], then check the
...
@@ -26,7 +22,7 @@ configuration file. Start by reading the [introductory tutorial], then check the
---
---
<del>
Strikethrough text
</del>
~~
Strikethrough text
~~
---
---
...
@@ -41,7 +37,6 @@ configuration file. Start by reading the [introductory tutorial], then check the
...
@@ -41,7 +37,6 @@ configuration file. Start by reading the [introductory tutorial], then check the
---
---
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<a
href=
"getting-started/"
class=
"btn btn-primary"
role=
"button"
>
Getting Started
</a>
<a
href=
"getting-started/"
class=
"btn btn-primary"
role=
"button"
>
Getting Started
</a>
<a
href=
"user-guide/"
class=
"btn btn-primary"
role=
"button"
>
User Guide
</a>
<a
href=
"user-guide/"
class=
"btn btn-primary"
role=
"button"
>
User Guide
</a>
...
@@ -125,3 +120,7 @@ Content for section 1
...
@@ -125,3 +120,7 @@ Content for section 1
## Section 2
## Section 2
Content for section 2
Content for section 2
[
introductory tutorial
]:
getting-started.md
[
User Guide
]:
user-guide/README.md
This diff is collapsed.
Click to expand it.
dsfr/base.html
+
3
−
1
View file @
9ce1d18a
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
rel=
"shortcut icon"
href=
"{{ 'favicon/favicon.ico'|url }}"
>
rel=
"shortcut icon"
href=
"{{ 'favicon/favicon.ico'|url }}"
>
<!-- 32×32 -->
<!-- 32×32 -->
<link
rel=
"manifest"
href=
"{{ 'favicon/manifest.webmanifest'|url }}"
crossorigin=
"use-credentials"
>
<link
rel=
"manifest"
href=
"{{ 'favicon/manifest.webmanifest'|url }}"
crossorigin=
"use-credentials"
>
<script
src=
"{{ 'js/strikethrough_replacer.js'|url }}"
defer
></script>
<!-- Modifier les chemins relatifs des favicons en fonction de la structure du projet -->
<!-- Modifier les chemins relatifs des favicons en fonction de la structure du projet -->
<!-- Dans le fichier manifest.webmanifest aussi, modifier les chemins vers les images -->
<!-- Dans le fichier manifest.webmanifest aussi, modifier les chemins vers les images -->
{# {% for path in config.extra_css %}
{# {% for path in config.extra_css %}
...
@@ -40,7 +41,7 @@
...
@@ -40,7 +41,7 @@
<body>
<body>
{% include "header.html" %}
{% include "header.html" %}
<main
id=
"content"
role=
"main"
>
<main
id=
"content"
role=
"main"
>
<div
class=
"fr-container"
>
<div
class=
"fr-container
markdown-content
"
>
<div
class=
"fr-grid-row"
>
<div
class=
"fr-grid-row"
>
{% if config.theme.menulateral %}
{% if config.theme.menulateral %}
{% include "lateral.html" %}
{% include "lateral.html" %}
...
@@ -168,6 +169,7 @@
...
@@ -168,6 +169,7 @@
<script
src=
"https://code.jquery.com/jquery-3.6.3.min.js"
<script
src=
"https://code.jquery.com/jquery-3.6.3.min.js"
integrity=
"sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU="
crossorigin=
"anonymous"
></script>
integrity=
"sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU="
crossorigin=
"anonymous"
></script>
<script
src=
"{{ 'js/base.js'|url }}"
defer
></script>
<script
src=
"{{ 'js/base.js'|url }}"
defer
></script>
<script
src=
"{{ 'js/strikethrough_replacer.js'|url }}"
defer
></script>
{%- for path in extra_javascript %}
{%- for path in extra_javascript %}
<script
src=
"{{ path }}"
defer
></script>
<script
src=
"{{ path }}"
defer
></script>
{%- endfor %}#}
{%- endfor %}#}
...
...
This diff is collapsed.
Click to expand it.
dsfr/js/strikethrough_replacer.js
0 → 100644
+
16
−
0
View file @
9ce1d18a
// JavaScript code pour remplacer le texte barré par du texte barré en HTML
document
.
addEventListener
(
"
DOMContentLoaded
"
,
function
()
{
// Sélectionne tous les éléments avec la classe markdown-content
const
markdownElements
=
document
.
querySelectorAll
(
"
.markdown-content
"
);
markdownElements
.
forEach
((
element
)
=>
{
let
innerHTML
=
element
.
innerHTML
;
// Remplace ~~texte~~ par <del>texte</del>
innerHTML
=
innerHTML
.
replace
(
/~~
(
.*
?)
~~/g
,
"
<del>$1</del>
"
);
element
.
innerHTML
=
innerHTML
;
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment