From 6234d61da0a89bf0003e59d6f38556254324501c Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Fri, 13 May 2016 00:02:41 +0200 Subject: [PATCH] Fix indentation of markdown template --- src/resources/views/documentarian.blade.php | 85 ++++++++++----------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/src/resources/views/documentarian.blade.php b/src/resources/views/documentarian.blade.php index f522d0f7..af78011a 100644 --- a/src/resources/views/documentarian.blade.php +++ b/src/resources/views/documentarian.blade.php @@ -2,8 +2,8 @@ title: API Reference language_tabs: -- javascript - bash +- javascript includes: @@ -19,67 +19,66 @@ # Available routes @foreach($parsedRoutes as $parsedRoute) - @if($parsedRoute['title'] != '')## {{ $parsedRoute['title']}} - @else## {{$parsedRoute['uri']}} - @endif - @if($parsedRoute['description']) +@if($parsedRoute['title'] != '')## {{ $parsedRoute['title']}} +@else## {{$parsedRoute['uri']}} +@endif +@if($parsedRoute['description']) - {{$parsedRoute['description']}} - @endif +{{$parsedRoute['description']}} +@endif - > Example request: +> Example request: - ```bash - curl "{{config('app.url')}}/{{$parsedRoute['uri']}}" \ - -H "Accept: application/json"@if(count($parsedRoute['parameters'])) \ - @foreach($parsedRoute['parameters'] as $attribute => $parameter) - -d "{{$attribute}}"="{{$parameter['value']}}" \ - @endforeach - @endif +```bash +curl "{{config('app.url')}}/{{$parsedRoute['uri']}}" \ +-H "Accept: application/json"@if(count($parsedRoute['parameters'])) \ +@foreach($parsedRoute['parameters'] as $attribute => $parameter) + -d "{{$attribute}}"="{{$parameter['value']}}" \ +@endforeach +@endif - ``` +``` - ```javascript - var settings = { +```javascript +var settings = { "async": true, "crossDomain": true, "url": "{{config('app.url')}}/{{$parsedRoute['uri']}}", "method": "{{$parsedRoute['methods'][0]}}", @if(count($parsedRoute['parameters'])) - "data": {!! str_replace(' ',' ',json_encode(array_combine(array_keys($parsedRoute['parameters']), array_map(function($param){ return $param['value']; },$parsedRoute['parameters'])), JSON_PRETTY_PRINT)) !!}, +"data": {!! str_replace(' ',' ',json_encode(array_combine(array_keys($parsedRoute['parameters']), array_map(function($param){ return $param['value']; },$parsedRoute['parameters'])), JSON_PRETTY_PRINT)) !!}, @endif "headers": { "accept": "application/json" } - } +} - $.ajax(settings).done(function (response) { - console.log(response); - }); - ``` - - @if(in_array('GET',$parsedRoute['methods'])) - > Example response: +$.ajax(settings).done(function (response) { +console.log(response); +}); +``` - ```json - {!! $parsedRoute['response'] !!} - ``` - @endif +@if(in_array('GET',$parsedRoute['methods'])) + > Example response: - ### HTTP Request - @foreach($parsedRoute['methods'] as $method) - `{{$method}} {{$parsedRoute['uri']}}` + ```json + {!! $parsedRoute['response'] !!} + ``` +@endif - @endforeach - @if(count($parsedRoute['parameters'])) +### HTTP Request +@foreach($parsedRoute['methods'] as $method) +`{{$method}} {{$parsedRoute['uri']}}` - #### Parameters +@endforeach +@if(count($parsedRoute['parameters'])) +#### Parameters - Parameter | Type | Status | Description - --------- | ------- | ------- | ------- | ----------- - @foreach($parsedRoute['parameters'] as $attribute => $parameter) - {{$attribute}} | {{$parameter['type']}} | @if($parameter['required']) required @else optional @endif | {!! implode(' ',$parameter['description']) !!} - @endforeach - @endif +Parameter | Type | Status | Description +--------- | ------- | ------- | ------- | ----------- +@foreach($parsedRoute['parameters'] as $attribute => $parameter) + {{$attribute}} | {{$parameter['type']}} | @if($parameter['required']) required @else optional @endif | {!! implode(' ',$parameter['description']) !!} +@endforeach +@endif @endforeach