Skip to content

Convert blocks of code to a highlighted jpeg base64 image.

License

Notifications You must be signed in to change notification settings

Zhang-Siyang/code-to-image

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code to Image

Code to Image converts your blocks of code to a highlighted jpeg base64 image. And you can share it to any code-unfriendly website —— Such website doesn't support markdown or <pre><code> tag or anything else that can make your post contains any blocks of code in it.

It is much better than screen shot since you can pick a single image from very large code files. More than 40 programming languages can be highlighted and picked.

Example

http://c2i.zhangsy.me

Paste blocks of code to textarea and press Ctrl+D to pick image.

Default languages

Default languages included C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, JavaScript, Makefile, and Rust.

Thanks

Thanks to code-prettify and html2canvas.

License (Multi-licensing)

Apache License 2.0 LICENSE

以下的内容可能已经失效, 仅供参考!!!; 我将于不久的将来重写以下内容.

Installation

git clone https:/akira-cn/code-to-image.git
cd code-to-image
npm install

Development

npm start

Compile & Release

npm run compile

Extensions

Other languages are supported via extensions:

Apollo; Basic; Clojure; CSS; Dart; Erlang; Go; Haskell; Lasso; Lisp, Scheme; Llvm; Logtalk; Lua; Matlab; MLs: F#, Ocaml,SML; Mumps; Nemerle; Pascal; Protocol buffers; R, S; RD; Rust; Scala; SQL; Swift; TCL; Latek; Visual Basic; VHDL; Wiki; XQ; YAML

About

Convert blocks of code to a highlighted jpeg base64 image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.5%
  • HTML 1.9%
  • CSS 1.6%