Socket
Book a DemoInstallSign in
Socket

tangled.org/zerolimits.dev/znak

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tangled.org/zerolimits.dev/znak

Go Modules
Version
v0.21.0
Version published
Created
Source

Znak

A parser for a Markdown-like markup language that supports a smaller subset of Markdown syntax, and is stricter and more opinionated. It has features like syntax highlighting, $\LaTeX$, and heading IDs built-in.

You can read the syntax here. You can also read the documentation for Highlight (the syntax highlighter in Znak) here.

Usage

Add it as a dependency to your project:

go get -u tangled.org/zerolimits.dev/znak

Then you can use it in your code:

package main

import (
	"tangled.org/zerolimits.dev/znak"
	"tangled.org/zerolimits.dev/znak/highlight"
)

func main() {
	themeFile, err := os.ReadFile("path/to/theme.css")
	codeTheme, err := highlight.NewTheme(themeFile)

	inputFile, err := os.ReadFile("path/to/file.md")
	input := string(inputFile)

	renderedHtml, err := znak.Render(input, codeTheme)
	headings := znak.Headings(input)
	frontmatter, err := znak.Frontmatter(input)
}

Acknowledgements

$\LaTeX$ is rendered to MathML using Wyatt915/TreeBlood.

The example code theme in theme.css is taken from PyaeSoneAungRgn/github-zed-theme.

FAQs

Package last updated on 22 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts