Documentation
¶
Overview ¶
Package typographer allows you to select the language typographic substitutions for Goldmark Typograph.
This library is not a replacement of the standard Goldmark typography, and only expands its capabilities by adding quotation symbols for different languages. Quotes substitutions based on Wikipedia Page https://en.wikipedia.org/wiki/Quotation_mark. If the substitutions for this language are not specified, the library tries to use substitutions for the base language or default.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a new goldmark.Extender that replaces punctuations with typographic entities for the specified language.
Example ¶
package main import ( "os" typographer "github.com/mdigger/goldmark-lang-typographer" "github.com/yuin/goldmark" ) var source = []byte( `"Хруст французской булки" -- так заканчивается сказка про колобка братьев Гримм...`) func main() { markdown := goldmark.New( goldmark.WithExtensions( typographer.New("ru"), ), ) err := markdown.Convert(source, os.Stdout) if err != nil { panic(err) } }
Output: <p>«Хруст французской булки» — так заканчивается сказка про колобка братьев Гримм…</p>
func Options ¶
func Options(lang ...string) extension.TypographerOption
Options return an TypographerOption options for the TypographerParser.
func Substitutions ¶
func Substitutions(lang ...string) extension.TypographicSubstitutions
Substitutions returns a substitutions of typographic characters for the specified language.
Types ¶
This section is empty.