{"repo":"abhinav/goldmark-anchor","free":true,"listed":false,"github":"https://github.com/abhinav/goldmark-anchor","clone":"git clone https://github.com/abhinav/goldmark-anchor.git","description":"Generates anchors next to headings in a Markdown document.","language":"Go","stars":10,"topics":["goldmark","markdown"],"license":"BSD-3-Clause","category":"productivity","readme_excerpt":"goldmark-anchor goldmark-anchor is an extension for the [goldmark] Markdown parser that adds support for anchors next to all headers. [goldmark]: http://github.com/yuin/goldmark Demo : A web-based demonstration of the extension is available at . Installation Usage To use goldmark-anchor, import the anchor package. Then include the anchor.Extender in the list of extensions when constructing your [ goldmark.Markdown ]. [ goldmark.Markdown ]: https://pkg.go.dev/github.com/yuin/goldmark#Markdown This will begin adding '¶' anchors next to all headers in your Markdown files. NOTE : The example above adds the parser.WithAutoHeadingID option. Without this, or a custom implementation of parser.IDs , Goldmark will not add id attributes to headers. If a header does not have an id , then goldmark-anchor will not generate an anchor for it. Changing anchor text Change the anchor text by setting the Texter field of the Extender to an anchor.Text value. Dynamic anchor text You can dynamically calculate anchor text by supplying a custom implementation of Texter to the Extender . For example, the following Texter repeats '#' matching the header level, providing anchors similar to Markdown # -style headers. Skipping headers To skip headers, supply a custom Texter that returns an empty output for the AnchorText method. The following Texter will not render anchors for level 1 headers. Changing anchor attributes Change the anchor attributes by setting the Attributer field of the Extender . By defa","default_branch":null,"files":null,"tree":[],"storefront":"/r/abhinav","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/abhinav/goldmark-anchor/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}