https://github.com/golang-design/code2img
🖨️ A carbon-now API wrapper and iOS Shortcut
https://github.com/golang-design/code2img
carbon go golang ios-shortcut shortcuts wrapper
Last synced: 3 months ago
JSON representation
🖨️ A carbon-now API wrapper and iOS Shortcut
- Host: GitHub
- URL: https://github.com/golang-design/code2img
- Owner: golang-design
- License: gpl-3.0
- Created: 2020-10-27T20:14:51.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-11T16:22:46.000Z (over 3 years ago)
- Last Synced: 2024-11-04T16:44:08.491Z (4 months ago)
- Topics: carbon, go, golang, ios-shortcut, shortcuts, wrapper
- Language: Go
- Homepage: https://golang.design/s/code2img
- Size: 18.1 MB
- Stars: 79
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# code2img [](https://pkg.go.dev/golang.design/x/code2img) 
A carbon-now wrapper for Go users and supports for iOS Shortcut
```go
import "golang.design/x/code2img"
```## API Usage
Just one API `code2img.Render`, to use it (see [main.go](./example/main.go)):

## Service Usage
### iOS Shortcut
Basic usage notes:
- Get the shortcut from here: https://www.icloud.com/shortcuts/6ac8f9afc47e4b109bca81648c59e2f4
- The shortcut also writes a URL back to your clipboard, you can paste the link to your browser for a better copy experience.
- **Remember: Keep your life simple. Keep in mind that you do not upload more than 50 lines of code. Otherwise, no one wants to read it :)**Demo:

### Server API
```
POST golang.design/api/v1/code2img
{
"code": "code string"
}
```Response pure text (better for iOS shortcut):
```
https://golang.design/api/v1/code2img/data/images/06ad29c5-2989-4a8e-8cd2-1ce63e36167b.png
```You can also access the code text:
```
https://golang.design/api/v1/code2img/data/code/06ad29c5-2989-4a8e-8cd2-1ce63e36167b.go
```### Deploy Instructions
```sh
make
make up
```## License
© 2020-2021 The golang.design Initiative Authors.