Code Monkey home page Code Monkey logo

layoutforme's Introduction

Layout For Me


LayoutForMe is an open source document generator that helps you to focus more on the content.

You write Markdown, it gives you a PDF document (for now...).


Features

  • Retrieve history of your document throught git tags
  • Templating templates !
  • Template translation
  • Template inclusion

Dependencies

  • Go
  • A LaTeX distribution (in order to have the lualatex command)
  • libgit2
  • pandoc

Install

go get github.com/Dhiver/layoutForMe

go install github.com/Dhiver/layoutForMe

Quick Start

You can see an example workdir HERE.

Quick Start Explained

Create a workdir

In a new git repository, put your markdown files inside a folder named content.

Ex.

.
|- content/
|  |- intro.md
|  |- conclusion.md

Create an empty build folder and an empty file named configuration.yaml.

Give metadata about your document

In a file called metadata.yaml set metadata about your document:

Here is an example :

lang: fr-FR
dateLayout: "02/01/2006"

title: Bonjour à tous !
author:
    - John Smith
    - Foo Bar

abstract:
date:
version:

includeOrder:
    - intro.md
    - conclusion.md

output:
    - name: mon_document
      extention: pdf
      template: article.tex.tmpl

If you leave the abstract field blank, the content of a file nammed README.md will be load into.

If the date field is leave empty, the current date will be automatically inserted.

If the version field is empty, layoutForMe will look for tags in the current git repository and insert then as entries.

Create a template

A template will be a LaTeX document (.tex) with Go templating language.

Here is an example

In the template, you can use variables defined in metadata.go as well as functions defined in template.go (near funcMap).

Layout !

layoutForMe -path /your/document/path

The generated document will be in the build folder.

Configuration

In the configuration file : configuration.yaml you can change some values :

  • metaFile (Default: metadata.yaml)
  • buildFolder (Default: build)
  • textFolder (Default: content)
  • pictureFolder (Default: img)
  • templateFolder (Default: templates)
  • translateFolder (Default: translations)
  • latexEngine (Default: lualatex)

layoutforme's People

Watchers

 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.