Socket
Book a DemoInstallSign in
Socket

elegant

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elegant

1.2.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Elegant

Elegant provides a nice layout for PDF reports generated in Ruby.

The source code is available on GitHub and the documentation on RubyDoc.

Build Status Coverage Status Dependency Status Code Climate Online docs Gem Version

Elegant is a library built on top of Prawn to generate PDF files in Ruby.

Whereas Prawn creates PDF pages that are completely blank (letting users customize them at will), Elegant comes with a nice layout that makes each page look… elegant! :wink:

How to use

If you have never used Prawn to generate PDF files, you should first read its manual.

Using Elegant is as simple as replacing any instance of Prawn::Document with Elegant::Document:

# with Prawn
Prawn::Document.new do
  text 'Hello, World!'
end

# with Elegant
Elegant::Document.new do
  text 'Hello, World!'
end

# with Elegant and extra options
header = {text: 'A report', logo: {url: 'http://lorempixel.com/500/500'}}
footer = {text: 'A link', url: 'http://www.example.com'}
Elegant::Document.new(header: header, footer: footer) do
  title 'Welcome'
  text 'Hello, world!'
end

Prawn vs. Elegant

Elegant::Document accepts some options [... TODO ...]

How to install

Elegant requires Ruby 2.1 or higher.

To include in your project, add gem 'elegant', ~> '1.0' to the Gemfile file of your Ruby project.

How to generate the manual

rake manual

How to contribute

If you’ve made it this far in the README… thanks! :v: Feel free to try it the gem, explore the code, and send issues or pull requests.

All pull requests will have to make Travis and Code Climate happy in order to be accepted. :kissing_smiling_eyes:

You can also run the tests locally with bundle exec rspec.

Happy hacking!

FAQs

Package last updated on 22 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.