Download the PHP package michaldudek/genry without Composer

On this page you can find all versions of the php package michaldudek/genry. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package genry

Genry

Build Status

Genry is a static page generator that uses Twig templating system.

Use cases include:

It's perfect for people who don't have experience with building dynamic websites in server side languages, but want to ease their website building process by eliminating copy/paste code (like navigation HTML) or want to make use of powerful templating language.

Visit http://www.michaldudek.pl/genry/.

TL;DR

More information

Write content in Markdown

Genry allows you to import Markdown files directly into HTML files, so you can focus on writing your content, instead of markup.

Templating

For comprehensive list of possibilites you should check Twig for Template Designers, but to highlight a few of them:

Extensibility

Genry is built in with Splot Framework (to be released, currently in active development) and can be easily extended through Splot's module system and dependency injection, as well as Twig's extensions feature.

Requirements

Genry requires PHP 5.4+ command line environment to run which means that it runs just fine on Mac OS X and Linux (I have no idea about Windows, sorry...).

It also requires PHP's package manager - Composer. To install Composer follow their instructions, but in short it's this:

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

Composer will help your projects to use the latest version of Genry and will give you access to all of its modules and extensions.

Installation

Genry lives directly inside your project, so you don't have to install it on your computer. Simply, when you are about to start a new website project open your Terminal and run this command (where suchwebsite is name/path to your project so you should probably change it to something else):

$ composer create-project michaldudek/genry-project suchwebsite -s dev
$ cd suchwebsite

This will create a basic boilerplate template for your project and some files and dirs that are required for Genry to run:

This may seem like quite a lot of files to just start a website, but they are there for a reason and should never get in your way.

Configuration

You can create a .genry.yml in the root of your project if you want to configure Genry.

This is the default configuration:

cache_dir: .cache
templates_dir: _templates
web_dir: .

modules:
    # here you can list additional Genry modules you want available, using their full PHP namespace

Updating and re-installing

If you ever wanted to update Genry to newer version or install it for a Genry project that you deleted from your computer, but pulled it back from somewhere, just use these commands:

Usage

By default all templates are stored inside the _templates dir so that they don't pollute the root dir and are clearly separated from the generated HTML files. Any *.html.twig files inside that dir (and its subdirs) will be compiled and turned to static HTML files inside the root folder of the project. The directory structure from inside _templates will be kept, e.g.

One exception to this rule are files that end with *.inc.html.twig - these will not be compiled. Their only purpose is to be included inside other templates.

When you include or extend other templates in Twig, always specify their locations relative to the _templates directory.

So, if you have a directory structure like this:

_templates/
    slides/
        project1.inc.html.twig
        project2.inc.html.twig
    layout/
        header.inc.html.twig
        footer.inc.html.twig
    index.html.twig
    layout.inc.html.twig
assets/
    ...
composer.lock
composer.json
genry

Your index.html.twig template should refer to all other templates like this:

{% extends "layout.inc.html.twig" %}

{% block body %}
    {% include "layout/header.html.twig" %}

    <section>
        {% include "project1.inc.html.twig" %}
    </section>
    <section>
        {% include "project2.inc.html.twig" %}
    </section>

    {% include "layout/footer.html.twig" %}
{% endblock %}

Always refer to templates relative to the _templates/ dir, even from templates next to each other in the same sub directory.

Compiling

When you have created your templates compile them by executing this command in the command line in your project folder:

$ php genry generate

Assets Management

Because the generated HTML files will be saved in different locations relative to the root dir while probably extending a single layout template and because your website might not always live in the root dir of your domain (think GitHub project pages which are located at http://username.github.io/projectname/) using relative or absolute paths to your JavaScript and CSS files might cause a lot of problems.

For example, if your _templates/layout.inc.html.twig file includes assets like this:

<link rel="stylesheet" href="/assets/css/global.css">
<script type="text/javascript" src="/assets/js/global.js"></script>

It will only work if your website resides in root folder of your domain. If you were to put it in a subdir, e.g. at yourdomain.com/suchwebsite/ links to the assets would be broken.

However, if you change them to be relative:

<link rel="stylesheet" href="assets/css/global.css">
<script type="text/javascript" src="assets/js/global.js"></script>

This will only work for files that are located in the root dir of your website. If you made a template _templates/subdir/article.html.twig:

{% extends "layout.inc.html.twig" %}

{% block content %}
    Lorem ipsum dolor sit amet.
{% endblock %}

It will compile to a file subdir/article.html and the relativeassets links will also be broken for this one page.

Genry takes care of these two problems if you let him.

Wherever you want to add a CSS or JS file use this notation:

{{ stylesheet('/path/to/css/relative/to/project/dir.css') }}
{{ javascript('/path/to/js/relative/to/project/dir.js') }}

And to output all CSS files (typically in <head>):

{{ stylesheets() }}

And JS files (typically right before </body>):

{{ javascripts() }}

The result will be that Genry will generate URL's to those assets always relative to the generated static HTML file. This way your generated files can safely be put at whatever location on your server as well as opened locally straight from the file system.

Features

Genry comes with few pre-packaged features that don't require any additional modules.

Markdown

If you want to write your content in Markdown (like this documentation) you can easily import and compile Markdown files inside your templates by simply writing:

{{ markdown('path/to/file/in/templates/article.md') }}

You can also use a Markdown filter:

{{ "[such website](http://www.dogeweather.com), **much markdown**, such HTML."|markdown }}

Data Objects

TBD

Roadmap

Genry is very much work in progress and the core of it has been created in one (albeit long) evening. There are many ideas and features that could be developed for it, but I want to keep it simple. Here is a list of features that are on the roadmap for the nearest future (ie. when need be):

Contribute

Pull requests, reported issues and any help is welcome. Just keep in mind that this is a strongly personal project and I might have already started working on something that you wanted to do, so before doing any coding work please submit an issue with your idea for discussion.

If you want to develop something for Genry then I will be very happy to help, as there isn't much documentation on this topic yet. Just open an issue and I'll reply to it.


All versions of genry with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
michaldudek/foundation Version >=0.9
splot/framework Version 0.8.*@dev
splot/assets-module Version 0.6.*@dev
splot/twig-module Version 0.6.*@dev
michelf/php-markdown Version 1.3.*@dev
symfony/yaml Version >=2.1,<3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package michaldudek/genry contains the following files

Loading the files please wait ....