GithubHelp home page GithubHelp logo

resulang's Introduction

Resulang

Resulang is a simple tool for creating html resumes. It can also be used to create other kinds of documents with structured data. It works by separating the data from the html template, which means the data could theoretically be used to generate other kinds of output in the future, not just html.

TODO: write tests

Installation

$ gem install resulang

Usage

Once resulang is installed, create a new resulang app with:

bundle exec resulang new my_resume --sections one two three

This will generate the basic structure of a resulang app as well as a few key files:

  • my_resume/resume.yaml

    This is where you put your resume data.

  • my_resume/templates/resume.html.erb

    This is where you write your resume html which has access to the data in my_resume/resume.yaml

A resume is broken into named sections. For example:

  personal:
    name: Peter Brindisi
    phone: 555-555-5555
    email: [email protected]
    github: https://github.com/npj

  background:
    description: >-
      I am a guy that does things. Things are awesome and they are also cool.

  skills:
    things: ['foo', 'bar', 'baz', 'qux']

  hobbies:
    points:
      - Reading about Haskell
      - Evangelizing monads
      - Making beer

A template for the above data might look like this:

<html>
  <head>
    <title><%= sections.personal.name %></title>
    <link rel="stylesheet" href="css/style.css" />
  </head>
  <body>
    <div class="section">
      <%= render_section(:personal) %>
    </div>
    <div class="section">
      <%= render_section(:background) %>
    </div>
    <div class="section">
      <%= render_section(:skills) %>
    </div>
    <div class="section">
      <%= render_section(:hobbies) %>
    </div>
  </body>
</html>

render_section(:section_name) looks for a template partial named my_resume/templates/_section_name.html.erb. A partial has direct access to the data within the data section. For example, the partial for the "personal" and "hobbies" sections might look like:

<!-- my_resume/templates/_personal.html.erb -->
<div>Name: <%= name %></div>
<div>Phone: <%= phone %></div>
<div>Email: <%= email %></div>
<div><a href="<%= github %>" target="_blank"><%= github %></a></div>
<!-- my_resume/templates/_hobbies.html.erb -->
<ul>
  <% points.each do |point| %>
    <li><%= point %></li>
  <% end %>
</ul>

To easily view changes to the resume as you make them, you can run a local server with:

bundle exec resulang server

You can put assets like images and stylesheets in directories off my_resume, like css and images or assets/css and assets/images. These can be referenced in resume.html.erb.

To generate a static html page, run:

bundle exec resulang make

This will output ./resume.html

Please see the examples directory of this project for a working example.

resulang's People

Contributors

npj avatar

Stargazers

 avatar

Watchers

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