mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-24 23:05:22 +02:00
Add Documentation in Markdown plus express middleware for in-site rendering.
This commit is contained in:
19
res/app/docs/docs-controller.js
Normal file
19
res/app/docs/docs-controller.js
Normal file
@@ -0,0 +1,19 @@
|
||||
module.exports = function DocsCtrl($rootScope, $scope, $window, $location) {
|
||||
|
||||
$scope.goBack = function () {
|
||||
$window.history.back()
|
||||
}
|
||||
|
||||
$scope.goHome = function () {
|
||||
$location.path('/docs/en/index')
|
||||
}
|
||||
|
||||
$rootScope.$on("$routeChangeError",
|
||||
function (event, current, previous, rejection) {
|
||||
console.log("ROUTE CHANGE ERROR: " + rejection)
|
||||
console.log('event', event)
|
||||
console.log('current', current)
|
||||
console.log('previous', previous)
|
||||
|
||||
})
|
||||
}
|
||||
52
res/app/docs/docs.css
Normal file
52
res/app/docs/docs.css
Normal file
@@ -0,0 +1,52 @@
|
||||
.stf-docs h1 {
|
||||
/*background: green;*/
|
||||
}
|
||||
|
||||
.stf-docs .widget-container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.stf-docs h1 {
|
||||
font-size: 32px;
|
||||
color: #157afb;
|
||||
}
|
||||
|
||||
.stf-docs h1 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.stf-docs h2,
|
||||
.stf-docs h3 {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.stf-docs p,
|
||||
.stf-docs li,
|
||||
.stf-docs a {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.stf-docs h1:after,
|
||||
.stf-docs h2:after,
|
||||
.stf-docs h3:after {
|
||||
content: ' ';
|
||||
display: block;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
border: 0;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.stf-docs-navigation {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stf-docs .docs-back {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.stf-docs .docs-home {
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
14
res/app/docs/index.js
Normal file
14
res/app/docs/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
require('./docs.css')
|
||||
|
||||
module.exports = angular.module('stf.help.docs', [])
|
||||
.config(['$routeProvider', function ($routeProvider) {
|
||||
|
||||
$routeProvider.when('/docs/:lang/:document*', {
|
||||
templateUrl: function (params) {
|
||||
var document = params.document.replace('.md', '')
|
||||
return '/static/docs/' + params.lang + '/' + document
|
||||
}
|
||||
})
|
||||
|
||||
}])
|
||||
.controller('DocsCtrl', require('./docs-controller'))
|
||||
Reference in New Issue
Block a user