Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/russross/blackfriday"
version = "1.5.2"

[prune]
go-tests = true
unused-packages = true
5 changes: 3 additions & 2 deletions htmltopdf.go → htmltopdf/htmltopdf.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package main
package htmltopdf

import (
"errors"
"io/ioutil"
"log"
"os"
"os/exec"
"strings")
"strings"
)

const wkhtmltopdfCmd = "wkhtmltopdf"

Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"net/url"
"os"
"path/filepath"

"github.com/TheL1ne/md2pdf/markdown"
)

func init() {
Expand Down Expand Up @@ -52,7 +54,7 @@ func main() {
log.Fatal(err)
}

md := NewMarkdown(text)
md := markdown.NewMarkdown(text)

opts := []string{"--print-media-type"}
if *css != "" {
Expand Down
9 changes: 6 additions & 3 deletions markdown.go → markdown/markdown.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package main
package markdown

import "github.com/russross/blackfriday"
import (
"github.com/TheL1ne/md2pdf/htmltopdf"
"github.com/russross/blackfriday"
)

type Markdown struct {
text []byte
Expand Down Expand Up @@ -37,5 +40,5 @@ func (md *Markdown) ToHtml(title string, enableExtensions bool) []byte {

func (md *Markdown) ToPdf(outfile, title string, opts ...string) error {
html := md.ToHtml(title, true)
return HtmlToPdf(html, outfile, opts...)
return htmltopdf.HtmlToPdf(html, outfile, opts...)
}
8 changes: 8 additions & 0 deletions vendor/github.com/russross/blackfriday/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions vendor/github.com/russross/blackfriday/LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading