Skip to content

Commit 78034f9

Browse files
author
Daniel LaBarge
committed
Initial commit.
0 parents  commit 78034f9

36 files changed

+2121
-0
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/node_modules
2+
/vendor
3+
/public/css
4+
/public/js
5+
/public/fonts
6+
/public/mix-manifest.json
7+
.DS_Store
8+
.idea
9+
composer.lock
10+
package-lock.json

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 Artisans Collaborative.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Blueprint Docs
2+
3+
A render for API Blueprints compatible with Laravel.

blueprint.apib

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FORMAT: 1A
2+
HOST: https://api.tasks.test
3+
4+
# Advanced Action API
5+
A resource action is – in fact – a state transition. This API example
6+
demonstrates an action - state transition - to another resource.
7+
8+
9+
# Tasks [/tasks/tasks{?status,priority}]
10+
11+
+ Parameters
12+
+ status (string)
13+
+ priority (number)
14+
15+
## List All Tasks [GET]
16+
17+
+ Response 200 (application/json)
18+
19+
[
20+
{
21+
"id": 123,
22+
"name": "Exercise in gym",
23+
"done": false,
24+
"type": "task"
25+
},
26+
{
27+
"id": 124,
28+
"name": "Shop for groceries",
29+
"done": true,
30+
"type": "task"
31+
}
32+
]
33+
34+
## Retrieve Task [GET /task/{id}]
35+
This is a state transition to another resource.
36+
37+
+ Parameters
38+
+ id (string)
39+
40+
+ Response 200 (application/json)
41+
42+
{
43+
"id": 123,
44+
"name": "Go to gym",
45+
"done": false,
46+
"type": "task"
47+
}
48+
49+
## Delete Task [DELETE /task/{id}]
50+
51+
+ Parameters
52+
+ id (string)
53+
54+
+ Response 204

composer.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "artisansdk/blueprint",
3+
"description": "A render for API Blueprints compatible with Laravel.",
4+
"keywords": [
5+
"api",
6+
"blueprint",
7+
"renderer",
8+
"laravel",
9+
"docs"
10+
],
11+
"license": "MIT",
12+
"homepage": "https://github.com/artisansdk/blueprint",
13+
"require": {
14+
"php": ">=7.0",
15+
"illuminate/config": "^5.4|^6.0",
16+
"illuminate/support": "^5.4|^6.0",
17+
"illuminate/routing": "^5.4|^6.0",
18+
"illuminate/view": "^5.4|^6.0",
19+
"hmaus/drafter-installer": "^1.0.1",
20+
"hmaus/drafter-php": "^5.0",
21+
"hmaus/reynaldo": "dev-Parameter-Number-bug",
22+
"erusev/parsedown": "^1.7.0",
23+
"erusev/parsedown-extra": "^0.7.1"
24+
},
25+
"autoload": {
26+
"psr-4": {
27+
"ArtisanSdk\\Blueprint\\": "src/"
28+
}
29+
},
30+
"extra": {
31+
"laravel": {
32+
"providers": [
33+
"ArtisanSdk\\Blueprint\\Provider"
34+
]
35+
},
36+
"drafter-installer-tag": "v3.2.7"
37+
},
38+
"repositories": [
39+
{
40+
"type": "vcs",
41+
"url": "https://github.com/drakakisgeo/reynaldo"
42+
}
43+
],
44+
"scripts": {
45+
"install-drafter": "Hmaus\\Drafter\\Installer::installDrafter"
46+
}
47+
}

config/blueprint.php

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Route to Docs
8+
|--------------------------------------------------------------------------
9+
|
10+
| Find your rendered docs at the given path or set to false if you
11+
| want to use your own route and controller.
12+
|
13+
*/
14+
15+
'action' => '\ArtisanSdk\Blueprint\Http\Controller@index'
16+
'path' => 'docs',
17+
'route' => 'api.docs',
18+
19+
/*
20+
|--------------------------------------------------------------------------
21+
| Condensed Navigation
22+
|--------------------------------------------------------------------------
23+
|
24+
| Find your rendered docs at the given route or set route to false if you
25+
| want to use your own route and controller. Provide a fully qualified
26+
| path to your API blueprint as well as to the required Drafter CLI.
27+
|
28+
*/
29+
30+
'condensed' => false,
31+
32+
/*
33+
|--------------------------------------------------------------------------
34+
| Blueprint Files
35+
|--------------------------------------------------------------------------
36+
|
37+
| Provide a fully qualified path to the API Blueprint or an array manifest
38+
| of fully qualified paths to API Blueprint partials in the order they
39+
| should be combined to generate the full API Blueprint.
40+
|
41+
*/
42+
43+
'manifest' => [
44+
base_path('blueprint.apib'),
45+
],
46+
47+
/*
48+
|--------------------------------------------------------------------------
49+
| Drafter Binary
50+
|--------------------------------------------------------------------------
51+
|
52+
| Provide a fully qualified path to the required Drafter binary.
53+
|
54+
*/
55+
56+
'drafter' => base_path('vendor/bin/drafter'),
57+
58+
];

