Code Monkey home page Code Monkey logo

cottle's Introduction

Cottle: Compact Object to Text Transform Language

Build Status

Overview

Cottle is an open-source (MIT) templating engine for C# .NET designed to be light, fast and extensible. If you never used a templating engine before, here is a simple example about how it could be used:

  • A program of yours generated some structured data, for example a list of products with associated name, description, quantity and price for each of them.
  • You want to make out an invoice from this list, meaning you want to render them as a formatted output like an HTML page, an XML document or a plain text file.
  • By writing a template, which is a file that describes how your inputs should be rendered to produce the final invoice, Cottle allows you to manage this data transform. Once your template is ready, it can be re-used with any products list as long as it keeps the same structure (to keep with our example, products with names, descriptions, quantities and prices).

Template files must be written using Cottle's template language as explained in user manual (see "Installation" section).

Installation

This repository contains a Visual Studio 2010 C# solution with two projects:

  • Cottle, the library itself, which is the project you'll include in your own solution if you want to use it. It is compatible with .NET 3.5 and above.
  • Demo, a simple Windows Form test program that allows you to write templates directly in a text box and render them using predefined data.

User manual is available at http://r3c.github.io/cottle/ (or in "gh-pages" branch of this repository) and explains how to use the library with many code snippets and examples.

Licence

This project is open-source, released under MIT licence. See "LICENSE" file for more information. Any contribution would be of course highly welcomed!

Author

Rémi Caput (cottle [at] mirari [dot] fr) http://remi.caput.fr/

If you use my library, please drop me a line!

cottle's People

Contributors

gboucher90 avatar manitra avatar r3c 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.