rm unused

This commit is contained in:
加华 m2shad0w
2017-04-17 19:35:25 +08:00
parent d72376102d
commit ff21610c44
3 changed files with 33 additions and 59 deletions

View File

@@ -1,17 +1,14 @@
package main
import (
"bufio"
"fmt"
"github.com/a8m/mark"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"bufio"
// "net/http"
// "github.com/fairlyblank/md2min"
"github.com/a8m/mark"
)
// 定义一个访问者结构体
@@ -71,34 +68,10 @@ func (self *Visitor) md2html(arg map[string]string) error {
opts.Smartypants = true
opts.Fractions = true
// r1 := []rune(s1)
m := mark.New(input, opts)
// md := md2min.New("none")
// err = md.Parse([]byte(input), out)
// client := &http.Client{}
// req, err := http.NewRequest("POST", "https://api.github.com/markdown/raw", strings.NewReader(input))
// if err != nil {
// handle error
// }
// req.Header.Set("Content-Type", "text/plain")
// req.Header.Set("charset", "utf-8")
// req.Header.Set("User-Agent", "m2shad0w")
//
// resp, err := client.Do(req)
// defer resp.Body.Close()
// body, err := ioutil.ReadAll(resp.Body)
// if err != nil {
// handle error
// }
m := mark.New(input, opts
w := bufio.NewWriter(out)
n4, err := w.WriteString(s + m.Render())
fmt.Printf("wrote %d bytes\n", n4)
// fmt.Printf("wrote %d bytes\n", n4)
//使用 Flush 来确保所有缓存的操作已写入底层写入器。
w.Flush()
if err != nil {
fmt.Fprintln(os.Stderr, "Parsing Error", err)

View File

@@ -15,7 +15,7 @@ WORKDIR="$(cd $(dirname $0); pwd -P)"
#
MSG_INSTALL_PANDOC_FIRST='请先安装pandoc然后再次运行'
MSG_SUCCESSFULLY_GENERATED='build-web-application-with-golang.epub 已经建立'
MSG_CREATOR='M2shad0w'
MSG_CREATOR='Astaxie'
MSG_DESCRIPTION='一本开源的Go Web编程书籍'
MSG_LANGUAGE='zh-CN'
MSG_TITLE='Go Web编程'

View File

@@ -3,15 +3,16 @@ package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"regexp"
"strings"
"bufio"
"net/http"
)
// 开发者 github token
const token = ""
// 定义一个访问者结构体
type Visitor struct{}