highlightjs-energyplus
v0.3.0
Published
A highlight.js language grammar for EnergyPlus IDF
Maintainers
Readme
highlightjs-energyplus - a language grammar for highlight.js
EnergyPlus is a whole building energy simulation program that engineers, architects, and researchers use to model both energy consumption and water use in buildings.
See energyplus.net.
Usage
Simply include the Highlight.js library in your webpage or Node app, then load this module.
Three grammars are provided:
- energyplus: for IDF files (would work for OpenStudio OSM mostly)
- energyplus-err: for eplusout.err files
- energyplus-idd: for IDD (Input Data Dictionary) files
Static website
Simply load the module after loading Highlight.js. You'll use the minified version found in the dist directory. This module is just a CDN build of the language, so it will register itself as the Javascript is loaded.
<script type="text/javascript" src="/path/to/highlight.min.js"></script>
<script type="text/javascript" src="/path/to/energyplus.min.js"></script>
<script type="text/javascript" src="/path/to/energyplus-err.min.js"></script>
<script type="text/javascript" src="/path/to/energyplus-idd.min.js"></script>
<script type="text/javascript">
hljs.highlightAll();
</script>Using directly from a CDN
UNPKG
<script type="text/javascript"
src="https://unpkg.com/[email protected]/dist/energyplus.min.js"></script>
<script type="text/javascript"
src="https://unpkg.com/[email protected]/dist/energyplus-err.min.js"></script>
<script type="text/javascript"
src="https://unpkg.com/[email protected]/dist/energyplus-idd.min.js"></script>JS Delivr
<script type="text/javascript"
src="https://cdn.jsdelivr.net/gh/jmarrec/[email protected]/dist/energyplus.min.js"></script>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/gh/jmarrec/[email protected]/dist/energyplus-err.min.js"></script>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/gh/jmarrec/[email protected]/dist/energyplus-idd.min.js"></script>As a Browser ES6 Module
Note: for browser ES6 module usage, use the @highlightjs/cdn-assets package for highlight.js itself (see highlight.js docs).
Here I'm importing only the core package and registering only energyplus language, so we minimize the size of the dependencies.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/atom-one-light.min.css">
<script type="module">
import hljs from 'https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/es/core.min.js';
// Register the energyplus language grammar
import energyplus from 'https://cdn.jsdelivr.net/gh/jmarrec/[email protected]/dist/energyplus.es.min.js';
import energyplusErr from 'https://cdn.jsdelivr.net/gh/jmarrec/[email protected]/dist/energyplus-err.es.min.js';
import energyplusIdd from 'https://cdn.jsdelivr.net/gh/jmarrec/[email protected]/dist/energyplus-idd.es.min.js';
hljs.registerLanguage('energyplus', energyplus);
hljs.registerLanguage('energyplus-err', energyplusErr);
hljs.registerLanguage('energyplus-idd', energyplusIdd);
hljs.highlightAll();
</script>With Node or another build system
If you're using Node / Webpack / Rollup / Browserify, etc, simply require the language module, then register it with Highlight.js.
var hljs = require('highlight.js/lib/core');
var energyplus = require('highlightjs-energyplus');
var energyplusErr = require('highlightjs-energyplus/src/languages/energyplus-err');
var energyplusIdd = require('highlightjs-energyplus/src/languages/energyplus-idd');
hljs.registerLanguage("energyplus", energyplus);
hljs.registerLanguage("energyplus-err", energyplusErr);
hljs.registerLanguage("energyplus-idd", energyplusIdd);
hljs.highlightAll();Or with ES modules:
import hljs from 'highlight.js/lib/core';
import energyplus from 'highlightjs-energyplus';
import energyplusErr from 'highlightjs-energyplus/src/languages/energyplus-err';
import energyplusIdd from 'highlightjs-energyplus/src/languages/energyplus-idd';
hljs.registerLanguage("energyplus", energyplus);
hljs.registerLanguage("energyplus-err", energyplusErr);
hljs.registerLanguage("energyplus-idd", energyplusIdd);
hljs.highlightAll();License
Highlight.js for energyplus is released under the MIT License. See LICENSE file for details.
Highlight.js is released under the BSD 3-Clause License.
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
See CONTRIBUTING.md for development setup, commands, and architecture details.
Links
- The official site for the Highlight.js library is https://highlightjs.org/.
- The Highlight.js GitHub project: https://github.com/highlightjs/highlight.js
- Learn more about energyplus: https://energyplus.net
This is free software (MIT License) contributed by EffiBEM.

Leveraging software, EffiBEM specializes in providing new ways to streamline your workflows and create new tools that work with limited inputs for your specific applications. We also offer support and training services on BEM simulation engines (OpenStudio and EnergyPlus).
