diff --git a/.github/workflows/convert-to-heta.yml b/.github/workflows/convert-to-heta.yml
index da7db30a0..2b7284338 100644
--- a/.github/workflows/convert-to-heta.yml
+++ b/.github/workflows/convert-to-heta.yml
@@ -37,7 +37,9 @@ jobs:
- name: Create collection of heta files
run: |
- bash ./bash/make-heta.sh
+ mkdir -p result/heta
+ rm -rf result/heta/*
+ BASE_DIR=./result/heta node ./js/convert-to-heta.js
- name: copy static
run: |
diff --git a/.gitignore b/.gitignore
index 17347fe61..797ecb10a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,4 +9,5 @@
/result
-/draft
\ No newline at end of file
+/draft
+/node_modules
diff --git a/bash/make-heta.sh b/bash/make-heta.sh
deleted file mode 100644
index 6e514cb0d..000000000
--- a/bash/make-heta.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-base_dir="result/heta"
-
-echo Create of file structure
-mkdir -p $base_dir
-rm -rf $base_dir/*
diff --git a/js/convert-to-heta.js b/js/convert-to-heta.js
new file mode 100644
index 000000000..6a0b387b6
--- /dev/null
+++ b/js/convert-to-heta.js
@@ -0,0 +1,35 @@
+const BASE_DIR = process.env.BASE_DIR || './';
+const path = require('path');
+const fse = require('fs-extra');
+const summaryPath = path.resolve(BASE_DIR, '../sbml/summary');
+const summary = require(summaryPath);
+
+
+let html = ''
+html += '
'
+summary.cases.forEach((item) => {
+ if (!item.l3v2RetCode) {
+ var hetaPath = path.resolve(BASE_DIR, '../sbml', item.id, 'l3v2/heta-code/output.heta');
+ } else if (!item.l2v5RetCode) {
+ hetaPath = path.resolve(BASE_DIR, '../sbml', item.id, 'l2v5/heta-code/output.heta');
+ } else {
+ return; // skip if no heta files
+ }
+
+ // copy heta files
+ let heta = fse.readFileSync(hetaPath, 'utf8');
+
+ // input description as comment
+ let synop = fse.readFileSync(path.resolve(BASE_DIR, '../sbml', item.id, 'synopsis.txt'), 'utf8');
+
+ // write heta file
+ let fullContent = `/*${synop}*/\n\n${heta}`;
+ fse.writeFileSync(path.resolve(BASE_DIR, item.id, 'output.heta'), fullContent);
+
+ // update html page
+ html += `- ${item.id}
`;
+});
+
+html += '
';
+
+fse.writeFileSync(path.resolve(BASE_DIR, 'index.html'), html);
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 000000000..797716ff9
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,80 @@
+{
+ "name": "sbml-heta-cases",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "dependencies": {
+ "fs-extra": "^11.2.0"
+ }
+ },
+ "node_modules/fs-extra": {
+ "version": "11.2.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz",
+ "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=14.14"
+ }
+ },
+ "node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
+ "node_modules/jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ }
+ },
+ "dependencies": {
+ "fs-extra": {
+ "version": "11.2.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz",
+ "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==",
+ "requires": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ }
+ },
+ "graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
+ "jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "requires": {
+ "graceful-fs": "^4.1.6",
+ "universalify": "^2.0.0"
+ }
+ },
+ "universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 000000000..ff38c12e2
--- /dev/null
+++ b/package.json
@@ -0,0 +1,5 @@
+{
+ "dependencies": {
+ "fs-extra": "^11.2.0"
+ }
+}