Third party package that enables line numbers on CodeJar code editor for version >= 4. It's already used by ngx-codejar - an Angular wrapper for Codejar.
https://codepen.io/julianpoemp/full/jOjgQzG
CodeJar 4 dropped the line numbers feature. This package returns it.
npm install --save codejar-linenumbers
<!-- place the CSS file after the HighlightJS/PrismJS stylesheets -->
<link rel="stylesheet" href="https://github.com/julianpoemp/codejar-linenumbers/blob/main/<node_modules_dir>/codejar-linenumbers/js/codejar-linenumbers.css"/>
<script type="application/javascript" src="https://github.com/julianpoemp/codejar-linenumbers/raw/main/<node_modules_dir>/codejar-linenumbers/js/codejar-linenumbers.min.js"></script>
codejar-linenumbers.css
file into your app.
<!-- place the CSS file after the HighlightJS/PrismJS stylesheets -->
<link rel="stylesheet" href="https://unpkg.com/codejar-linenumbers/js/codejar-linenumbers.css"/>
<script type="application/javascript" src="https://unpkg.com/codejar-linenumbers/js/codejar-linenumbers.min.js"></script>
<!-- place the CSS file after the HighlightJS/PrismJS stylesheets -->
<link rel="stylesheet" href="https://unpkg.com/codejar-linenumbers/es/codejar-linenumbers.css"/>
<script type="application/javascript" src="https://unpkg.com/codejar-linenumbers/es/index.js"></script>
import {CodeJar} from 'codejar';
import {withLineNumbers} from "codejar-linenumbers";
const jar = CodeJar(editor, withLineNumbers(highlight), {tab: '\t'});
For static HTML see example here: https://codepen.io/julianpoemp/pen/jOjgQzG .
Make sure that the codejar-linenumbers/js/codejar-linenumbers.min.js
file was loaded.
var jar = CodeJar(editor, CodeJar.withLineNumbers(highlight), {tab: '\t'});
Please make sure that the issue is related to linenumbers only. For issues related to CodeJar please create issues here.