|
|
|
@ -2,28 +2,101 @@
|
|
|
|
|
title: mdBook-embedify
|
|
|
|
|
description:
|
|
|
|
|
date: 2024-04-19
|
|
|
|
|
last_update: 2024-04-21
|
|
|
|
|
last_update: 2024-04-22
|
|
|
|
|
---
|
|
|
|
|
# mdBook-embedify
|
|
|
|
|
|
|
|
|
|
[mdBook-embedify] es un complemento para el preprocesador[^nota1] de *mdbook* que le permite insertar videos de [YouTube], fragmentos de código de [Codepen] o [GitHub Gist][github-gist] entre otros.
|
|
|
|
|
|
|
|
|
|
> 📝 **Importante:** A continuación se listarán las funcionalidades que ofrece *mdBook-embedify*; sin embargo, únicamente se profundizará en aquellas que me resultan particularmente útiles en mi flujo de trabajo actual. Si desea conocer a profundidad todas sus características, le sugiero encarecidamente que recurra a la [documentación oficial][mdBook-embedify-docs].
|
|
|
|
|
Un shortcode es un simple fragmento de código dentro de un archivo de contenido Markdown que el preprocesador renderizará como código HTML usando una plantilla predefinida.
|
|
|
|
|
|
|
|
|
|
## Inserción global
|
|
|
|
|
|
|
|
|
|
Some apps allow you to automatically embed to every chapter. You can do this by modifying `book.toml` file to enable them.
|
|
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
|
|
```toml
|
|
|
|
|
[preprocessor.embedify]
|
|
|
|
|
scroll-to-top.enable = true
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<!-- embed ignore begin -->
|
|
|
|
|
|
|
|
|
|
> 💥Attention
|
|
|
|
|
>
|
|
|
|
|
> When you do this, you don't need to add `{% embed scroll-to-top %}` manually. It will be automatically added it to every chapter. If you do, it will be rendered twice.
|
|
|
|
|
|
|
|
|
|
<!-- embed ignore end -->
|
|
|
|
|
|
|
|
|
|
Below is a full list of apps that support global configuration:
|
|
|
|
|
|
|
|
|
|
```toml
|
|
|
|
|
[preprocessor.embedify]
|
|
|
|
|
scroll-to-top.enable = true
|
|
|
|
|
|
|
|
|
|
footer.enable = true
|
|
|
|
|
footer.message = "Copyright © 2024 • Created with ❤️ by [MR-Addict](https://github.com/MR-Addict)"
|
|
|
|
|
|
|
|
|
|
announcement-banner.enable = true
|
|
|
|
|
announcement-banner.id = "0.2.8"
|
|
|
|
|
announcement-banner.theme = "default"
|
|
|
|
|
announcement-banner.message = "*Version **0.2.8** now has relased, check it out [here](https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.8).*"
|
|
|
|
|
|
|
|
|
|
giscus.enable = true
|
|
|
|
|
giscus.repo = "MR-Addict/mdbook-embedify"
|
|
|
|
|
giscus.repo-id = "R_kgDOLCxX0Q"
|
|
|
|
|
giscus.category = "General"
|
|
|
|
|
giscus.category-id = "DIC_kwDOLCxX0c4CdGx-"
|
|
|
|
|
giscus.reactions-enabled = "1"
|
|
|
|
|
giscus.theme = "light"
|
|
|
|
|
giscus.lang = "en"
|
|
|
|
|
giscus.loading = "eager"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You can see more details about each app at its own page.
|
|
|
|
|
|
|
|
|
|
## Ignore Embeds
|
|
|
|
|
|
|
|
|
|
Sometimes you may want preprocessor to ignore some embeds.
|
|
|
|
|
|
|
|
|
|
You can do it by wrapping content that you want to ignore with below two comments:
|
|
|
|
|
|
|
|
|
|
- `<!-- embed ignore begin -->`
|
|
|
|
|
- `<!-- embed ignore end -->`
|
|
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
|
|
```md
|
|
|
|
|
<!-- embed ignore begin -->
|
|
|
|
|
|
|
|
|
|
{% embed youtube id="DyTCOwB0DVw" loading="lazy" %}
|
|
|
|
|
|
|
|
|
|
<!-- embed ignore end -->
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
And youtube embed won't be rendered.
|
|
|
|
|
|
|
|
|
|
## Funcionalidades
|
|
|
|
|
|
|
|
|
|
- Footer: Pie de página
|
|
|
|
|
- Scroll To Top: Ir al inicio de la página
|
|
|
|
|
- Announcement Banner: Banner de anuncios
|
|
|
|
|
- Gist
|
|
|
|
|
- Giscus
|
|
|
|
|
- Youtube
|
|
|
|
|
- Codepen
|
|
|
|
|
- Stackblitz
|
|
|
|
|
- Codesandbox
|
|
|
|
|
- Bilibili
|
|
|
|
|
> 📝 **Nota**
|
|
|
|
|
>
|
|
|
|
|
> A continuación se listarán superficialmente las funcionalidades que ofrece *mdBook-embedify*; sin embargo, únicamente se expondrán aquellas que me resultan particularmente útiles en mi flujo de trabajo actual. Si desea conocer en profundidad todas sus características, le sugiero encarecidamente que recurra a la [documentación oficial][mdBook-embedify-docs].
|
|
|
|
|
|
|
|
|
|
### Pie de página
|
|
|
|
|
- *Footer* — Agrega, de forma global o específica, un pie de página personalizable al libro.
|
|
|
|
|
- *Scroll To Top* — Agrega una opción para ir al comienzo de la página.
|
|
|
|
|
- *Announcement Banner* — Banner de anuncios
|
|
|
|
|
- Gist —
|
|
|
|
|
- Giscus —
|
|
|
|
|
- Youtube —
|
|
|
|
|
- Codepen —
|
|
|
|
|
- Stackblitz —
|
|
|
|
|
- Codesandbox —
|
|
|
|
|
- Bilibili —
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Footer
|
|
|
|
|
|
|
|
|
|
La aplicación de pie de página (`footer`) resulta útil para mostrar información de derechos de autor, política de privacidad y otra información legal. Admite sintaxis Markdown para que pueda personalizar fácilmente el mensaje.
|
|
|
|
|
|
|
|
|
|