Git Product home page Git Product logo

certificate-maker's Introduction

Certificate Maker

Certificate Maker is an experimental tool for turning HTML templates into PDF files. It pulls data from a CSV or Google Sheet, updates the data source with references to the generated PDF files, and optionally uploads the PDF files to Google Drive.

Getting Started

If things are setup properly, you should be able to run the following command with no errors:

./index.js --csv_file docs/example.csv --no-upload

After you've configured Certificate Maker to connect with Google Drive, you can issue commands such as:

./index.js --google_sheet_id [...] --worksheet [...] --google_folder_id [...]

Once things are running, you can experiment with creating templates, and adjusting configuration files!

Installation on Mac OS X

  1. Clone the repository into your local environment: git clone https://github.com/google/certificate-maker.git
  2. Go into the repository directory: cd certificate-maker
  3. Install Homebrew.
  4. Install wget: brew install wget
  5. Install fontconfig: brew install fontconfig
  6. Install Node.js: brew install node
  7. Install yarn: brew install yarn
  8. Run the pre-setup script: ./setup/pre.sh
  9. Run the Mac OS X setup script: ./setup/mac.sh
  10. Run the post-setup script: ./setup/post.sh

Installation on Ubuntu

  1. Clone the repository into your local environment: git clone https://github.com/google/certificate-maker.git
  2. Go into the repository directory: cd certificate-maker
  3. Run the pre-setup script: ./setup/pre.sh
  4. Run the Mac OS X setup script: ./setup/ubuntu.sh
  5. Run the post-setup script: ./setup/post.sh

Connecting to Google Drive and Google Sheets

You'll need to authenticate with Google Drive in order to upload files or read data from Google Sheets:

  1. Create a new Google Cloud Platform project.
  2. Enable the Google Drive API and Google Sheets API.
  3. Create OAuth Client credentials, download and save as ./config/auth/credentials.json
  4. Next time you run Certificate Maker in a way that requires use of the Google APIs, you'll be prompted to authenticate.

Creating a New Template

Templates live in ./certificates/templates/, and each set of templates that shares a given configuration (eg. same data source, same target upload directory, etc) should be grouped into its own subdirectory with a settings.yaml file.

For example, a file and folder layout for a group of templates might look like this:

  • ./certificates/templates/example/settings.yaml
  • ./certificates/templates/example/main.css
  • ./certificates/templates/example/participant.html
  • ./certificates/templates/example/winner.html

This example contains two templates, which would be referred to as:

  • example/participant
  • example/winner

All images, regardless of the template they belong to, should be placed in ./certificates/templates/images/, so that the symbolic link in ./certificates/intermediaries/ can be used to reference them during the creation of PDF certificates.

Creating a Data Source

Data sources can be Google Sheets or locally stored CSV files. Every data source is assumed to begin with a single header row which specifies column names, followed by the actual data.

Further, every data source should have two special columns: Template and File. Data in the Template column specifies which template should be used for a given row. The File column should, initially, contain no data, and is where Certificate Maker will save a path or URL to the resulting PDF file for each row.

Notes

This is not an official Google product.

This is an experimental project - expect plenty of rough edges and bugs, and no support.

certificate-maker's People

Contributors

agentmilindu avatar joshsimmons 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

certificate-maker's Issues

docker image fails due to fsevents not linux compatible

Seems it's not compatible with ubuntu?

Error: Cannot find module 'camelcase'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/app/index.js:16:19)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! Linux 3.10.0-1062.4.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "camelcase"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! path /app/node_modules/npm/node_modules/ansi-regex
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename

npm ERR! notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

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.