Coder Social home page Coder Social logo

qrencode-el's Introduction

QREncode EL

QR Code encoder written in pure Emacs Lisp.

For example the self-link (https://github.com/ruediger/qrencode-el) below was generated using this code:

qr-self.png

Usage

This package provides two user facing interactive functions, that will encode text into a QR Code and show it in a separate buffer.

qrencode-region
Shows the current selection as a QR Code.
qrencode-url-at-point
Encode URL at point as QR Code.

Some customizations are provided using M-x customize-group RET qrencode RET.

QR Codes are rendered as Unicode text, but there is an option to export them as bitmap (NetPBM format). There are also some public elisp library functions to generate QR Codes for use in other elisp code.

Converting different bitmaps

This package only supports exporting to NetPBM format due to the simplicity of the format. If PNG or other bitmap formats are desired this can be achieved by using qrencode-post-export-functions to run a conversion after the export. For example using convert(1) from ImageMagick:

(add-hook 'qrencode-post-export-functions
        #'(lambda (filename)
            (call-process "convert" nil nil nil
                          filename
                          (file-name-with-extension filename "png"))))

Installation

https://melpa.org/packages/qrencode-badge.svg https://stable.melpa.org/packages/qrencode-badge.svg

QREncode is available via MELPA and el-get.

Background

https://github.com/ruediger/qrencode-el/actions/workflows/test.yml/badge.svg

The code is written in pure Emacs Lisp on GNU Emacs 27. It should be backwards compatible to GNU Emacs 25.1 and potentially even earlier with seq and cl-lib compat libraries.

There are unit tests and an integration test using zbar.sf.net (Debian/Ubuntu package zbar-tools) to verify that generated QR Codes can be decoded. Unfortunately zbar doesn’t handle UTF-8 well, which prevents automated testing of Unicode. https://qrlogo.kaarposoft.dk/qrdecode.html is another good way to test the generated codes, since the decoder supports debug output.

The encoder is written for the ISO/IEC 18004:2015 standard. It only supports regular QR Codes (Model 2) and byte encoding (#11). I believe this is sufficient for use-cases in GNU Emacs. The word “QR Code” is registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

qrencode-el's People

Contributors

ruediger 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.