2017 © Pedro PelĂĄez
 

symfony-bundle content-compiler-bundle

Converts everything into HTML

image

wolnosciowiec/content-compiler-bundle

Converts everything into HTML

  • Saturday, June 3, 2017
  • by blackandred
  • Repository
  • 2 Watchers
  • 1 Stars
  • 69 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ContentCompilerBundle

Converts everything to HTML, including conversion from Markdown to HTML., (*1)

In short words it's an interface for conversion to HTML with some example implementations made., (*2)

/*
 * Wolnoƛciowiec / ContentCompilerBundle
 * -------------------------------------
 *
 *   Converts everything to HTML, including conversion from Markdown to HTML.
 *   A part of an anarchist portal - wolnosciowiec.net
 *
 *   Wolnoƛciowiec is a project to integrate the movement
 *   of people who strive to build a society based on
 *   solidarity, freedom, equality with a respect for
 *   individual and cooperation of each other.
 *
 *   We support human rights, animal rights, feminism,
 *   anti-capitalism (taking over the production by workers),
 *   anti-racism, and internationalism. We negate
 *   the political fight and politicians at all.
 *
 *   http://wolnosciowiec.net/
 *
 *   License: LGPLv3
 */
 ```

## Setup

1. Add to `AppKernel`
2. Use as a service :-)

Example:

```php

// twig
var_dump($this->contentCompilerFactory
     ->getContentCompiler('twig')
     ->compileFromString('Monkeys are eating {{ fruitName }}', false, [
         ContentCompilerInterface::VARIABLES => ['fruitName' => 'banana'],
     ])
);

// markdown
var_dump($this->contentCompilerFactory
     ->getContentCompiler('markdown')
     ->compileFromString('# Bananas are everywhere')
);

The Versions