looking for a css - html knowledgeable person (SOLVED)
Posted
#1
(In Topic #1503)
Administrator

I have adapted my private editor to create these template pages and added a toolbar providing the different headings and paragraphs, several boxes, image insertion into a pre defined setting etc.
All is to my liking except for the Gambas code boxes. Below some images on what I do now:
Internal css
result in webview
the inserted code box
internal css
Would it be possible to create some sort of minimalist Gambas code highlight using css mechanisms that I am not knowledgeable about or does it require more, like some fancy insertion into the html using gambas mechanisms?
Above is more a 'would like it different, but it's okay for now' kind of issue, as I a have a lot more on my plate atm that is of higher priority. But, if someone can come up with a doable shortcut to above desire, so to speak. Let me know below…or send a DM…
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Administrator

Already fixed it 8-)
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Guru

did you know gb.highlight and TextHighlighter.class can very quickly convert gambas code (and any other highlight supported mode) into html code?
Like this…
gives all this code…
Code
span style="color:#000000;font-family:monospace;"><span style="color:#3398C3;"><b>For</b></span> c <span style="color:#3398C3;"><b>As</b></span> <span style="color:#E67E22;"><b>Integer</b></span> <b>=</b> <span style="color:#E62222;">0</span> <span style="color:#3398C3;"><b>to</b></span> <span style="color:#E62222;">10</span><br>
<span style="color:#3398C3;"><b>Print</b></span> c<br>
<span style="color:#3398C3;"><b>Next</b></span></span>
looks like this…
The advantage of using gb.highlight is the code will look exactly the same as it looks in the IDE TextEditor.
here as a function that can do other mode types too
Posted
Guru

Code (gambas)
- sHtml = CodeToHTML(sGambasCode)
- sHtml &="<br>"
- sHtml &= CodeToHTML(sShellCode, "sh")
- WebView1.SetHtml(sHtml)
- '' Return html code in a box that looks like gb.highlight highlighted text. supports all highlight modes (default is gambas)
- Return "<table border=1 width=100% cellpadding=5><tr><td align=left><font size=-1>" & Mode & " code...</font></td></tr><tr><td>" & TextHighlighter[Mode].ToHTML(Code) & "</td></tr></table>"
Posted
Administrator

I can work with this. I guess I'll recode my toolbar button for code insertion to opening a form with an editor for typimg the example code. Next have the 'to html' converted code inserted at the proper place. I like it already…
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Guru

Add "Copy highlights" to editor menu (70d50b3b) · Commits · Bruce Steers / gambas · GitLab
I just made it so i have "Copy highlights (as HTML)" in the Edit menu of my IDE.
So now I can select any text in the IDE editor and copy it as it looks in html form.
How to D.I.Y…
From the source code load /app/src/gambas3 into the IDE
Edit FEditor.class/form for gambas files and FTextEditor.class/form for non gambas files
In the forms add the "Copy html" menu using the editor and give it the Action .copyhtml
In the class find the Action_Activate() function.
insert the following code into the Select conditions…
Posted
Administrator

Step 2
Step 1
I love this solution, thanks Bruce for setting me on the right track, so easy and yet such a great result.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Administrator

And I like dark themes, so now the code is back in a black box and code highlighting is exactly as in the code window (gambas with obsidian theme).
preview tab
Code tab
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Guru

You could auto-detect dark theme. (Most things should adapt automatically)
Dim sTheme as String = if(Application.Darktheme, "obsidian", "") ' set obsidian if dark or use default.
Because i personally don't like dark themes and would be likely to change the system theme.
PS. Application.Darktheme is writable. if you manually set it it should stop any auto-adapting and retain the colors you have set.
Ie. If set True it forces the program to be Darktheme even if the desktop is not.
Looks good though, nice work
1 guest and 0 members have just viewed this.













