GithubHelp home page GithubHelp logo

yusei-0 / ngx-codejar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from julianpoemp/ngx-codejar

0.0 0.0 0.0 5.5 MB

Angular wrapper for CodeJar. With this you can easily add code editors to your Angular app.

Home Page: https://julianpoemp.github.io/ngx-codejar/

License: MIT License

JavaScript 21.24% TypeScript 78.76%

ngx-codejar's Introduction

ngx-codejar npm

This is an Angular wrapper for the code-editor CodeJar by Anton Medvedev. It allows to easily use CodeJar in Angular projects.

thumbnail

Demo

Visit the demo page: https://julianpoemp.github.io/ngx-codejar/

About CodeJar

CodeJar is an embeddable javascript code-editor that supports different highlighter like Highlight.js or PrimsJs. According to the main project it has the following features:

  • Preserves indentation on a new line
  • Adds closing brackets, quotes
  • Indents line with the Tab key
  • Supports undo/redo

Overview

Installation

How to use CodeJar with Angular and highlight.js

If you want to use CodeJar with highlight.js you should do the following steps:

  1. Install highlight.js, CodeJar and ngx-codejar:
npm install --save codejar highlight.js ngx-codejar && npm install --save-dev @types/highlight.js
  1. Import module NgxCodejarModule to your app's ngModule:
@NgModule({
  declarations: [
    // ...
  ],
  imports: [
    // ...,
    NgxCodejarModule
  ],
  // ...
})
  1. Select themes from node_modules/highlight.js/styles and add them to the styles section of your angular.json.

  2. Now see https://julianpoemp.github.io/ngx-codejar/ on how to use it.

How to use CodeJar with Angular and Prism.js

If you want to use codejar with prism.js you should do the following steps:

  1. Install prism.js, codejar and ngx-codejar:
npm install --save codejar prismjs ngx-codejar && npm install --save-dev @types/prismjs
  1. Import module NgxCodejarModule to your app's ngModule:
@NgModule({
  declarations: [
    // ...
  ],
  imports: [
    // ...,
    NgxCodejarModule
  ],
  // ...
})
  1. Select themes from node_modules/prismjs/themes and add them to the styles section of your angular.json.

  2. Now see https://julianpoemp.github.io/ngx-codejar/ on how to use it.

Properties & Events

Type Name Description Default
Property highlighter selects which highlighter should be used ('prism' or 'hljs') 'hljs'
Property showLineNumbers adds line numbers false
Property code property for two-way data-binding. -
Property highlightMethod set a method for code highlight (editor: CodeJarContainer) => {}
Event update this event is triggered after the code was updated. -

Development

Call npm start to start the demo locally. Build the library using ng build ngx-codejar.

Contribution

Feel free to create pull requests or issues with suggestions! :)

Troubleshooting

This package is just a wrapper for CodeJar. If you have any problems using it please make sure, that the problem is related to this wrapper.

ngx-codejar's People

Contributors

julianpoemp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.