All Projects → kazzkiq → Codeflask

kazzkiq / Codeflask

Licence: mit
A micro code-editor for awesome web pages.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Codeflask

Web Highlighter
✨ A no-runtime dependency lib for text highlighting & persistence on any website ✨🖍️
Stars: ✭ 373 (-55.38%)
Mutual labels:  highlight
Lumin
A JavaScript library to progressively highlight any text on a page.
Stars: ✭ 545 (-34.81%)
Mutual labels:  highlight
Highlight Userguideview
用户指引提示view,新特性高亮指示 HighLight
Stars: ✭ 647 (-22.61%)
Mutual labels:  highlight
Franklin.jl
(yet another) static site generator. Simple, customisable, fast, maths with KaTeX, code evaluation, optional pre-rendering, in Julia.
Stars: ✭ 413 (-50.6%)
Mutual labels:  highlight
Artplayer
🎨 ArtPlayer.js is a modern and full featured HTML5 video player
Stars: ✭ 484 (-42.11%)
Mutual labels:  highlight
Cpeditor
The IDE for competitive programming 🎉 | Fetch, Code, Compile, Run, Check, Submit 🚀
Stars: ✭ 562 (-32.78%)
Mutual labels:  code-editor
Haskell Do
✏️ 📊 - The Haskell code editor focused on interactive development.
Stars: ✭ 349 (-58.25%)
Mutual labels:  code-editor
Rsyntaxtextarea
A syntax highlighting, code folding text editor for Java Swing applications.
Stars: ✭ 767 (-8.25%)
Mutual labels:  code-editor
Flutter showcaseview
Flutter plugin that allows you to showcase your features on iOS and Android. 👌🔝🎉
Stars: ✭ 502 (-39.95%)
Mutual labels:  highlight
Kov Blog
A blog platform built with koa,vue and mongoose. 使用 koa ,vue 和 mongo 搭建的博客页面和支持markdown语法的博客编写平台,自动保存草稿。博客地址:https://chuckliu.me
Stars: ✭ 635 (-24.04%)
Mutual labels:  highlight
Hrjs
🔄 Tiny JavaScript plugin for highlighting and replacing text in the DOM
Stars: ✭ 420 (-49.76%)
Mutual labels:  highlight
Blog React
react + Ant Design + 支持 markdown 的博客前台展示
Stars: ✭ 463 (-44.62%)
Mutual labels:  highlight
Traces.vim
Range, pattern and substitute preview for Vim
Stars: ✭ 568 (-32.06%)
Mutual labels:  highlight
Dsync
IDAPython plugin that synchronizes disassembler and decompiler views
Stars: ✭ 399 (-52.27%)
Mutual labels:  highlight
Rxmarkdown
📠Markdown for Android, supports TextView && EditText (Live Preview), supports code high light.
Stars: ✭ 714 (-14.59%)
Mutual labels:  highlight
Script Lab
Create, run and share your code directly from Office
Stars: ✭ 358 (-57.18%)
Mutual labels:  code-editor
Refined Bitbucket
Chrome and Firefox extension that improves Bitbucket's user experience
Stars: ✭ 560 (-33.01%)
Mutual labels:  highlight
Codejar
An embeddable code editor for the browser 🍯
Stars: ✭ 774 (-7.42%)
Mutual labels:  code-editor
Learn Vim
Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for.
Stars: ✭ 7,221 (+763.76%)
Mutual labels:  code-editor
Vue Blog
A single-user blog built with vue2, koa2 and mongodb which supports Server-Side Rendering
Stars: ✭ 586 (-29.9%)
Mutual labels:  highlight

npm version Build Status


CodeFlask: A micro code-editor for awesome web pages.

Installation

You can install CodeFlask via npm:

npm install codeflask

Or use it directly in browser via cdn service:

https://unpkg.com/codeflask/build/codeflask.min.js

Usage

import CodeFlask from 'codeflask';

const flask = new CodeFlask('#my-selector', { language: 'js' });

You can also pass a DOM element instead of a selector:

import CodeFlask from 'codeflask';

const editorElem = document.getElementById('editor');
const flask = new CodeFlask(editorElem, { language: 'js' });

Usage with Shadow DOM:

import CodeFlask from 'codeflask';
...
const shadowElem = this.shadowRoot.querySelector('#editor');
const flask = new CodeFlask(shadowElem, { language: 'js', styleParent: this.shadowRoot });

Listening for changes in editor

flask.onUpdate((code) => {
  // do something with code here.
  // this will trigger whenever the code
  // in the editor changes.
});

Updating the editor programatically

// This will also trigger .onUpdate()
flask.updateCode('const my_new_code_here = "Blabla"');

Getting the current code from editor

const code = flask.getCode();

Enabling line numbers

import CodeFlask from 'codeflask';

const flask = new CodeFlask('#my-selector', {
  language: 'js',
  lineNumbers: true
});

Enabling rtl (right to left writing)

import CodeFlask from 'codeflask';

const flask = new CodeFlask('#my-selector', {
  language: 'js',
  rtl: true
});

Enabling read only mode

import CodeFlask from 'codeflask';

const flask = new CodeFlask('#my-selector', {
  language: 'js',
  readonly: true
});

Adding other languages support:

flask.addLanguage('ruby', options)

For Example to add 'Ruby'

import Prism from 'prismjs';
import CodeFlask from 'codeflask';

const flask = new CodeFlask('#my-selector', {
  language: 'ruby',
  readonly: true
});

flask.addLanguage('ruby', Prism.languages['ruby']);

This API is simply a proxy to add a new language to Prism itself (the code highlighter). The options parameter must be the same accepted in Prism. You can read more about it here.

By default, CodeFlask supports the following languages (which are also the default supported in Prism):

  • Markup (HTML/XML);
  • CSS;
  • C-like;
  • JavaScript;

Adding your own theme to CodeFlask

By default, CodeFlask comes with a simple theme made from scratch called CodeNoon.

You can easily override this theme with your own by writting your own CSS and adding it to your project. If that's the case, you should also disable CodeNoon with the defaultTheme option:

import CodeFlask from 'codeflask';

const flask = new CodeFlask('#my-selector', {
  language: 'js',
  defaultTheme: false
});

Credits & Thanks

CodeFlask.js was made possible by awesome open-source projects such as Prism.js and Rollup.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].