mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-28 01:10:58 +01:00
Stripped comments from all annotations
This commit is contained in:
parent
e5d1efc6fe
commit
90410f3910
@ -144,7 +144,7 @@ write your documentation. The server will automatically rebuild the site upon
|
||||
saving. Start it with:
|
||||
|
||||
``` sh
|
||||
mkdocs serve # (1)
|
||||
mkdocs serve # (1)!
|
||||
```
|
||||
|
||||
1. If you have a large documentation project, it might take minutes until
|
||||
|
@ -26,10 +26,10 @@ contents:
|
||||
=== "Material for MkDocs"
|
||||
|
||||
``` yaml
|
||||
name: ci # (1)
|
||||
name: ci # (1)!
|
||||
on:
|
||||
push:
|
||||
branches: # (2)
|
||||
branches: # (2)!
|
||||
- master
|
||||
- main
|
||||
jobs:
|
||||
@ -40,7 +40,7 @@ contents:
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.x
|
||||
- run: pip install mkdocs-material # (3)
|
||||
- run: pip install mkdocs-material # (3)!
|
||||
- run: mkdocs gh-deploy --force
|
||||
```
|
||||
|
||||
@ -80,7 +80,7 @@ contents:
|
||||
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
|
||||
- run: mkdocs gh-deploy --force
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }} # (1)
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }} # (1)!
|
||||
```
|
||||
|
||||
1. Remember to set the `GH_TOKEN` environment variable to the value of your
|
||||
|
@ -45,7 +45,7 @@ lines to `mkdocs.yml`:
|
||||
theme:
|
||||
icon:
|
||||
admonition:
|
||||
<type>: <icon> # (1)
|
||||
<type>: <icon> # (1)!
|
||||
```
|
||||
|
||||
1. Set `<type`> to any of the [supported types] and `<icon>` to any valid icon
|
||||
|
@ -56,7 +56,7 @@ and inline comments in the language of the code block. Add the following to
|
||||
``` yaml
|
||||
theme:
|
||||
features:
|
||||
- content.code.annotate # (1)
|
||||
- content.code.annotate # (1)!
|
||||
```
|
||||
|
||||
1. :man_raising_hand: I'm a code annotation! I can contain `code`, __formatted
|
||||
|
@ -98,7 +98,7 @@ can be added to images.
|
||||
_Example_:
|
||||
|
||||
```html
|
||||
<figure markdown> <!-- (1) -->
|
||||
<figure markdown> <!-- (1)! -->
|
||||
![Dummy image](https://dummyimage.com/600x400/){ width="300" }
|
||||
<figcaption>Image caption</figcaption>
|
||||
</figure>
|
||||
|
@ -36,7 +36,7 @@ lines to `mkdocs.yml`:
|
||||
}
|
||||
};
|
||||
|
||||
document$.subscribe(() => { // (1)
|
||||
document$.subscribe(() => { // (1)!
|
||||
MathJax.typesetPromise()
|
||||
})
|
||||
```
|
||||
|
@ -39,7 +39,7 @@ some custom front matter. Add the following lines at the top of a Markdown file:
|
||||
|
||||
``` bash
|
||||
---
|
||||
title: Lorem ipsum dolor sit amet # (1)
|
||||
title: Lorem ipsum dolor sit amet # (1)!
|
||||
---
|
||||
|
||||
# Document title
|
||||
|
@ -39,7 +39,7 @@ in the `overrides` folder:
|
||||
var disqus_config = function() {
|
||||
this.page.url = "{{ page.canonical_url }}"
|
||||
this.page.identifier =
|
||||
"{{ page.canonical_url | replace(config.site_url, '') }}" // (1)
|
||||
"{{ page.canonical_url | replace(config.site_url, '') }}" // (1)!
|
||||
}
|
||||
|
||||
/* Set up for the first time */
|
||||
@ -69,7 +69,7 @@ in the `overrides` folder:
|
||||
|
||||
``` yaml
|
||||
extra:
|
||||
disqus: <shortname> # (1)
|
||||
disqus: <shortname> # (1)!
|
||||
```
|
||||
|
||||
1. Add your Disqus [shortname] here.
|
||||
|
@ -176,12 +176,12 @@ palettes:
|
||||
|
||||
``` yaml
|
||||
theme:
|
||||
palette: # (1)
|
||||
palette: # (1)!
|
||||
- scheme: default
|
||||
toggle:
|
||||
icon: material/toggle-switch-off-outline
|
||||
name: Switch to dark mode
|
||||
- scheme: slate # (2)
|
||||
- scheme: slate # (2)!
|
||||
toggle:
|
||||
icon: material/toggle-switch
|
||||
name: Switch to light mode
|
||||
@ -232,12 +232,12 @@ definition in `mkdocs.yml`:
|
||||
``` yaml
|
||||
theme:
|
||||
palette:
|
||||
- media: "(prefers-color-scheme: light)" # (1)
|
||||
- media: "(prefers-color-scheme: light)" # (1)!
|
||||
scheme: default
|
||||
toggle:
|
||||
icon: material/toggle-switch-off-outline
|
||||
name: Switch to dark mode
|
||||
- media: "(prefers-color-scheme: dark)" # (2)
|
||||
- media: "(prefers-color-scheme: dark)" # (2)!
|
||||
scheme: slate
|
||||
toggle:
|
||||
icon: material/toggle-switch
|
||||
@ -325,7 +325,7 @@ can tune the `slate` theme with:
|
||||
|
||||
``` css
|
||||
[data-md-color-scheme="slate"] {
|
||||
--md-hue: 210; /* (1) */
|
||||
--md-hue: 210; /* (1)! */
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -100,7 +100,7 @@ globally to be used as the site-wide regular or monospaced font:
|
||||
|
||||
``` css
|
||||
:root {
|
||||
--md-text-font-family: "<font>"; /* (1) */
|
||||
--md-text-font-family: "<font>"; /* (1)! */
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -101,7 +101,7 @@ can be defined via `mkdocs.yml`.
|
||||
extra:
|
||||
alternate:
|
||||
- name: English
|
||||
link: /en/ # (1)
|
||||
link: /en/ # (1)!
|
||||
lang: en
|
||||
- name: Deutsch
|
||||
link: /de/
|
||||
@ -189,11 +189,11 @@ adjust the ones you want to override:
|
||||
``` html
|
||||
<!-- Import translations for language and fallback -->
|
||||
{% import "partials/languages/de.html" as language %}
|
||||
{% import "partials/languages/en.html" as fallback %} <!-- (1) -->
|
||||
{% import "partials/languages/en.html" as fallback %} <!-- (1)! -->
|
||||
|
||||
<!-- Define custom translations -->
|
||||
{% macro override(key) %}{{ {
|
||||
"source.file.date.created": "Erstellt am", <!-- (2) -->
|
||||
"source.file.date.created": "Erstellt am", <!-- (2)! -->
|
||||
"source.file.date.updated": "Aktualisiert am"
|
||||
}[key] }}{% endmacro %}
|
||||
|
||||
|
@ -227,7 +227,7 @@ in `*.svg` file format into the resulting HTML page. Enable it via `mkdocs.yml`:
|
||||
``` yaml
|
||||
markdown_extensions:
|
||||
- pymdownx.emoji:
|
||||
emoji_index: !!python/name:materialx.emoji.twemoji # (1)
|
||||
emoji_index: !!python/name:materialx.emoji.twemoji # (1)!
|
||||
emoji_generator: !!python/name:materialx.emoji.to_svg
|
||||
```
|
||||
|
||||
@ -310,7 +310,7 @@ The [Highlight] extension adds support for syntax highlighting of code blocks
|
||||
markdown_extensions:
|
||||
- pymdownx.highlight:
|
||||
anchor_linenums: true
|
||||
- pymdownx.superfences # (1)
|
||||
- pymdownx.superfences # (1)!
|
||||
```
|
||||
|
||||
1. [Highlight] is used by the [SuperFences][pymdownx.superfences] extension to
|
||||
|
@ -346,7 +346,7 @@ your custom event listener:
|
||||
keyboard$.subscribe(function(key) {
|
||||
if (key.mode === "global" && key.type === "x") {
|
||||
/* Add custom keyboard handler here */
|
||||
key.claim() // (1)
|
||||
key.claim() // (1)!
|
||||
}
|
||||
})
|
||||
```
|
||||
@ -379,7 +379,7 @@ of CSS:
|
||||
|
||||
``` css
|
||||
.md-grid {
|
||||
max-width: 1440px; /* (1) */
|
||||
max-width: 1440px; /* (1)! */
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -81,7 +81,7 @@ Add the following lines to `mkdocs.yml`:
|
||||
|
||||
``` yaml
|
||||
extra:
|
||||
analytics: # (1)
|
||||
analytics: # (1)!
|
||||
feedback:
|
||||
title: Was this page helpful?
|
||||
ratings:
|
||||
@ -93,7 +93,7 @@ extra:
|
||||
- icon: material/emoticon-sad-outline
|
||||
name: This page could be improved
|
||||
data: 0
|
||||
note: >- # (2)
|
||||
note: >- # (2)!
|
||||
Thanks for your feedback! Help us improve this page by
|
||||
using our <a href="..." target=_blank>feedback form</a>.
|
||||
```
|
||||
@ -232,7 +232,7 @@ following to `mkdocs.yml`:
|
||||
extra:
|
||||
consent:
|
||||
title: Cookie consent
|
||||
description: >- # (1)
|
||||
description: >- # (1)!
|
||||
We use cookies to recognize your repeated visits and preferences, as well
|
||||
as to measure the effectiveness of our documentation and whether users
|
||||
find what they're searching for. With your consent, you're helping us to
|
||||
@ -253,7 +253,7 @@ integrated by using the `cookies` field:
|
||||
extra:
|
||||
consent:
|
||||
cookies:
|
||||
analytics: Custom name # (1)
|
||||
analytics: Custom name # (1)!
|
||||
```
|
||||
|
||||
1. The default name of the `analytics` cookie is `Google Analytics`.
|
||||
@ -264,7 +264,7 @@ integrated by using the `cookies` field:
|
||||
extra:
|
||||
consent:
|
||||
cookies:
|
||||
analytics: Google Analytics # (1)
|
||||
analytics: Google Analytics # (1)!
|
||||
custom: Custom cookie
|
||||
```
|
||||
|
||||
@ -322,12 +322,12 @@ used to configure the custom integration via `mkdocs.yml`:
|
||||
``` html
|
||||
<script>
|
||||
/* Add custom analytics integration here, e.g. */
|
||||
var property = "{{ config.extra.analytics.property }}" // (1)
|
||||
var property = "{{ config.extra.analytics.property }}" // (1)!
|
||||
|
||||
/* Wait for page to load and application to mount */
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
location$.subscribe(function(url) {
|
||||
/* Add custom page event tracking here */ // (2)
|
||||
/* Add custom page event tracking here */ // (2)!
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@ -345,7 +345,7 @@ used to configure the custom integration via `mkdocs.yml`:
|
||||
extra:
|
||||
analytics:
|
||||
provider: custom
|
||||
property: foobar # (1)
|
||||
property: foobar # (1)!
|
||||
```
|
||||
|
||||
1. You can add arbitrary key-value combinations to configure your
|
||||
|
@ -53,7 +53,7 @@ The following configuration options are supported:
|
||||
``` yaml
|
||||
plugins:
|
||||
- search:
|
||||
lang: # (1)
|
||||
lang: # (1)!
|
||||
- en
|
||||
- ru
|
||||
```
|
||||
@ -102,7 +102,7 @@ The following configuration options are supported:
|
||||
``` yaml
|
||||
plugins:
|
||||
- search:
|
||||
separator: '[\s\-\.]' # (1)
|
||||
separator: '[\s\-\.]' # (1)!
|
||||
```
|
||||
|
||||
1. Tokenization itself is carried out by [lunr's default tokenizer], which
|
||||
@ -342,7 +342,7 @@ a Markdown file:
|
||||
``` bash
|
||||
---
|
||||
search:
|
||||
boost: 2 # (1)
|
||||
boost: 2 # (1)!
|
||||
---
|
||||
|
||||
# Document title
|
||||
@ -467,14 +467,14 @@ following transformations, which can be customized by [extending the theme]:
|
||||
``` ts
|
||||
export function defaultTransform(query: string): string {
|
||||
return query
|
||||
.split(/"([^"]+)"/g) /* (1) */
|
||||
.split(/"([^"]+)"/g) /* (1)! */
|
||||
.map((terms, index) => index & 1
|
||||
? terms.replace(/^\b|^(?![^\x00-\x7F]|$)|\s+/g, " +")
|
||||
: terms
|
||||
)
|
||||
.join("")
|
||||
.replace(/"|(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g, "") /* (2) */
|
||||
.trim() /* (3) */
|
||||
.replace(/"|(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g, "") /* (2)! */
|
||||
.trim() /* (3)! */
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -78,7 +78,7 @@ The following configuration options are available:
|
||||
plugins:
|
||||
- social:
|
||||
cards_color:
|
||||
fill: "#0FF1CE" # (1)
|
||||
fill: "#0FF1CE" # (1)!
|
||||
text: "#FFFFFF"
|
||||
```
|
||||
|
||||
|
@ -74,7 +74,7 @@ you can [override the `outdated` block][overriding blocks]:
|
||||
|
||||
{% block outdated %}
|
||||
You're not viewing the latest version.
|
||||
<a href="{{ '../' ~ base_url }}"> <!-- (1) -->
|
||||
<a href="{{ '../' ~ base_url }}"> <!-- (1)! -->
|
||||
<strong>Click here to go to latest.</strong>
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user