Skip to content

Commit

Permalink
Update rdoc packages (#165)
Browse files Browse the repository at this point in the history
* cleanup of non ascii TM and updated rdoc generation

* remove <sup> and scenario schema which is now in reporting gem

* remove schema from these docks

* temporary gemfile edit

* update link to rdocs

* update rdoc link

Co-authored-by: Nathan Moore <[email protected]>
  • Loading branch information
kflemin and vtnate authored Oct 19, 2020
1 parent a44e363 commit f6b6daf
Show file tree
Hide file tree
Showing 16 changed files with 412 additions and 525 deletions.
4 changes: 2 additions & 2 deletions RDOC_MAIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

### [back to main docs](../)

The URBANopt Scenario Gem includes functionality for defining scenarios, running simulations, and post-processing results. User defined SimulationMapper classes translate each Feature to a SimulationDir which is a directory containing simulation input files. A ScenarioRunner is used to perform simulations for each SimulationDir. Finally, a ScenarioPostProcessor can run on a Scenario to generate scenario level results.
The URBANopt&trade; Scenario Gem includes functionality for defining scenarios, running simulations, and post-processing results. User defined SimulationMapper classes translate each Feature to a SimulationDir which is a directory containing simulation input files. A ScenarioRunner is used to perform simulations for each SimulationDir. Finally, a ScenarioPostProcessor can run on a Scenario to generate scenario level results.

[RDoc Documentation](https://urbanopt.github.io/urbanopt-scenario-gem/)
[RDoc Documentation](https://urbanopt.github.io/urbanopt-scenario-gem/rdoc)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# URBANopt Scenario Gem

The URBANopt<sup>&trade;</sup> Scenario Gem includes functionality for defining scenarios, running simulations, and post-processing results. User defined SimulationMapper classes translate each Feature to a SimulationDir which is a directory containing simulation input files. The ScenarioRunner is used to perform simulations for each SimulationDir. Finally, a ScenarioPostProcessor can run on a Scenario to generate scenario level results.
The URBANopt&trade; Scenario Gem includes functionality for defining scenarios, running simulations, and post-processing results. User defined SimulationMapper classes translate each Feature to a SimulationDir which is a directory containing simulation input files. The ScenarioRunner is used to perform simulations for each SimulationDir. Finally, a ScenarioPostProcessor can run on a Scenario to generate scenario level results.

[RDoc Documentation](https://urbanopt.github.io/urbanopt-scenario-gem/)

Expand Down
22 changes: 7 additions & 15 deletions docs/.vuepress/components/InnerJsonSchema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import highlightJson from "../highlight";
import { emptyPromise } from '../utils';
const JSONSchemaViewP = emptyPromise();
const $RefParserP = emptyPromise();
export default {
name: "InnerJsonSchema",
Expand All @@ -24,27 +23,24 @@ export default {
};
},
created() {
// created only runs on the client, which is good because
// this module causes an error if we load it in a server context
import("json-schema-view-js").then(JSONSchemaViewP.resolve);
import("json-schema-ref-parser/dist/ref-parser.js").then($RefParserP.resolve);
},
computed: {
view() {
return Promise.all([$RefParserP, JSONSchemaViewP])
.then(([$RefParser]) => $RefParser.default.dereference(this.schema))
.then(
s =>
new window.JSONSchemaView(s, 2, {
theme: "dark"
})
);
return JSONSchemaViewP
.then( () => new window.JSONSchemaView(this.schema, 2, {
theme: "dark"
}));
},
schemaFormatted() {
return highlightJson(JSON.stringify(this.schema, null, 2));
}
},
methods: {
async replaceRenderedSchema() {
const v = await this.view;
const v = await this.view; // this never resolves on the server
this.$refs.schemaTarget.innerHtml = "";
this.$refs.schemaTarget.appendChild(v.render());
}
Expand All @@ -63,7 +59,6 @@ export default {
background-color: #282c34;
padding: 1.25rem 1.5rem;
border-radius: 6px;
width: fit-content
}
.json-formatter-row a {
color: white;
Expand All @@ -78,7 +73,4 @@ export default {
.json-schema-view .object .inner.oneOf b {
color: aqua;
}
.json-schema-view .default {
color: #5f96df
}
</style>
12 changes: 0 additions & 12 deletions docs/.vuepress/components/ScenarioSchema.vue

This file was deleted.

22 changes: 13 additions & 9 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
const path = require('path');

module.exports = {
base: '/urbanopt-scenario-gem/',
themeConfig: {
navbar: false,
sidebar: [
"/",
{
title: "Schemas",
children: [
"/schemas/scenario-schema.md"
]
}
"/"
]
}
};
},
chainWebpack: config => {
config.module
.rule('json')
.test(/\.json$/)
.use(path.join(__dirname, 'json-schema-deref-loader.js'))
.loader(path.join(__dirname, 'json-schema-deref-loader.js'))
.end()
},
};
2 changes: 1 addition & 1 deletion docs/.vuepress/highlight.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import hljs from "highlight.js/lib/highlight.js";
import hljs from "highlight.js";
import json from "highlight.js/lib/languages/json";

hljs.registerLanguage("json", json);
Expand Down
22 changes: 22 additions & 0 deletions docs/.vuepress/json-schema-deref-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// thanks to https://gist.github.com/mgesmundo/07d6ea3958ed4c7d19d1161551fa46ca
const $RefParser = require('@apidevtools/json-schema-ref-parser')

module.exports = async function () {
const parser = new $RefParser()
const schema = await parser.dereference(this.resourcePath, {
dereference: {
circular: false
}
})
const resolve = await parser.resolve(this.resourcePath, {
dereference: {
circular: false
}
})

for (const dep in resolve._$refs) {
this.addDependency(dep)
}

return JSON.stringify(schema)
}
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

### <StaticLink href="rdoc/">Rdocs</StaticLink>

The URBANopt Scenario Gem includes functionality for defining scenarios, running simulations, and post-processing results. User defined SimulationMapper classes translate each Feature to a SimulationDir which is a directory containing simulation input files. A ScenarioRunner is used to perform simulations for each SimulationDir. Finally, a ScenarioPostProcessor can run on a Scenario to generate scenario level results.
The URBANopt&trade; Scenario Gem includes functionality for defining scenarios, running simulations, and post-processing results. User defined SimulationMapper classes translate each Feature to a SimulationDir which is a directory containing simulation input files. A ScenarioRunner is used to perform simulations for each SimulationDir. Finally, a ScenarioPostProcessor can run on a Scenario to generate scenario level results.

[RDoc Documentation](https://urbanopt.github.io/urbanopt-scenario-gem/)
[RDoc Documentation](https://urbanopt.github.io/urbanopt-scenario-gem/rdoc)

## Installation

Expand Down
Loading

0 comments on commit f6b6daf

Please sign in to comment.