All user data for FoundryVTT. Includes worlds, systems, modules, and any asset in the "foundryuserdata" directory. Does NOT include the FoundryVTT installation itself.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
3.3 KiB

1 year ago
  1. # Ace Library
  2. ![Version](https://img.shields.io/github/v/tag/arcanistzed/acelib) ![Latest Release Download Count](https://img.shields.io/github/downloads/arcanistzed/acelib/latest/module.zip?label=Downloads&style=flat-square&color=9b43a8) ![Supported Foundry Versions](https://img.shields.io/endpoint?url=https://foundryshields.com/version?url=https://raw.githubusercontent.com/arcanistzed/acelib/main/module.json&style=flat-square&color=ff6400) [![Discord Server](https://img.shields.io/badge/-Discord-%232c2f33?style=flat-square&logo=discord)](https://discord.gg/AAkZWWqVav) [![Patreon](https://img.shields.io/badge/-Patreon-%23141518?style=flat-square&logo=patreon)](https://www.patreon.com/bePatron?u=15896855)
  3. A library module for using the [Ace editor](https://ace.c9.io/) in Foundry VTT.
  4. This library is currently being used by
  5. - [Journal Code Editor](https://foundryvtt.com/packages/jce)
  6. - [Export Sheet to PDF](https://foundryvtt.com/packages/pdf-sheet)
  7. - [Macro Editor](https://foundryvtt.com/packages/macroeditor)
  8. - [Not Enough NPCs: A 5e NPC Generator](https://foundryvtt.com/packages/npcgen)
  9. - [Stream Utils](https://foundryvtt.com/packages/0streamutils)
  10. - [DF Flag Editor](https://foundryvtt.com/packages/df-flag-edit)
  11. Let me know and I will add your module to the list.
  12. ## Installation
  13. In the setup screen, use the URL `https://github.com/arcanistzed/acelib/releases/latest/download/module.json` to install the module.
  14. ## Usage
  15. 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.
  16. ```js
  17. let editor = ace.edit("the-id-of-the-div");
  18. ```
  19. This will set the Ace options to the ones that the user has configured in module settings.
  20. ```js
  21. editor.setOptions(ace.userSettings);
  22. ```
  23. Set the editor's contents
  24. ```js
  25. editor.setValue("initial value");
  26. ```
  27. Get the editor's contents
  28. ```js
  29. editor.getValue();
  30. ```
  31. Instructions for customizing each editor individually are available on [the official guide](https://ace.c9.io/#nav=howto) 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.
  32. ### Using Ace
  33. 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.
  34. ## Support
  35. Please consider supporting me on [my Patreon](https://patreon.com/arcanistzed) if you like my work. You can see a list of all my projects on [my website](https://arcanist.me).
  36. ## Bugs
  37. You can submit bugs via [Github Issues](https://github.com/arcanistzed/acelib/issues/new/choose) or on [my Discord server](https://discord.gg/AAkZWWqVav).
  38. ## Contact me
  39. Come hang out on my [my Discord server](https://discord.gg/AAkZWWqVav) or [click here to send me an email](mailto:arcanistzed@gmail.com?subject=Ace%20Library%20module).
  40. ## License
  41. Copyright © 2021 arcanist
  42. This package is under an [MIT license](LICENSE) and the [Foundry Virtual Tabletop Limited License Agreement for module development](https://foundryvtt.com/article/license/) while Ace Editor is under a [BSD license](https://github.com/ajaxorg/ace/blob/master/LICENSE).