dev-master
9999999-devA markdown based documentation
MIT
The Requires
by Daison Carino
A markdown based documentation
A template, the converts markdown .md
files into well static html page, depending on the theme you will use., (*1)
We have a factory that handles combines all the processes and calls the themes you need., (*2)
Just a map for our markdowns., (*3)
$map = [ 'Prologue' => [ 'Setup' => __DIR__.'/docs/prologue/setup.md', 'Change Log' => __DIR__.'/docs/prologue/change_log.md', ], ];
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);
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
We have a sample tests that your could try out or mimic., (*11)
I can't write everything here, so maybe let's move on to our wiki., (*12)
A markdown based documentation
MIT