2017 © Pedro Peláez
 

library themer

A markdown based documentation

image

php-pure/themer

A markdown based documentation

  • Tuesday, September 27, 2016
  • by daison12006013
  • Repository
  • 1 Watchers
  • 1 Stars
  • 879 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHP Pure's Themer

A template, the converts markdown .md files into well static html page, depending on the theme you will use., (*1)

Index

The Factory

We have a factory that handles combines all the processes and calls the themes you need., (*2)

$map

Just a map for our markdowns., (*3)

$map = [
    'Prologue' => [
        'Setup' => __DIR__.'/docs/prologue/setup.md',
        'Change Log' => __DIR__.'/docs/prologue/change_log.md',
    ],
];

$view_variables

You can freely pass a variable in the factory. Please take a note that this variables will be over-written/added a new variable when you will be using a different theme., (*4)

$view_variables = [
    'uri' => 'http://example.com',
    'title' => 'My Documentation',
    // and so on ...
];

Finally to call the factory, Please take a note that the below code is still incomplete, that we still need to review how the theme works., (*5)

<?php

$map = [...];
$view_variables = [...];

$factory = new PhpPure\Themer\Factory($map, $theme_variables, $view_variables);

Themes

We're using Laravel's Blade Component to handle the views., (*6)

PHP Pure has a theme that we could use for documentation, and that is the basic template that we added in the core., (*7)

$basic = new PhpPure\Themer\Themes\Basic\Basic;
$basic->setViewsDir(__DIR__.'/views');
$basic->setCacheDir(__DIR__.'/views/.cache');

The above code, we instantiated the Basic class, we set the views folder, and also the cache folder., (*8)

The Basic Theme requires us to inject a theme variables in the factory, we must inject the extension and landing_page., (*9)

$theme_variables = [
    'extension' => 'html',
    'landing_page' => $map['Prologue']['Setup'],
];

To finalize the factory, check code below., (*10)

...

$factory->theme($basic);
$factory->generate('public/'); // the folder to generate with

Test

We have a sample tests that your could try out or mimic., (*11)

Writing your own Theme

I can't write everything here, so maybe let's move on to our wiki., (*12)

The Versions

27/09 2016

dev-master

9999999-dev

A markdown based documentation

  Sources   Download

MIT

The Requires

 

by Daison Carino