-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Evgeny Metelkin
committed
Jan 23, 2024
1 parent
e4eedde
commit 0c19a83
Showing
8 changed files
with
141 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,3 +100,6 @@ graph #export { | |
format: Dot, | ||
filepath: graph | ||
}; | ||
summary0 #export { | ||
format: Summary | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* global compiledTemplates */ | ||
const { AbstractExport } = require('../abstract-export'); | ||
const { ajv } = require('../utils'); | ||
require('./namespace'); | ||
|
||
const schema = { | ||
type: 'object', | ||
properties: { | ||
} | ||
}; | ||
|
||
class SummaryExport extends AbstractExport { | ||
constructor(q = {}, isCore = false) { | ||
super(q, isCore); | ||
|
||
// check arguments here | ||
let logger = this._container.logger; | ||
let valid = SummaryExport.isValid(q, logger); | ||
if (!valid) { this.errored = true; return; } | ||
} | ||
get className(){ | ||
return 'SummaryExport'; | ||
} | ||
get format(){ | ||
return 'Summary'; | ||
} | ||
get defaultFilepath() { | ||
return 'summary'; | ||
} | ||
makeText() { | ||
let logger = this._container.logger; | ||
let selectedNamespaces = this.selectedNamespaces(); | ||
|
||
let image = { | ||
unitDefStorage: this._container.unitDefStorage, | ||
functionDefStorage: this._container.functionDefStorage, | ||
selectedNamespaces: selectedNamespaces, | ||
namespaceStorage: this._container.namespaceStorage | ||
}; | ||
let content = this.getDotCode(image); | ||
|
||
return [{ | ||
content: content, | ||
pathSuffix: '/platform.md', | ||
type: 'text' | ||
}]; | ||
} | ||
getDotCode(image = {}) { | ||
return compiledTemplates['summary.md.njk'].render(image); | ||
} | ||
static get validate() { | ||
return ajv.compile(schema); | ||
} | ||
} | ||
|
||
module.exports = SummaryExport; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Summary for platform | ||
|
||
## #defineFunction elements | ||
|
||
Total count: {{ functionDefStorage | length }} | ||
|
||
### Core | ||
|
||
{% for key, value in functionDefStorage | filter2('1.isCore', true) %}{{ value.id }}, {% endfor %} | ||
|
||
### User-defined | ||
|
||
{% set userFunctionDef = functionDefStorage | exclude2('1.isCore', true) %} | ||
{{- '-' if not userFunctionDef.length }} | ||
{%- for key, value in userFunctionDef %}{{ value.id }}, {% endfor %} | ||
|
||
## #defineUnit elements | ||
|
||
Total count: {{ unitDefStorage | length }} | ||
|
||
### Core | ||
|
||
{% for key, value in unitDefStorage | filter2('1.isCore', true) %}{{ value.id }}, {% endfor %} | ||
|
||
### User-defined | ||
|
||
{% set userUnitDef = unitDefStorage | exclude2('1.isCore', true) %} | ||
{{- '-' if not userUnitDef.length }} | ||
{%- for key, value in userUnitDef %}{{ value.id }}, {% endfor %} | ||
|
||
## #setNS elements | ||
|
||
Totalcount: {{ namespaceStorage | length }} | ||
|
||
{% for key, value in namespaceStorage %}{{ key }}, {% endfor %} | ||
|
||
{% for name, ns in selectedNamespaces %} | ||
## "{{ name }}" namespace ({{ 'abstract' if ns.isAbstract else 'concrete' }}) | ||
|
||
Total count: {{ ns.size }} | ||
|
||
## @TimeScale | ||
|
||
{% for key, value in ns | filter2('1.className', 'TimeScale') %}{{ key }}, {% endfor %} | ||
|
||
## @Const | ||
|
||
{% for key, value in ns | filter2('1.className', 'Const') %}{{ key }}, {% endfor %} | ||
|
||
## @Record | ||
|
||
{% for key, value in ns | filter2('1.className', 'Record') %}{{ key }}, {% endfor %} | ||
|
||
## @Process | ||
|
||
{% for key, value in ns | filter2('1.className', 'Process') %}{{ key }}, {% endfor %} | ||
|
||
## @Compartment | ||
|
||
{% for key, value in ns | filter2('1.className', 'Compartment') %}{{ key }}, {% endfor %} | ||
|
||
## @Species | ||
|
||
{% for key, value in ns | filter2('1.className', 'Species') %}{{ key }}, {% endfor %} | ||
|
||
## @Reaction | ||
|
||
{% for key, value in ns | filter2('1.className', 'Reaction') %}{{ key }}, {% endfor %} | ||
|
||
## @TimeSwitcher | ||
|
||
{% for key, value in ns | filter2('1.className', 'TimeSwitcher') %}{{ key }}, {% endfor %} | ||
{# CSwitcher, DSwitcher, StopSwitcher, Dose, Page, #} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters