https://github.com/julianpoemp/codejar-linenumbers
Small repository that enables linenumbers on CodeJar code editor with >= v4.
https://github.com/julianpoemp/codejar-linenumbers
code-editor codejar plugin
Last synced: 9 months ago
JSON representation
Small repository that enables linenumbers on CodeJar code editor with >= v4.
- Host: GitHub
- URL: https://github.com/julianpoemp/codejar-linenumbers
- Owner: julianpoemp
- License: mit
- Created: 2023-07-29T06:21:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-19T22:08:48.000Z (over 1 year ago)
- Last Synced: 2025-04-21T11:08:06.401Z (9 months ago)
- Topics: code-editor, codejar, plugin
- Language: TypeScript
- Homepage: https://codepen.io/julianpoemp/full/jOjgQzG
- Size: 313 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# codejar-linenumbers
Third party package that enables line numbers on [CodeJar](https://github.com/antonmedv/codejar) code editor for version >= 4. It's already used by [ngx-codejar](https://github.com/julianpoemp/ngx-codejar) - an Angular wrapper for Codejar.
## Demo
https://codepen.io/julianpoemp/full/jOjgQzG
## Background
CodeJar 4 dropped the line numbers feature. This package returns it.
## Installation
### Via NPM
1. Make sure you have CodeJar >= 4.0.0 installed.
2. Install codejar-linenumbers
````
npm install --save codejar-linenumbers
````
3. If you don't want to use ESM you can import this library using the IFFEE build:
````HTML
````
4. If you want to use this library with ESM or Typescript, don't forget to load the `codejar-linenumbers.css` file into your app.
### Via CDN
#### IFFEE (no module)
````HTML
````
#### ESM
````HTML
````
## Use
### Typescript
````Typescript
import {CodeJar} from 'codejar';
import {withLineNumbers} from "codejar-linenumbers";
const jar = CodeJar(editor, withLineNumbers(highlight), {tab: '\t'});
````
### Javascript
### ESM
For static HTML see example here: https://codepen.io/julianpoemp/pen/jOjgQzG .
### Vanilla JS
Make sure that the `codejar-linenumbers/js/codejar-linenumbers.min.js` file was loaded.
````Javascript
var jar = CodeJar(editor, CodeJar.withLineNumbers(highlight), {tab: '\t'});
````
## Issues
Please make sure that the issue is related to linenumbers only. For issues related to CodeJar please create issues [here](https://github.com/antonmedv/codejar/issues).