All Projects → lukejacksonn → Monacode

lukejacksonn / Monacode

Licence: mit
An es-module wrapper around the monaco editor and prettier

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Monacode

Vuerd
ERD Editor
Stars: ✭ 208 (+51.82%)
Mutual labels:  vscode, editor
Vscoq
A Visual Studio Code extension for Coq [[email protected],@fakusb]
Stars: ✭ 138 (+0.73%)
Mutual labels:  vscode, editor
Vscodium
binary releases of VS Code without MS branding/telemetry/licensing
Stars: ✭ 14,639 (+10585.4%)
Mutual labels:  vscode, editor
Cn Vscode Docs
VScode说明文档翻译
Stars: ✭ 970 (+608.03%)
Mutual labels:  vscode, editor
Monaco Editor
A browser based code editor
Stars: ✭ 27,382 (+19886.86%)
Mutual labels:  vscode, editor
Vscode Vuehelper
🐵vscode插件,vue,vue-router和vuex的代码提示
Stars: ✭ 351 (+156.2%)
Mutual labels:  vscode, editor
Vscode Chrome Debug
Debug your JavaScript code running in Google Chrome from VS Code.
Stars: ✭ 2,126 (+1451.82%)
Mutual labels:  vscode, editor
Vue Monaco
MonacoEditor component for Vue.js
Stars: ✭ 471 (+243.8%)
Mutual labels:  vscode, editor
Monaco React
Monaco Editor for React - use the monaco-editor in any React application without needing to use webpack (or rollup/parcel/etc) configuration files / plugins
Stars: ✭ 788 (+475.18%)
Mutual labels:  vscode, editor
Vuerd Vscode
ERD Editor vscode extension
Stars: ✭ 95 (-30.66%)
Mutual labels:  vscode, editor
Tagger
Zero Dependency, Vanilla JavaScript Tag Editor
Stars: ✭ 135 (-1.46%)
Mutual labels:  editor
Vscode Emacs Mcx
Awesome Emacs Keymap - VSCode emacs keybinding with multi cursor support
Stars: ✭ 135 (-1.46%)
Mutual labels:  vscode
Ngx Quill Example
demo app for the advanced usage of ngx-quill module
Stars: ✭ 137 (+0%)
Mutual labels:  editor
Vscode Mjml
This repo is archived. MJML preview, lint, compile for Visual Studio Code.
Stars: ✭ 138 (+0.73%)
Mutual labels:  vscode
Notepanda
📃 A simple cross-platform notepad. Based on Qt and C++.
Stars: ✭ 134 (-2.19%)
Mutual labels:  editor
Laravel Dotenv Editor
The .env file editor tool for Laravel 5.8+
Stars: ✭ 137 (+0%)
Mutual labels:  editor
Vscode Browse Lite
🚀 An embedded browser in VS Code
Stars: ✭ 134 (-2.19%)
Mutual labels:  vscode
Cadeditor
NES Universal Level Editor (Chip & Dale, Darkwing Duck, Duck Tales, Duck Tales 2, MegaMan 4, Chip & Dale 2, Tale Spin, Little Mermaid, Jungle Book, Flintstones and many others)
Stars: ✭ 134 (-2.19%)
Mutual labels:  editor
Hrcloud2
A full-featured home hosted Cloud Drive, Personal Assistant, App Launcher, File Converter, Streamer, Share Tool & More!
Stars: ✭ 134 (-2.19%)
Mutual labels:  editor
Openlayers Editor
OpenLayers Editor
Stars: ✭ 138 (+0.73%)
Mutual labels:  editor

Monacode

A thin es-module wrapper around the monaco editor and prettier

Exploring the feasibility of importing the monaco-editor (which powers VS Code) and prettier modules directly into the browser; aiming to make it one line easy to bring a native like code editing experiences to web applications without a build step.

Ships with all the features usually found in VS Code out of the box: things like code hints, type inference, minimap, command pallet, multi-cursor select, find and replace, code folding etc.

In addition to these features, prettier has been integrated so that hitting ⌘ + s will format the code.

monacode-demo

⚡️ Check out the hosted version at https://monacode.live

Usage

Install the module as an npm module and import it using the bare module specifier, or import it directly from unpkg:

import monacode from 'https://unpkg.com/monacode/index.min.js'; // 976Kb brotli

// Create a new editor and attach to the document body
const editor = monacode({
  container: document.body,
  value: 'const add = (x, y) => x + y;',
});

// Listen for changes within the editor
editor.getModel().onDidChangeContent((change) => {
  const newValue = editor.getValue();
  console.log(newValue);
});

It is also possible to embed the editor into your application using an iframe (see demo):

<iframe
  src="https://monacode.live?theme=vs-light&value=console.log('hey')"
></iframe>

Pass config options into the iframe as URL search parameters, making sure to URI encode values properly. Please note however, it is not currently possible to pass in nested config options.

API

The module exports a single default function which accepts a config object as an argument. The supplied config gets merged with a default config which itself is a subset of the options available to configure moanco editors. Some useful values to know include:

  • container: an HTML element that exists in the DOM (or a ref if using react/preact)
  • value: a string representing the initial code to be rendered within the editor
  • language: a string representing what language the editor should try syntax highlight and hint for
  • fontSize: a number indicating what pixel font size code should render at
  • theme: a string identifier of the desired theme or a url to a theme json file

Calling the default export returns an instance of the underlying monaco editor. Find out more about how to interact with the editor by reading the API documentation.

Development

Running the following command from the root of this project uses servor to start a dev server, then open your editor and browser on the appropriate localhost url.

npm start

Production

Running the following command from the root of this project uses esbuild build the source to a single index.min.js file. Currently this process takes ~1second and results in an output file weighing 4.6MB (commpresses down to less than 1MB with brotli).

npm run build

License

Licensed under the MIT License.

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].