figures

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 5 Imported by: 0

README

goldmark-figures FORK

Original

Este repositorio es un sencillo fork de una extensión de Goldmark para renderizar imágenes con el elemento HTML <figure> con un <figcaption> de la descripción, en lugar del comportamiento habitual de Goldmark, que es ponerlo como alt en la <image>

Tomemos por ejemplo el siguiente código Markdown:

![Un texto alternativo](/image.png)

Normalmente se mostraría en HTML como:

<img src="image.png" alt="Un texto alternativo">

Pero con esta extensión se renderiza tal que:

<figure>
	<img src="image.png" alt="Un texto alternativo" title="Un texto alternativo">
	<figcaption>Un texto alternativo</figcaption>
</figure>

Instalación

go get github.com/arielcostas/goldmark-figures

Uso

Al instanciar Goldmark, añadir la extensión:

package main

import (
	gmf "github.com/arielcostas/goldmark-figures"
	"github.com/yuin/goldmark"
)

var parser goldmark.Markdown = goldmark.New(
	goldmark.WithExtensions(gmf.Extension),
)

Licencia

El código original de mdigger está bajo la licencia MIT. Este fork también lo está.

Documentation

Overview

SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

View Source
var Extension goldmark.Extender = new(extension)

Extension is a goldmark.Extender with markdown image figures support.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL