9

[Golang] reStructuredText Package

 2 years ago
source link: http://siongui.github.io/2016/01/23/go-rst-package/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Test Code

Test program:

hhatto.go | repository | view raw

package main

import (
	"bufio"
	"bytes"
	"github.com/hhatto/gorst"
	"io/ioutil"
	"os"
)

func main() {
	p := rst.NewParser(nil)

	w := bufio.NewWriter(os.Stdout)
	d, _ := ioutil.ReadFile("test.rst")
	p.ReStructuredText(bytes.NewReader(d), rst.ToHTML(w))
	w.Flush()
}

Test rst file:

test.rst | repository | view raw

`my blog <https://siongui.github.io>`_

----

*italic*

**bold**

``hello``

Heading
=======

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK