Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akira-cn/code-to-image
Convert blocks of code to a highlighted jpeg base64 image.
https://github.com/akira-cn/code-to-image
canvas code language
Last synced: about 18 hours ago
JSON representation
Convert blocks of code to a highlighted jpeg base64 image.
- Host: GitHub
- URL: https://github.com/akira-cn/code-to-image
- Owner: akira-cn
- License: mit
- Created: 2016-06-02T09:39:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-07T06:42:20.000Z (almost 7 years ago)
- Last Synced: 2025-01-17T20:37:35.001Z (9 days ago)
- Topics: canvas, code, language
- Language: JavaScript
- Homepage:
- Size: 237 KB
- Stars: 278
- Watchers: 11
- Forks: 29
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 `
` 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://code2img.75team.com](http://code2img.75team.com/#)
Paste blocks of code to textarea and **press Ctrl+D** to pick image.
## Installation
```bash
git clone https://github.com/akira-cn/code-to-image.git
cd code-to-image
npm install
```## Development
```bash
npm start
```## Compile & Release
```bash
npm run compile
```## Default languages
Default languages included bash; C; C++; C#; HTML; Java; JavaScript; XML; Perl; Python; Ruby; PHP;
## Extensions
Other languages are supported via extensions:
[Apollo](http://code2img.test.h5jun.com/#apollo); [Basic](http://code2img.test.h5jun.com/#basic); [Clojure](http://code2img.test.h5jun.com/#clojure); [CSS](http://code2img.test.h5jun.com/#css); [Dart](http://code2img.test.h5jun.com/#dart); [Erlang](http://code2img.test.h5jun.com/#erlang); [Go](http://code2img.test.h5jun.com/#go); [Haskell](http://code2img.test.h5jun.com/#hs); [Lasso](http://code2img.test.h5jun.com/#lasso); [Lisp, Scheme](http://code2img.test.h5jun.com/#lisp); [Llvm](http://code2img.test.h5jun.com/#llvm); [Logtalk](http://code2img.test.h5jun.com/#logtalk); [Lua](http://code2img.test.h5jun.com/#lua); [Matlab](http://code2img.test.h5jun.com/#maltab); [MLs: F#, Ocaml,SML;](http://code2img.test.h5jun.com/#ml) [Mumps](http://code2img.test.h5jun.com/#mumps); [Nemerle](http://code2img.test.h5jun.com/#nemerle); [Pascal](http://code2img.test.h5jun.com/#pascal); [Protocol buffers](http://code2img.test.h5jun.com/#protocol); [R, S](http://code2img.test.h5jun.com/#r); [RD](http://code2img.test.h5jun.com/#rd); [Rust](http://code2img.test.h5jun.com/#rust); [Scala](http://code2img.test.h5jun.com/#scala); [SQL](http://code2img.test.h5jun.com/#sql); [Swift](http://code2img.test.h5jun.com/#swift); [TCL](http://code2img.test.h5jun.com/#tcl); [Latek](http://code2img.test.h5jun.com/#latek); [Visual Basic](http://code2img.test.h5jun.com/#vb); [VHDL](http://code2img.test.h5jun.com/#vhdl); [Wiki](http://code2img.test.h5jun.com/#wiki); [XQ](http://code2img.test.h5jun.com/#xq); [YAML](http://code2img.test.h5jun.com/#yaml)
## Thanks
Thanks to [code-prettify](https://github.com/google/code-prettify) and [html2canvas](https://github.com/niklasvh/html2canvas).
## License (Multi-licensing)
[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) [LICENSE](LICENSE)