Git Product home page Git Product logo

md2png's Introduction

logo generated by https://egoist.moe/slogan/

Render markdown file to PNG image. Support custom CSS URL/file.

Install

go get github.com/weaming/md2png

Usage

Usage of ./md2png:
  -bin string
        wkhtmltoimage bin path (default "/usr/local/bin/wkhtmltoimage")
  -css string
        optional css file path, support any style you like❤️, include fonts!
  -debug
        show generated html
  -m string
        markdown file path
  -o string
        output file path (default same as markdown file name)
  -w int
        output image width (default 960)

Example css

Screenshot

wkhtmltoimage download url

md2png's People

Contributors

weaming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

md2png's Issues

Failed to execute the binary (open : no such file or directory)

My environment: Ubuntu 20.04 LTS, Go version go1.13.8 linux/amd64.

As suggested I run:

go get github.com/weaming/md2png

It builded an executable of 8.5MB in /home/jerzy/go/bin/ with the following details:

-rwxrwxr-x 1 jerzy jerzy 8.5M Jul 24 13:21 md2png

but wasn't able to run it:

./md2png
2021/07/24 13:26:01 open : no such file or directory

Resolved to clone the repo and build it manually I did:

git clone https://github.com/weaming/md2png.git && cd md2png && go build

I got the following from Go:

main.go:12:2: cannot find package "github.com/golang-commonmark/markdown" in any of:
	/usr/lib/go-1.13/src/github.com/golang-commonmark/markdown (from $GOROOT)
	/home/jerzy/go/src/github.com/golang-commonmark/markdown (from $GOPATH)

I then installed the dependency:

go get github.com/golang-commonmark/markdown && go build

and got the same issue, the binary is present but I cannot run it.

./md2png
2021/07/24 13:26:01 open : no such file or directory

As can be seen, the built binary has all the right permissions to be run. What may be the cause of this issue?

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.