[SOLVED] GambasOne Highlighting: missing underscores

Feel free to talk about non programming issues here.
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by BruceSteers »

actually i think i found it :)

i was loading the files in my gambas made editor and it wasn't showing really long lines.
the theme.css looked blank to me untill i loaded it into pluma lol


try this Charlie... overwrite the orig theme.css file with the one in this zip..

changes based on Steve's post
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by BruceSteers »

it's a horrible css file.
it's one line
7457 chars long :-\
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by BruceSteers »

I also wonder if just changing the font may help?
when i look at an underscore in a highlighted post it seems very low in relation to the rest of the text.
another font may be different?

EDIT:

scrub that, i see you have already spoken of it and firefox does it's own font so shut me up :) lol
If at first you don't succeed , try doing something differently.
BruceS
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by cogier »

Thanks, Bruce. I will upload when time allows, and we will see what happens. I'll let you know, but I am going to be busy for obvious reasons. Going to the pub now...
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by stevedee »

cogier wrote: Friday 24th December 2021 4:47pm ...Going to the pub now...
What a fine idea.

I'm not sure what your problem is with the Theme.css file. Sounds like you cannot locate it, but there was a copy in the zip...maybe you can't find where to put it?
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by stevedee »

Maybe I need to write a better explanation of the problem...but we are just about to sit down to a splendid supper, so maybe not today...or tomorrow!
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by stevedee »

BruceSteers wrote: Friday 24th December 2021 3:45pm ...try this Charlie... overwrite the orig theme.css file with the one in this zip..

changes based on Steve's post
OK, I see your problem. This file has been minified.

I can give you a copy that is not minified, which makes it easy to read (like my earlier post) but you will presumably need to minify before overwriting the existing one.

...or, let me check if Bruce has the edit in the write place.

EDIT.....
...OK just tested Bruce's Theme.css and it looks like the edit is good!

Merry Christmas everyone...see you on the other side!!!
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: GambasOne Highlighting: missing underscores

Post by stevedee »

OK, I have a bit of time so I thought I'd just try to clarify the situation as I see it.

All we need to do is make a small change to the formatting to create space around the display of code, specifically the display of Gambas code which includes the colouring of keywords. There is no problem with the JavaScript code (syntaxhighlighter.js) which has already been modified by Jornmo to include all Gambas keywords, datatypes & so on.

The Cascading Style Sheets file (theme.css) supplements the web page HTML by providing information/instructions on how to display certain aspects of the page. For example; font size, control size, background colours & so on.

The json file is not relevant to any of this, as it just includes information about the JavaScript code, who owns the license, those involved in modifying it & so on.

Therefore, to create more space below the last line of any highlighted Gambas code, the easy way is by modifying the .css file to increase control "padding". In fact we could either increase the padding value (which increases the padding on all 4 sides) or just increase padding-bottom (which only increases the space below the last line).

My simple 3 line change to theme.css shown in post #7 works!
In a subsequent post I will describe how you can test this yourselves using your web browser's Developer Tools.

However, I don't know how your website handles changes. Do you simply replace existing files via FTP on your server, or do you have to use some kind of 'build tools' where you submit files which have to be compiled in some way?

As mentioned earlier, the original CSS & JavaScript code has been Minified for optimization. That is to say that although the layout of the original theme.css file would have looked similar to that shown in post #7, once minified, most of the spaces, line-feeds and all comments are removed making it almost unreadable. This is done so that web pages load faster and are more responsive. (I was able to capture a more readable copy of theme.css because the browser's Developer Tools can un-minify the code to some extent, e.g. its more readable, but any comments are lost).

As an analogy, minified Gambas code might look like this, on a single line:-

PublicSubForm_Open()DimstrSearchTermsAsStringDimindexAsIntegerstrSearchFilePath=Application.Path&FILE_POP_SEARCHIfNotExist(strSearchFilePath)ThenExec["touch",strSearchFilePath]EndifIfExist(strSearchFilePath)ThenstrSearchTerms=File.Load(strSearchFilePath)

...and so on.

The fact that the theme.css and the syntaxhighlighter.js files have been minified, almost certainly indicates that you use some kind of tools to process your original web files, maybe as part of a "Publish" or "Optimise" operation. If so, I would have thought that you have a copy of the original files (un-minified) which you can modify prior to publishing updates. ...Charlie, this is the first issue you need to address before you can move forward with this problem.

Does this make things any clearer? If not, just ask for more.
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by BruceSteers »

I think it's ready Steve, we just need for Charlie to get a little time.

once i loaded the theme.css file into pluma i realised it had been scrunched up.

i found the correct place to insert the code as per your edits, and inserted the code.
pretty sure it is just a folder on the forum server that Charlie can just upload the new file.

cheers Steve,

i think we should up the padding on all the highlights just to make things clearer :)

Happy Chrimbo all :)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: GambasOne Highlighting: missing underscores

Post by BruceSteers »

stevedee wrote: Saturday 25th December 2021 12:11am OK, I have a bit of time so I thought I'd just try to clarify the situation as I see it.

The json file is not relevant to any of this, as it just includes information about the JavaScript code, who owns the license, those involved in modifying it & so on.
yeah i could see that by looking at it. My problem was the theme.css file looked blank so i figured the style settings must have been elsewhere on the server.
stevedee wrote: Saturday 25th December 2021 12:11am My simple 3 line change to theme.css shown in post #7 works!
In a subsequent post I will describe how you can test this yourselves using your web browser's Developer Tools.
That could be useful.
I'm wondering if we applied the padding line to the previous syntaxhighlighter {} line or the next syntaxhighlighter container {} line instead would it aplly to all highlight modes?

stevedee wrote: Saturday 25th December 2021 12:11am
As mentioned earlier, the original CSS & JavaScript code has been Minified for optimization.

Does this make things any clearer? If not, just ask for more.
Thanks Steve, yes it's clear, when i first loaded the files my first thought was less minified more mortified ;)

i managed to find the correct place to insert your code still :)

Well done dude :)
If at first you don't succeed , try doing something differently.
BruceS
Post Reply