Skip to content

Commit

Permalink
export array in Builder - draft
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Sep 5, 2024
1 parent 5452360 commit ce558c5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
22 changes: 22 additions & 0 deletions export-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Following [Heta specifications](specifications/) exporting to different formats
- [Julia](#julia)
- [Matlab](#matlab)
- [DOT](#dot)
- [Summary](#summary)

See also [Features support table](#features-support)

Expand Down Expand Up @@ -387,6 +388,27 @@ Each namespace in separate file.
};
```

## Summary

Summarize model content and present statistics of the model components. It also can be used to debug the model.

### Properties

-

### Output files

**[filepath]/summary.md** : File storing model summary.

**Example:**

```heta
#export {
format: Summary,
filepath: summary, // save result in file "dist/summary.md"
};
```

## Features support

*na* means "not applicable"
Expand Down
14 changes: 14 additions & 0 deletions src/builder/declaration-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@
"sheet": { "type": "integer" },
"omitRows": { "type": "integer", "minimum": 0 }
}
},
"export": {
"type": "array",
"items": {
"type": "object",
"required": ["format"],
"additionalProperties": true,
"properties": {
"id": { "type": "string" },
"format": { "type": "string" },
"filepath": { "type": "string" },
"spaceFilter": { "type": "string" }
}
}
}
}
}
1 change: 1 addition & 0 deletions src/builder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Builder {
constructor(declaration, coreDirname = '.'){
// create container
this.container = new Container();
this.export = []; // storing Export objects

// set transport and logger
this.logger = this.container.logger;
Expand Down
2 changes: 1 addition & 1 deletion src/templates/heta-code.heta.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{#-
this.exportArray = [];
this.exportArray = [...];
this.unitDefStorage = [...];
this.namespaceStorage = [...];
-#}
Expand Down
1 change: 0 additions & 1 deletion test/cases/0.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ describe('Testing "cases/0-hello-world"', () => {
//console.log(b);
});

var exportArray = [];
it('Run include', () => {
b.run();
});
Expand Down

0 comments on commit ce558c5

Please sign in to comment.