GithubHelp home page GithubHelp logo

svg-annotator's Introduction

SVG Annotator

Primitive single-script (JavaScript) to annotate name into SVG image. This can usually be helpful to annotate documents like certificates, name cards, invitation cards, etc.

Requirements

Optional

  • inkscape
  • git
  • cURL - pre-installed on Windows and MacOS; Linux environment could either install curl (sudo apt install -y curl) or use the pre-installed wget as alternative
  • yarn (npm install --global yarn)

Usage

Annotate SVG image formats with the names from user input argument or text file (for multiple names to different SVG files), based on the given SVG template.

Script Arguments:

  • name (optional): Intended name for annotation, can be a name or a file, defaults to check if names.txt exists for list of names if none was provided.
  • template (optional): SVG template to be annotated, defaults to check if template.svg exists to be annotated.
  • font (optional): Font style, as long they are recognized by inkscape.

Reference

Check out sample/names.txt and sample/template.svg.

Getting Started

  1. Start with either of the following, then cd into the directory.
    • git clone
      git clone [email protected]:jonnysoe/svg-annotator.git && cd svg-annotator
      
    • download the single svg-annotator.js script into a temp directory
      mkdir svg-annotator && cd svg-annotator && curl -L -o svg-annotator.js https://raw.githubusercontent.com/jonnysoe/svg-annotator/main/svg-annotator.js
      
  2. Prepare name list by the name names.txt (separated by new lines) in project root directory.
  3. Prepare a template svg file by the name template.svg.
  4. Run this command:
    node svg-annotator.js
    
    Alternatively, can run the following when package.json is present
    node .
    
    npm run start
    
    yarn run start
    
    NOTE: Single file svg-annotator.js will still generate package.json file.

TODO

  • Annotate a single SVG image with multiple names, might wanna change names.txt to CSV format where names on the same row separated by comma will appear on the same SVG file

License

Copyright © 2023 Jonny Soe.

Licensed under the MIT License (MIT) or see LICENSE file for details.

svg-annotator's People

Contributors

jonnysoe avatar

Watchers

 avatar

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.