Chromium running inside your terminal
Go to file
2022-11-16 03:02:18 +01:00
electron Initial commit 2022-11-11 10:23:16 +01:00
scripts fix(electron): fix gmail.com and youtube.com in Docker (#7) 2022-11-14 21:07:39 +01:00
src fix: remove docker-specific error messages (#13) 2022-11-16 03:02:18 +01:00
.gitignore feat: add PDF support (#8) 2022-11-15 09:36:24 +01:00
.prettierrc.json Initial commit 2022-11-11 10:23:16 +01:00
Dockerfile feat: add PDF support (#8) 2022-11-15 09:36:24 +01:00
package.json feat: add PDF support (#8) 2022-11-15 09:36:24 +01:00
readme.md feat: add PDF support (#8) 2022-11-15 09:36:24 +01:00
tsconfig.json Initial commit 2022-11-11 10:23:16 +01:00
yarn.lock feat: add PDF support (#8) 2022-11-15 09:36:24 +01:00

html2svg

Convert HTML and <canvas> to SVG or PDF using Chromium.

Usage

# export to SVG
$ docker run fathyb/html2svg https://google.com > google.svg
$ docker run fathyb/html2svg https://google.com --format svg > google.svg
# export to PDF
$ docker run fathyb/html2svg https://google.com --format pdf > google.pdf

Development

  • Building Chromium for ARM on Linux or Windows is not officially supported, cross-compile from x64 instead.

Docker

$ docker buildx build . --platform linux/arm64,linux/amd64

Local

  1. Fetch dependencies:
    $ yarn
    
  2. Clone Electron.js and Chromium using gclient:
    $ yarn gclient
    
  3. Configure the build system using gn using one of these commands:
    # for local developement
    $ yarn gn testing
    # or for releasing
    $ yarn gn release
    # add --ide=xcode if you'd like to generate an Xcode project on macOS
    $ yarn gn release --ide=xcode
    
  4. Build using ninja using one of these commands:
    # make a testing build
    $ yarn ninja testing
    # make a release build
    $ yarn ninja release