Skip to content

Commit

Permalink
Add flag USE_REQUIRE for jArchi 1.6.1 and greater
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillipus committed Aug 9, 2024
1 parent 00a6dda commit eef3089
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Generate Single-page HTML Export.ajs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,20 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

// Set this to false for jArchi 1.6.0 and below or if the Archi preference "Enable Common JS support" is off
// See https://github.com/archimatetool/archi-scripting-plugin/wiki/Using-Node.js-modules
const USE_REQUIRE = true;

load(__DIR__ + 'libs/nashorn-polyfills.js');
load(__DIR__ + 'libs/underscore-min.js');
load(__DIR__ + 'libs/marked.min.js');

if(USE_REQUIRE) {
_ = require(__DIR__ + "libs/underscore-min.js");
marked = require(__DIR__ + "libs/marked.min.js");
}
else {
load(__DIR__ + 'libs/underscore-min.js');
load(__DIR__ + 'libs/marked.min.js');
}

console.show();
console.clear();
Expand Down

0 comments on commit eef3089

Please sign in to comment.