Giter Site home page Giter Site logo

j2static's Introduction

J2static

About this project

This project aims to unify a set of internally produced scripts for generating static content, choosing to standardise on the jinja2 templating engine.

Simply put, this project aims to provide utilities to do the following:

  • Static site generation (for gitlab)
  • Generate customised summary documents based on submissions
  • Generate PDFs from CSV files and templates (mail merges)

Development

The recommended way to develop the tools in the package is to use development mode of setup.py, this will create executables in your path which can be used to test changes.

./setup.py develop --user

We're open to pull requests and feature requests, this should be done via our gitlab server.

Usage

The project consits of two executables, j2static, the static site generator and j2merge, the mail merge tool.

j2static executable

j2static builds files stored in a directory named _templates/ using jinja2, generating output documents in site/. The tool will ignore any file that starts with an underscore, allowing for the creation of templates.

j2static can also act as a webserver for local testing. In this mode the server will not generate output documents on disk, but will instead generate and send them to the browser 'on the fly'. This is useful if you have javascript on your site and don't want to fall foul of the browser's security settings when testing with local files.

j2static build # use templates in the _templates/ directory to build the site
j2static serve # start a webserver on localhost (for development)

j2merge executable

j2merge is a 'mail merge' tool for combining csv files with a template document this is useful for producing reports or personalised documents. This can be optionally combined with a LaTeX distrubtion to generate PDFs.

j2merge assumes that the csv file provided has headers and contains a row named id which will be used for the resulting filenames. The data for each row will be available in the template as the variable row.

j2merge data.csv # combine data.csv and base.html to generate documents
j2merge data.csv -out pdf # combine data.csv and base.tex to generate pdfs

j2static's People

Contributors

webpigeon avatar piers-williams avatar

Watchers

 avatar James Cloos avatar Bruce Cowan 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.