adding doc routes.
This commit is contained in:
1732
bundles/docs/libraries/markdown.php
Executable file
1732
bundles/docs/libraries/markdown.php
Executable file
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/libraries/markdown.php';
|
||||
|
||||
View::composer('docs::template', function($view)
|
||||
{
|
||||
Asset::add('stylesheet', 'css/style.css');
|
||||
Asset::add('modernizr', 'js/modernizr-2.5.3.min.js');
|
||||
Asset::container('footer')->add('prettify', 'js/prettify.js');
|
||||
$view->with('sidebar', Markdown(file_get_contents(path('storage').'documentation/contents.md')));
|
||||
});
|
||||
|
||||
|
||||
Route::get('(:bundle)', function()
|
||||
{
|
||||
return View::make('docs::home');
|
||||
});
|
||||
|
||||
Route::get('docs/(:any)/(:any?)', function($section, $page = null)
|
||||
{
|
||||
$page = rtrim(implode('/', array($section, $page)), '/').'.md';
|
||||
|
||||
$content = Markdown(file_get_contents(path('storage').'documentation/'.$page));
|
||||
|
||||
return View::make('docs::page')->with('content', $content);
|
||||
});
|
||||
5
bundles/docs/views/page.blade.php
Normal file
5
bundles/docs/views/page.blade.php
Normal file
@@ -0,0 +1,5 @@
|
||||
@layout('docs::template')
|
||||
|
||||
@section('content')
|
||||
{{ $content }}
|
||||
@endsection
|
||||
@@ -22,7 +22,7 @@
|
||||
</header>
|
||||
<div role="main" class="main">
|
||||
<aside class="sidebar">
|
||||
@include('docs::menu')
|
||||
{{ $sidebar }}
|
||||
</aside>
|
||||
<div class="content">
|
||||
@yield('content')
|
||||
|
||||
Reference in New Issue
Block a user