HomeworkReport

HomeworkReport is an utility program, which generates HTML files with given template files.

Installation

You are a user

Install it yourself as:

$ gem install homework_report

Note that extra libraries are required if you want to use Haml, Slim, or Markdown instead of ERB

You are a developer

Add this line to your application's Gemfile:

gem 'homework_report'

And then execute:

$ bundle

Usage

Supported Template Formats

FORMAT       FILE EXTENSIONS             REQUIRED LIBRARIES
------------ --------------------------- ------------------------
ERB          .erb, .rhtml                none
Haml         .haml                       haml
Slim         .slim                       slim
Markdown     .markdown, .mkd, .md        redcarpet, maruku, or kramdown

Tool

It generates HTML text to the standard output or file

$ homework_report [options] FILE

You can execute $ homework_report --help to see the available options

Simple Example

homework.slim

- @topic = "Uncharted"
- @name = "Nathan Drake"
doctype html
html
  head
    title= @topic
  body
    p
      | Name: #{@name}

Execute the command to generate HTML

$ homework_report -o homework.html homework.slim

More Complex Example

homework.slim

- @course = "Digital Image Synthesis"
- @topic = "Assignment #1 - Height Field"
- @name = "David Lin"
- @submission_date = Date.today
= render 'template.slim'

template.slim

doctype html
html
  head
    title #{@course} - #{@topic}
  body
    div
      h1= @topic
      h3 Name: #{@name}
      h3 Submission Date: #{@submission_date}
    div
      = render "description.md"
    div
      = render "final_images.slim"

description.md

## Description of implementation approach and comments
blahblahblah

final_images.slim

h2 Final Images Rendered with my implementation of Heightfield2
p
  img src="http://www.csie.ntu.edu.tw/~cyy/courses/rendering/12fall/assignments/proj1/smooth.jpg"

Finally, execute the command to generate homework.html

$ homework_report -o homework.html homework.slim

Lib

TODO: I'm working on it

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request