Thread: Notepad++ color codes
-
April 13th, 2018, 15:03 #1
- Join Date
- Dec 2017
- Location
- Bethany, Missouri
- Posts
- 224
Notepad++ color codes
Hello everyone. I am just getting started with my exciting journey with XML using Notepad++ (64 bit) V.7.5.6
I noticed that as I'm looking at different mods in the program there are different colors for different things (for lack of better terms). For example...most everything is predominately blue. Some are red and others are purple. There is also green in places. An example is <Name type="string'> Some Black Text </name> Name is in blue, Type is red and string is purple. Would someone be side kind as to educate me on why these are colored as such? I am assuming the "string" example is some form of a command name recognized in XML. I've a long way to go before I can effectively code XML but I am a fast learner.
-
April 13th, 2018, 15:16 #2
Hello Sailor (I've always wanted to say that )
Notepad colour-codes different parts of a program file (XML & LUA in our case) to help distinguise one part or type from another. At lot of advanced text/code editing apps do this, and while it looks strange at first you quickly become used to it and it help speed up your coding because you quickly get to see when the syntax of your code is right or wrong.
does that help?Dulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
-
April 13th, 2018, 15:20 #3
Once you save the file as XML file the various colors will appear in the file. They are indicating, as you assumed, a specific XML syntax. The color can be used to help identify if you have a missing closing tag, missing " or / in the code. Best way to understand it is create some sample entries within the FG ruleset of your choice and export it. Once you export it, open it up and see how the XML is laid out.
This page will become your friend, (or hated enemy :P): https://www.fantasygrounds.com/wiki/...ecial:AllPagesUltimate License Holder
-
April 13th, 2018, 15:28 #4
Also, changing the "Language" to XML in Notepad++ will change the highlighting appropriately.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
April 13th, 2018, 16:24 #5
- Join Date
- Dec 2017
- Location
- Bethany, Missouri
- Posts
- 224
Thanks for the informative replies. I really appreciste it. I admit that with the blank xml sheet I began writing on wasn't saved (its still open on my pc at home). I had opened my exported module I am working on with notepad and though I see similar entries, it doesn't seem to be in the same order as the 5E asset module I am comparing to. There are no "list" entries that I can see and the data for evrrything else seems very... Scattered and disorganized. I definitely want to follow a consistent format.
-
April 13th, 2018, 16:48 #6
The difference in the formatting you see in an exported module, an unpacked module/ruleset, and the code snippets you see in screenshots are all due to the way FG is set up to export data. FG exports alpha-numerically, in that when you open a module you could or will see <combat>, <encounters>,<image>, <library>, <lists>, <reference> as the second level tags under the <root> tag. If its in an unpacked ruleset or module, especially an older one, things can get really messy as data maybe in a similar order, or not depending on the original creator.
In Notepad++, use the line numbers, indentation and the tree on the left hand side to collapse different tag levels to help you get an idea of how they interact. It aids greatly in keeping data organized.
I try to keep my the same from module to module (doesn't always happen) and I tend to go in this order: <library>, <image>, <lists>, <reference>, then <combat> or <encounters> as neededUltimate License Holder
-
April 13th, 2018, 18:07 #7
- Join Date
- Dec 2017
- Location
- Bethany, Missouri
- Posts
- 224
Reporting back. Everything is working beautifully. I have a physical book I am trying my new found magic on by making a private module based on this small book. Notepad is picking up the language as fast as I type it, everything is neat and sensable columns and that color coding sure does make it a lot easier to spot errors. Haveing a lot of fun.
-
April 13th, 2018, 18:47 #8
That's how it begins. Now its an addiction.
A couple tips to remember...
1. Save often.
2. Take a look at the particular ruleset you are using and its wiki. Some of the rulesets have particular syntax for certain data that may differ.
3. Take breaks.....keep the fun it
4. Save often.!! <<<< Very important to remember
5. Ask questions!!Ultimate License Holder
-
April 14th, 2018, 03:38 #9
Dulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
-
April 14th, 2018, 03:56 #10
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks