Giter Club home page Giter Club logo

go-markdown's Introduction

Go-markdown

A Markdown Parser in Go, this repository contains a Go library for parsing Markdown text and allowing you to manipulate a markdown tree in Go. It's designed to be fast, thread-safe, and minimal in dependencies, making it suitable for a wide range of applications.

Features

  • Extendability: The parser is easily extendable, since a parse tree can be given, allowing easy incorporation of custom elements.
  • Performance: Fast enough to render on-demand in most web applications without having to cache the output.
  • Thread Safety: Multiple parsers can run in different goroutines without ill effect.
  • Minimal Dependencies: Only depends on standard library packages in Go.
  • Large set of elements: By default a large set of markdown elements can be parsed allowing most documents to be parsed.

Usage

To use this library in your Go project, follow these steps:

  1. Install the library:
go get -u github.com/pjotrscholtze/go-markdown
  1. Use the library in your code:
package main

import (
	"github.com/pjotrscholtze/go-markdown/cmd/go-markdown/parser"
)

func main() {
	input := `Before table:

| Column 1 | Column 2 | Column 3 |
|----------|:---------:|----------:|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6<br/>Second line of text |

After first table but before second table:

Another table:

| Column A | Column B | Column C |
|----------|:---------:|----------:|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6<br/>Second line of text |

After second table:`
	doc := parser.ParseString(input, parser.DefaultMarkdownOrder)
	_ = doc
}

Technical Documentation

Technical documentation can be found in the docs folder.

Contributing

Contributions are welcome Please feel free to submit pull requests or report issues.

License

This project is licensed under the MIT License.

go-markdown's People

Stargazers

Tycho Scholtze avatar

Watchers

 avatar Tycho Scholtze avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.