Skip to content

Commit

Permalink
Fix examples for paths relative to the project root (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcBresson authored Dec 20, 2023
1 parent 1690934 commit 1aa2f9c
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 65 deletions.
55 changes: 28 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,42 +65,42 @@ plugins:
**closing_tag**: The default opening and closing tags. By default are
`{%` and `%}`.

```yaml
plugins:
- include-markdown:
opening_tag: "{!"
closing_tag: "!}"
```
```yaml
plugins:
- include-markdown:
opening_tag: "{!"
closing_tag: "!}"
```

- <a name="config_exclude" href="#config_exclude">#</a> **exclude**: Define
global exclusion wildcard patterns. Relative paths defined here will be
relative to the _docs/_ directory.

```yaml
plugins:
- include-markdown:
exclude:
- LICENSE.md
- api/**
```
```yaml
plugins:
- include-markdown:
exclude:
- LICENSE.md
- api/**
```

- <a name="config_cache" href="#config_cache">#</a> **cache**: Define a
expiration time in seconds for cached HTTP requests when including
from URLs.

```yaml
plugins:
- include-markdown:
cache: 600
```
```yaml
plugins:
- include-markdown:
cache: 600
```

In order to use this feature, the dependency [platformdirs] must be installed.
You can include it in the installation of the plugin adding the `cache` extra:
In order to use this feature, the dependency [platformdirs] must be installed.
You can include it in the installation of the plugin adding the `cache` extra:

```txt
# requirements.txt
mkdocs-include-markdown-plugin[cache]
```
```txt
# requirements.txt
mkdocs-include-markdown-plugin[cache]
```

### Reference

Expand All @@ -113,7 +113,8 @@ Paths of included files can be either:
- Local files:
- Absolute paths (starting with a path separator).
- Relative from the file that includes them (starting with `./` or `../`).
- Relative from the _docs/_ directory.
- Relative to the `docs_dir` directory. For instance if your `docs_dir` is
_./docs/_, then `includes/header.md` will match the file _./docs/includes/header.md_`.
- [Bash wildcard globs] matching multiple local files.

File paths to include and string arguments can be wrapped by double `"` or
Expand Down Expand Up @@ -177,7 +178,7 @@ content to include.

```jinja
{%
include-markdown 'docs/includes/header.md'
include-markdown 'includes/header.md'
start='<!--\n\ttable-start\n-->'
end='<!--\n\ttable-end\n-->'
rewrite-relative-urls=false
Expand All @@ -187,7 +188,7 @@ content to include.

```jinja
{%
include-markdown "docs/includes/header.md"
include-markdown "includes/header.md"
heading-offset=1
%}
```
Expand Down
40 changes: 24 additions & 16 deletions locale/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,37 +53,43 @@ plugins:
- <a name="config_tags" href="#config_tags">#</a> **opening_tag** and
**closing_tag**: Las etiquetas de apertura y cierre. Por defecto son `{%` y
`%}`.
```yaml
plugins:

```yaml
plugins:
- include-markdown:
opening_tag: "{!"
closing_tag: "!}"
```
```

- <a name="config_exclude" href="#config_exclude">#</a> **exclude**: Define
patrones de comodín de exclusión globales. Las rutas relativas definidas aquí
serán relativas al directorio *docs/*.
```yaml
plugins:

```yaml
plugins:
- include-markdown:
exclude:
- LICENSE.md
- api/**
```
```

- <a name="config_cache" href="#config_cache">#</a> **cache**: Define un tiempo
de caducidad en segundos para las solicitudes HTTP almacenadas en caché al
incluir desde URL.
```yaml
plugins:

```yaml
plugins:
- include-markdown:
cache: 600
```
```

Para usar esta funcionalidad, la dependencia [platformdirs] debe ser instalada.
Para usar esta funcionalidad, la dependencia [platformdirs] debe ser instalada.
Puedes incluirla en la instalación del plugin añadiendo el extra `cache`:
```txt
# requirements.txt

```txt
# requirements.txt
mkdocs-include-markdown-plugin[cache]
```
```

### Referencia

Expand All @@ -96,7 +102,9 @@ Las rutas de los archivos a incluir pueden ser:
- Archivos locales:
- Rutas absolutas (comenzando con un separador de rutas).
- Relativas desde el archivo que las incluye (empezando por `./` o `../`).
- Relativas desde el directorio *docs/*.
- Relativo al directorio `docs_dir`. Por ejemplo, si tu `docs_dir` es _./docs/_,
entonces `includes/header.md` coincidirá con el archivo
*_./docs/includes/header.md_*.
- [Bash wildcard globs] matching multiple local files.
[Patrones glob de Bash]
que coincidan con múltiples archivos locales.
Expand Down Expand Up @@ -166,7 +174,7 @@ especificado. Sólo soporta la sintaxis de encabezado de caracteres de hash

```jinja
{%
include-markdown 'docs/includes/header.md'
include-markdown 'includes/header.md'
start='<!--\n\ttable-start\n-->'
end='<!--\n\ttable-end\n-->'
rewrite-relative-urls=false
Expand All @@ -176,7 +184,7 @@ especificado. Sólo soporta la sintaxis de encabezado de caracteres de hash

```jinja
{%
include-markdown "docs/includes/header.md"
include-markdown "includes/header.md"
heading-offset=1
%}
```
Expand Down
12 changes: 9 additions & 3 deletions locale/es/README.md.po
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,6 @@ msgid ""
msgstr ""
"Relativas desde el archivo que las incluye (empezando por `./` o `../`)."

msgid "Relative from the *docs/* directory."
msgstr "Relativas desde el directorio *docs/*."

msgid ""
"In order to use this feature, the dependency [platformdirs] must be "
"installed. You can include it in the installation of the plugin adding the "
Expand All @@ -401,3 +398,12 @@ msgstr ""
"Para usar esta funcionalidad, la dependencia [platformdirs] debe ser "
"instalada. Puedes incluirla en la instalación del plugin añadiendo el extra "
"`cache`:"

msgid ""
"Relative to the `docs_dir` directory. For instance if your `docs_dir` is "
"*./docs/*, then `includes/header.md` will match the file "
"*./docs/includes/header.md*`."
msgstr ""
"Relativo al directorio `docs_dir`. Por ejemplo, si tu `docs_dir` es "
"_./docs/_, entonces `includes/header.md` coincidirá con el archivo "
"*_./docs/includes/header.md_*."
40 changes: 24 additions & 16 deletions locale/fr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,38 +52,44 @@ plugins:
- <a name="config_tags" href="#config_tags">#</a> **opening_tag** and
**closing_tag**: Les balises d'ouverture et de fermeture par défaut. Par
défaut sont `{%` et `%}`.
```yaml
plugins:

```yaml
plugins:
- include-markdown:
opening_tag: "{!"
closing_tag: "!}"
```
```

- <a name="config_exclude" href="#config_exclude">#</a> **exclude**: Définissez
des modèles génériques d'exclusion globale. Les chemins de fichiers relatifs
définis ici seront relatifs au répertoire *docs/*.
```yaml
plugins:

```yaml
plugins:
- include-markdown:
exclude:
- LICENSE.md
- api/**
```
```

- <a name="config_cache" href="#config_cache">#</a> **cache**: Définissez un
délai d'expiration en secondes pour les requêtes HTTP mises en cache lors de
l'inclusion d'URL.
```yaml
plugins:

```yaml
plugins:
- include-markdown:
cache: 600
```
```

Pour utiliser cette fonctionnalité, la dépendance [platformdirs] doit être
Pour utiliser cette fonctionnalité, la dépendance [platformdirs] doit être
installée. Vous pouvez l'inclure dans l'installation du plugin en ajoutant le
supplément `cache`:
```txt
# requirements.txt

```txt
# requirements.txt
mkdocs-include-markdown-plugin[cache]
```
```

### Référence

Expand All @@ -96,7 +102,9 @@ Les chemins des fichiers inclus peuvent être soit:
- Fichiers locaux:
- Chemins de fichier absolus (commençant par un séparateur de chemin).
- Relatifs du fichiers qui les inclut (commençant par `./` ou `../`).
- Relatif du répertoire *docs/*.
- Relatif au répertoire `docs_dir`. Par exemple, si votre `docs_dir` est
_./docs/_, alors `includes/header.md` va correspondre au fichier
*_./docs/includes/header.md_*.
- Globs génériques Bash correspondant à plusieurs fichiers locaux.

Les chemins d'accès aux fichiers à inclure et les arguments de chaîne peuvent
Expand Down Expand Up @@ -164,7 +172,7 @@ négatives pour supprimer les caractères `#` de tête.

```jinja
{%
include-markdown 'docs/includes/header.md'
include-markdown 'includes/header.md'
start='<!--\n\ttable-start\n-->'
end='<!--\n\ttable-end\n-->'
rewrite-relative-urls=false
Expand All @@ -174,7 +182,7 @@ négatives pour supprimer les caractères `#` de tête.

```jinja
{%
include-markdown "docs/includes/header.md"
include-markdown "includes/header.md"
heading-offset=1
%}
```
Expand Down
12 changes: 9 additions & 3 deletions locale/fr/README.md.po
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,6 @@ msgid ""
"Relative from the file that includes them (starting with `./` or `../`)."
msgstr "Relatifs du fichiers qui les inclut (commençant par `./` ou `../`)."

msgid "Relative from the *docs/* directory."
msgstr "Relatif du répertoire *docs/*."

msgid ""
"In order to use this feature, the dependency [platformdirs] must be "
"installed. You can include it in the installation of the plugin adding the "
Expand All @@ -397,3 +394,12 @@ msgstr ""
"Pour utiliser cette fonctionnalité, la dépendance [platformdirs] doit être "
"installée. Vous pouvez l'inclure dans l'installation du plugin en ajoutant "
"le supplément `cache`:"

msgid ""
"Relative to the `docs_dir` directory. For instance if your `docs_dir` is "
"*./docs/*, then `includes/header.md` will match the file "
"*./docs/includes/header.md*`."
msgstr ""
"Relatif au répertoire `docs_dir`. Par exemple, si votre `docs_dir` est "
"_./docs/_, alors `includes/header.md` va correspondre au fichier "
"*_./docs/includes/header.md_*."

0 comments on commit 1aa2f9c

Please sign in to comment.