Merge branch 'master' into releases

This commit is contained in:
RedocBot 2016-04-08 23:41:49 +00:00 committed by travis@localhost
commit 74ce77fc92
9 changed files with 55 additions and 13 deletions

View File

@ -41,6 +41,11 @@ deploy:
secure: PuhWLERrCEFmXmdFpw2OVFlqpOIVDmgwk5JUJOYaFdVCh/smp0+jZCQ4vrdFpuG96rnDVirD+A8xvW6NgsNNaRthLgOB/LRdFN69rU6Gvn3At6wlnC55t5dlhxPvCfnzJcHVBLXX4EmMkjnZqDg2uczXTzPodr3FnQJNuXmP8B33fzDVLyHccvXZ90abwXWVrgRIXPU28niqCR8DOC2OTzs7wqz+BLNkYDRRbyYXsg62HWuD33x5iof5IqBmhzBt3usCGmF3QGcgHrXHdZw3sZnit8+Bua++3KrXR0x6HGXXN1AoXVmCAkCa5OTQ5R3tCRxiJN3P2KLnvWeZR74sTFkovJB/6pGCvbJ/c7Wnuw6sD7SgOUBD359ULB6lAf5OnxBLoNebX4JxxVXF+zA4E3Bl44VxkzDpPWc15xqBPMB5vBREzMVmJ5mExn2s5cmLQjADbl9h0y6gZnhnNJ+iTmqtrVyM0ZkF2rPrzrTdGD+ULmRIlTMkdD1bh+/TJ3RdXT3P4/zNUJmiNnvgnnJVYYvsGaXWF+7uCVHT/8k2RsoSHqgkqh0gkDqGSwVix55y5mC7T2Vk9lMBhm6MvFJXaonOX0kxJS4EDQ3plPd6/ybG+TLhwggYnQ8o9msU5Nt6FpUShKiezjKurIhbQZdwlVivX3tahjW2QjNDO58xGgY=
on:
tags: true
- skip_cleanup: true
provider: script
script: npm run github-release
on:
tags: true
- skip_cleanup: true
provider: script
script: npm run branch-release

View File

@ -1,4 +1,6 @@
module.exports = {
var path = require('path');
var paths = {
source: 'lib/**/*.js',
html: 'lib/**/*.html',
scss: 'lib/**/*.scss',
@ -8,4 +10,8 @@ module.exports = {
tmp: '.tmp/',
demo: 'demo/**/*',
tests: '{lib,tests}/**/*.spec.js'
};
}
paths.redocBuilt = path.join(paths.output, paths.outputName);
module.exports = paths;

View File

@ -12,8 +12,6 @@ var sass = require('gulp-sass');
var replace = require('gulp-replace');
var rename = require('gulp-rename');
paths.redocBuilt = path.join(paths.output, paths.outputName);
gulp.task('build', function (callback) {
return runSequence(
'clean',
@ -96,7 +94,8 @@ function bundle(outputFile, minify, cb) {
{ format:'umd', sourceMaps: true, mangle: false, lowResSourceMaps: true, minify: minify }
)
.then(function() {
cb();
// wait some time to allow flush
setTimeout(() => cb(), 500);
})
.catch(function(err) {
cb(new Error(err));

View File

@ -0,0 +1,12 @@
var gulp = require('gulp');
var release = require('gulp-github-release');
var path = require('path');
var paths = require('../paths');
gulp.task('github-release', ['build'], function(){
gulp.src(paths.redocBuilt + '.min.js')
.pipe(release({
token: process.env.GH_TOKEN,
manifest: require(path.join(__dirname, '../../package.json'))
}));
});

View File

@ -9,7 +9,7 @@
</div>
</span>
<table *ngIf="!schema.isTrivial" class="params-wrap" [ngClass]="{'params-array': schema._isArray}">
<caption> {{_displayType}} </caption>
<!-- <caption> {{_displayType}} </caption> -->
<template ngFor [ngForOf]="schema.properties" #prop="$implicit" #last="last">
<tr class="param" [ngClass]="{'last': last, 'discriminator': prop.isDiscriminator, 'complex': prop._pointer}">
<td class="param-name">
@ -38,7 +38,8 @@
</tr>
<tr class="param-schema" [ngClass]="{'param-array': prop._isArray, 'last': last}" *ngIf="prop._pointer">
<td colspan="2">
<json-schema pointer="{{prop._pointer}}" [isArray]='prop._isArray' class="nested-schema">
<json-schema pointer="{{prop._pointer}}" [isArray]='prop._isArray'
class="nested-schema" [nestOdd]="!nestOdd" [attr.nesteven]="!nestOdd">
</json-schema>
</td>
</tr>

View File

@ -11,7 +11,7 @@ import JsonPointer from '../../utils/JsonPointer';
templateUrl: './lib/components/JsonSchema/json-schema.html',
styleUrls: ['./lib/components/JsonSchema/json-schema.css'],
directives: [JsonSchema, Tabs, Tab],
inputs: ['isArray', 'final']
inputs: ['isArray', 'final', 'nestOdd']
})
@Reflect.metadata('parameters', [[SchemaManager], [ElementRef]])
export default class JsonSchema extends BaseComponent {
@ -161,7 +161,7 @@ const injectors = {
simpleType: {
check: (propertySchema) => {
if (propertySchema.type === 'object') {
return !propertySchema.properties;
return !propertySchema.properties || !Object.keys(propertySchema.properties).length;
}
return (propertySchema.type !== 'array') && propertySchema.type;
},

View File

@ -20,7 +20,7 @@ $array-marker-line-height: 1.5;
}
json-schema.nested-schema {
background-color: $side-menu-active-bg-color;
background-color: white;
padding: 10px 20px;
position: relative;
border-radius: $border-radius;
@ -35,7 +35,7 @@ json-schema.nested-schema {
border-color: transparent;
border-width: 10px 15px 0;
margin-left: -7.5px;
border-top-color: white;
border-top-color: $side-menu-active-bg-color;
}
&:before {
left: 10%;
@ -46,7 +46,20 @@ json-schema.nested-schema {
}
.param:first-of-type > .param-name:before, .param:last-of-type > .param-name:after {
border-color: #f1f1f1;
border-color: white;
}
}
json-schema[nesteven="true"] {
background-color: $side-menu-active-bg-color;
border-radius: $border-radius;
&:before, &:after {
border-top-color: white;
}
> .params-wrap > .param:first-of-type > .param-name:before, > .params-wrap > .param:last-of-type > .param-name:after {
border-color: $side-menu-active-bg-color;
}
}

View File

@ -31,6 +31,11 @@ import 'hint.css/hint.base.css!css';
import marked from 'marked';
// in gfm mode marked doesn't parse #Heading (without space after #) as heading
// https://github.com/chjj/marked/issues/642
marked.Lexer.rules.gfm.heading = marked.Lexer.rules.normal.heading;
marked.Lexer.rules.tables.heading = marked.Lexer.rules.normal.heading;
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,

View File

@ -1,7 +1,7 @@
{
"name": "redoc",
"description": "Swagger-generated API Reference Documentation",
"version": "0.7.10",
"version": "0.7.11",
"repository": {
"type": "git",
"url": "git://github.com/Rebilly/ReDoc"
@ -64,6 +64,7 @@
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-eslint": "^1.1.1",
"gulp-github-release": "^1.1.2",
"gulp-inline-ng2-template": "^1.1.2",
"gulp-protractor": "^2.1.0",
"gulp-rename": "^1.2.2",