GithubHelp home page GithubHelp logo

arcanistzed / acelib Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 2.0 5.09 MB

A library module for using the Ace code editor in Foundry VTT.

Home Page: https://arcanist.me

License: MIT License

JavaScript 99.87% Shell 0.13%
foundry-vtt ace-editor

acelib's Introduction

Ace Library

Version Latest Release Download Count Supported Foundry Versions Discord Server Patreon

A library module for using the Ace editor in Foundry VTT.

This library is currently being used by

Let me know and I will add your module to the list.

Installation

In the setup screen, use the URL https://github.com/arcanistzed/acelib/releases/latest/download/module.json to install the module.

Usage

To easily add an Ace editor, you can create a <div> and use ace.edit to initialize. You can create multiple editors at once with this method.

let editor = ace.edit("the-id-of-the-div");

This will set the Ace options to the ones that the user has configured in module settings.

editor.setOptions(ace.userSettings);

Set the editor's contents

editor.setValue("initial value");

Get the editor's contents

editor.getValue();

Instructions for customizing each editor individually are available on the official guide which has examples of how to set various options. This is useful when you need an editor to work a certain way (e.g. force the use of JSON), but should be used sparingly since it robs the user of their choice. These will override the user's choices. Different editors can use different options even if they are open simultaneously.

Using Ace

Press Ctrl+Alt+h or Cmd+Alt+h to view a list of all the keyboard shortcuts available. You can access the command palette by pressing F1 while focusing on the editor.

Support

Please consider supporting me on my Patreon if you like my work. You can see a list of all my projects on my website.

Bugs

You can submit bugs via Github Issues or on my Discord server.

Contact me

Come hang out on my my Discord server or click here to send me an email.

License

Copyright © 2021 arcanist

This package is under an MIT license and the Foundry Virtual Tabletop Limited License Agreement for module development while Ace Editor is under a BSD license.

acelib's People

Contributors

arcanistzed avatar

Stargazers

 avatar  avatar  avatar  avatar Apostol Apostolov avatar

Watchers

Apostol Apostolov avatar

acelib's Issues

[Bug]: Javascript mode doesn't work

Expected Behavior

Javascript code should be properly highlighted

Current Behavior

Behaves as plaintext

Steps to Reproduce

  1. Open Settings
  2. Navigate to mode
  3. Set it to javascript
  4. Save settings
  5. Open any editor
  6. Observe effects

Context

image

Version

1.8.3

Foundry VTT Version

11.315

Operating System

Windows 11

Browser / App

Native Electron App

Game System

wfrp4e (dev branch effect-refactor)

Modules Disabled

  • I can confirm that disabling all of my other modules doesn't fix this issue.

Feature Request: Settings option for using Tab character instead of spaces

I won't get into the age old debate on if tabs or spaces are better, but I personally prefer tabs and am constantly annoyed that the web dev world seems to have baked in "spaces" as being expected, while the rest of the programming world accepts either or. The Ace Editor appears to be no different and sets the default to spaces and I don't see a setting in the acelib module to change that yet. Could you add a way to toggle the use of the Tab character instead of spaces in the Ace Lib configuration?

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.