package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"dev": "npm run development",
5+
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6+
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
7+
"watch-poll": "npm run watch -- --watch-poll",
8+
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9+
"prod": "npm run production",
10+
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11+
},
12+
"devDependencies": {
13+
"bootstrap-sass": "^3.4.1",
14+
"cross-env": "^5.2.0",
15+
"css-element-queries": "^1.1.1",
16+
"highlight.js": "^9.15.6",
17+
"jquery": "^3.4.0",
18+
"laravel-mix": "^4.0.14",
19+
"resolve-url-loader": "2.3.1",
20+
"sass": "^1.17.2",
21+
"sass-loader": "7.*",
22+
"sticky-sidebar": "^3.3.1",
23+
"vue-template-compiler": "^2.6.7"
24+
}
25+
}

resources/assets/js/app.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
3+
* for JavaScript based Bootstrap features such as modals and tabs. This
4+
* code may be modified to fit the specific needs of your application.
5+
*/
6+
7+
try {
8+
window.$ = window.jQuery = require('jquery');
9+
10+
require('bootstrap-sass');
11+
} catch (e) {}

resources/assets/js/blueprint.js

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
window.ResizeSensor = require('css-element-queries/src/ResizeSensor');
2+
require('sticky-sidebar/dist/sticky-sidebar.js');
3+
4+
var hljs = require('highlight.js/lib/highlight');
5+
hljs.registerLanguage('http', require('highlight.js/lib/languages/http'));
6+
hljs.registerLanguage('json', require('highlight.js/lib/languages/json'));
7+
8+
$(document).ready(function () {
9+
var sidebar = new StickySidebar('.sidebar', {
10+
topSpacing: 22,
11+
bottomSpacing: 0,
12+
containerSelector: '.content-wrapper',
13+
innerWrapperSelector: '.sidebar__inner',
14+
resizeSensor: true
15+
});
16+
17+
$(window).resize(function() {
18+
sidebar.updateSticky();
19+
});
20+
21+
$('[id^=collapse-]').on('show.bs.collapse', function () {
22+
var id = $(this).prev().find('a').data('group-id'),
23+
scrollTop = $(document.getElementById(id)).offset().top - 33;
24+
25+
$('html, body').animate({scrollTop: scrollTop});
26+
});
27+
28+
$('[id^=collapse-]').on('hide.bs.collapse', function (e) {
29+
var id = $(this).prev().find('a').data('group-id'),
30+
scrollTop = $(document.getElementById(id)).offset().top - 33;
31+
32+
$('html, body').animate({scrollTop: scrollTop});
33+
34+
if ($(window).scrollTop() < scrollTop - 1 || $(window).scrollTop() > scrollTop + 1) {
35+
e.preventDefault();
36+
}
37+
});
38+
39+
$('.tabs').on('click', 'a', function (e) {
40+
var id = $(this).attr('href').substring(1),
41+
scrollTop = $(document.getElementById(id)).offset().top - 33;
42+
43+
$('html, body').animate({scrollTop: scrollTop});
44+
45+
e.preventDefault();
46+
});
47+
48+
$('.nav-pills').on('click', '.active a', function (e) {
49+
var that = $(this);
50+
51+
e.preventDefault();
52+
53+
window.setTimeout(function () {
54+
that.closest('.nav-pills').next('.tab-content').find('.tab-pane').removeClass('active');
55+
that.parent('li').removeClass('active');
56+
}, 0);
57+
});
58+
59+
$('pre code').each(function (i, block) {
60+
hljs.highlightBlock(block);
61+
});
62+
});

resources/assets/sass/_highlight.scss

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
2+
3+
/* Tomorrow Comment */
4+
.hljs-comment,
5+
.hljs-quote {
6+
color: #8e908c;
7+
}
8+
9+
/* Tomorrow Red */
10+
.hljs-variable,
11+
.hljs-attr,
12+
.hljs-attribute,
13+
.hljs-template-variable,
14+
.hljs-tag,
15+
.hljs-name,
16+
.hljs-selector-id,
17+
.hljs-selector-class,
18+
.hljs-regexp,
19+
.hljs-deletion {
20+
color: #c82829;
21+
}
22+
23+
/* Tomorrow Orange */
24+
.hljs-number,
25+
.hljs-built_in,
26+
.hljs-builtin-name,
27+
.hljs-literal,
28+
.hljs-type,
29+
.hljs-params,
30+
.hljs-meta,
31+
.hljs-link {
32+
color: #f5871f;
33+
}
34+
35+
/* Tomorrow Yellow */
36+
//.hljs-attribute {
37+
// color: #eab700;
38+
//}
39+
40+
/* Tomorrow Green */
41+
.hljs-string,
42+
.hljs-symbol,
43+
.hljs-bullet,
44+
.hljs-addition {
45+
color: #718c00;
46+
}
47+
48+
/* Tomorrow Blue */
49+
.hljs-title,
50+
.hljs-section {
51+
color: #4271ae;
52+
}
53+
54+
/* Tomorrow Purple */
55+
.hljs-keyword,
56+
.hljs-selector-tag {
57+
color: #8959a8;
58+
}
59+
60+
.hljs {
61+
display: block;
62+
overflow-x: auto;
63+
background: transparent;
64+
color: #4d4d4c;
65+
padding: 0.5em;
66+
}
67+
68+
.hljs-emphasis {
69+
font-style: italic;
70+
}
71+
72+
.hljs-strong {
73+
font-weight: bold;
74+
}

0 commit comments

Comments
 (0)