Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Commit

Permalink
Fix assets issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojciech Możejko committed Sep 2, 2016
1 parent 0fc13f0 commit 5ca957d
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 73 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
index.html

# Logs
logs
*.log
Expand Down
12 changes: 0 additions & 12 deletions assets/scripts.js

This file was deleted.

27 changes: 0 additions & 27 deletions assets/styles.css

This file was deleted.

6 changes: 2 additions & 4 deletions components/app.tag
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<app>

<div class="three wide column menu-column">
<div class="ui fluid vertical inverted menu" riot-tag="menu"></div>
</div>
Expand All @@ -9,8 +8,7 @@
</div>

<script>
this.api = this.parent.api
this.app = this.parent.app
this.schemas = this.parent.schemas
this.api = opts.api
this.app = opts.app
</script>
</app>
66 changes: 66 additions & 0 deletions index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<html>
<head>
<meta charset="utf-8">
<title>{{ title }}</title>

<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-jsonview/1.2.3/jquery.jsonview.min.css" rel="stylesheet">

<style>
body>.ui.grid>.row {
padding-bottom: 0;
}
h1.ui.dividing.header {
margin-top: 20px;
}
resource-method>.ui.row {
padding-top: 15px;
}
.menu-column {
background: #1B1C1D;
}
.third-column {
background: #f9f9f9;
}
.ui.menu {
border-radius: 0;
}
.jsonview {
font-size: 0.9em;
}
</style>
</head>

<body>
<div class="ui grid" riot-tag="app">
{{{ app }}}
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.2/semantic.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-jsonview/1.2.3/jquery.jsonview.min.js"></script>

<script>
$(function() {
$('.js-tab .item').tab()
$('.js-json').each(function(node) {
try {
var json = $(this).text()
$(this).JSONView(json).JSONView('collapse', 1)
} catch(e) {
console.error(e)
}
})
})
</script>
</body>
</html>
27 changes: 0 additions & 27 deletions index.tag

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raml1-doc",
"version": "1.0.2",
"version": "1.0.3",
"description": "Generate HTML documentation using RAML",
"main": "index.js",
"scripts": {
Expand All @@ -13,6 +13,7 @@
"commander": "^2.9.0",
"deasync": "^0.1.7",
"glob": "^7.0.5",
"handlebars": "^4.0.5",
"inverse": "^1.0.0",
"json-schema-ref-parser": "^3.1.2",
"lodash": "^4.15.0",
Expand Down
14 changes: 12 additions & 2 deletions src/raml1-doc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
var glob = require('glob')
var fs = require('fs')
var path = require('path')
var ramlParser = require('raml-1-parser')
var riot = require('riot')
var Inverse = require('inverse')
var handlebars = require('handlebars')

module.exports = (ramlFilePath) => {
let app = new Inverse()
Expand Down Expand Up @@ -41,7 +43,15 @@ module.exports = (ramlFilePath) => {
require(tag)
})

let index = require('../index.tag')
let appComponent = require('../components/app.tag')
let appHtml = riot.render(appComponent, { 'api': api, 'app': app })
appHtml = appHtml.replace('<app>', '').replace('</app>')

return riot.render(index, { 'api': api, 'app': app })
let indexTemplatePath = path.join(__dirname, '../index.hbs')
let indexTemplate = fs.readFileSync(indexTemplatePath, { encoding: 'utf8' })

return handlebars.compile(indexTemplate)({
title: api.title(),
app: appHtml
})
}
53 changes: 53 additions & 0 deletions tests/intern.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Learn more about configuring this file at <https://theintern.github.io/intern/#configuration>.
// These default settings work OK for most people. The options that *must* be changed below are the packages, suites,
// excludeInstrumentation, and (if you want functional tests) functionalSuites
define({
// Default desired capabilities for all environments. Individual capabilities can be overridden by any of the
// specified browser environments in the `environments` array below as well. See
// <https://theintern.github.io/intern/#option-capabilities> for links to the different capabilities options for
// different services.
//
// Note that the `build` capability will be filled in with the current commit ID or build tag from the CI
// environment automatically
capabilities: {
'browserstack.selenium_version': '2.45.0'
},

// Browsers to run integration testing against. Options that will be permutated are browserName, version, platform,
// and platformVersion; any other capabilities options specified for an environment will be copied as-is. Note that
// browser and platform names, and version number formats, may differ between cloud testing systems.
environments: [
{ browserName: 'internet explorer', version: '11', platform: 'WIN8' },
{ browserName: 'internet explorer', version: '10', platform: 'WIN8' },
{ browserName: 'internet explorer', version: '9', platform: 'WINDOWS' },
{ browserName: 'firefox', version: '37', platform: [ 'WINDOWS', 'MAC' ] },
{ browserName: 'chrome', version: '39', platform: [ 'WINDOWS', 'MAC' ] },
{ browserName: 'safari', version: '8', platform: 'MAC' }
],

// Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service
maxConcurrency: 2,

// Name of the tunnel class to use for WebDriver tests.
// See <https://theintern.github.io/intern/#option-tunnel> for built-in options
tunnel: 'BrowserStackTunnel',

// Configuration options for the module loader; any AMD configuration options supported by the AMD loader in use
// can be used here.
// If you want to use a different loader than the default loader, see
// <https://theintern.github.io/intern/#option-useLoader> for more information.
loaderOptions: {
// Packages that should be registered with the loader in each testing environment
packages: [ { name: 'myPackage', location: '.' } ]
},

// Unit test suite(s) to run in each browser
suites: [ /* 'myPackage/tests/foo', 'myPackage/tests/bar' */ ],

// Functional test suite(s) to execute against each browser once unit tests are completed
functionalSuites: [ /* 'myPackage/tests/functional' */ ],

// A regular expression matching URLs to files that should not be included in code coverage analysis. Set to `true`
// to completely disable code coverage.
excludeInstrumentation: /^(?:tests|node_modules)\//
});

0 comments on commit 5ca957d

Please sign in to comment.