Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Roll20 Character Sheet git repository - are git hooks allowed?

Hi all, I'm working on a character sheet (Battletech - A Time of War specifically), and something that's annoyed me for a while when developing the sheets is that the JavaScript is embedded in the HTML, which prevents any IDE from giving me assistance when working. So recently, I've pulled all the JavaScript out into its own separate file to use when developing the sheet worker scripts. Now what I'd like to do is write a little script that can take all the JavaScript from the stand alone file, and insert it into the character sheet HTML file. I'd also like to wire this in as a git hook to do it automatically for me every time the JavaScript file is changed. Is this allowed, or would this be a big no no? Also, if anyone else has solved this problem in a different way, I'm happy to hear solutions that don't involve git hooks. :) Git hooks just seems like the only way to automate this, as far as I am aware.
1592390956

Edited 1592391282
Finderski
Pro
Sheet Author
Compendium Curator
I use Atom and Sublime and they both have code highlighting and seem to support JS and HTML in the same file.  Of course, I'm not a real programmer, so maybe there's more you're looking for than just syntax highlighting and auto-complete, but...those two text editors seem to do what I want. I believe someone even made a plugin or theme or something for Sublime that's specific for Roll20 (e.g. the id18n stuff, etc) Edit: The Sublime Text package for Roll20 highlighting was by Andreas; see this forum post for more details.
1592409991
Andreas J.
Forum Champion
Sheet Author
Translator
My assumption would be no, as adding git hooks would edit files in the root folder of the repo, and Roll20 doesn't like that. I suggest you try out the solutions Finderski pointed out, and try the Roll20 highlighting in case you use Sublime Text. Would assume some IDE could have assistance or plugins that enables JS support inside a HTML file.
Damn sorry, I forgot all about this thread. xD I've been using VSCode; I do have Sublime text, but it seems pretty lacking as an IDE. That could just be me not knowing all the shortcuts though. I primarily use IntelliJ, and I'm used to all the crazy things it can do, so maybe I just need to take the time to learn what these other ones can do. That Sublime plugin is good to know about... I might give it a try. Another reason for pulling the JS out to a separate file is I want to be able to write some automated tests around it to give me some confidence that I'm not regressing things when I make changes and/or refactor code. However I haven't got the automated tests working yet, so if that turns out to be too hard, maybe I'll stick it back into the sheet file and try the Sublime plugin. Do you know how I could get an official answer on the question of githooks? Who's even in charge of the character sheets repo? Cassie Levitt? Do any of the responsible people read this forum, do you know?