feat(wip_for_article)

Working on plugins and extensions example
This commit is contained in:
TGITS
2024-02-12 19:24:41 +01:00
parent 705022b8f7
commit a2df76edcc
2 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
---
title: Configuration example
description: Some page configuration and extensions usage examples
status: new
---
## Goals of this page
This page aims to demonstrate some examples of a page configuration and examples usage of some extensions.
## Admonition examples
!!! note
note admonition example - not collapsible
??? info
info admonition example - collapsible, not expanded by default
???+ tip
tip admonition example - collapsible, expanded by default
!!! warning
warning admonition example - not collapsible
???+ example
example admonition example - collapsible, expanded by default
## Code blocks examples
```java title="frequencies-map-with-for.jsh"
/**
* Run with JBang : jbang frequencies-map-with-for.jsh (1)
* <p>
* or open in JShell : /open frequencies-map-with-for.jsh
*/
import java.util.HashMap;
import java.util.List;
import java.util.Map;
List<String> daysOfWeek = List.of("Friday", "Thursday", "Thursday", "Saturday", "Thursday", "Thursday", "Monday", "Saturday", "Friday", "Saturday");
Map<String, Integer> frequencies = new HashMap<>();
int previousCount;
for (String day : daysOfWeek) {
previousCount = frequencies.getOrDefault(day, 0);
frequencies.put(day, previousCount + 1);
}
frequencies.entrySet().iterator().forEachRemaining(System.out::println);
```
1. :man_raising_hand: Code annotation example

View File

@@ -9,12 +9,39 @@ theme:
- navigation.tracking # the url evolves with the scrolling
- toc.integrate # to have a toc on the left
- navigation.top # to have a shorcut to go back on top of the page when we scroll down
- content.code.copy # to have copy button with code blocks
- content.code.annotate # to be able to annotate in code blocks
nav:
- 'Home': 'index.md'
- 'Introduction': 'mkdocs-briefly.md'
- 'Installation': 'installing-and-running-mkdocs.md'
- 'Configuration example': 'configuration_example.md'
plugins:
- search
- offline
markdown_extensions:
# Required for multiple other extensions
- attr_list # required for annotations, icons and emoji
- md_in_html # required for icons and emoji
- pymdownx.superfences # required for admonitions and code blocks
# For admonitions
- admonition
- pymdownx.details
- pymdownx.superfences
# For using a large database of icons and emojis
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
# For code blocks
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets