How to copy text from built in "Help browser"?

Post

Posted
Rating:
#1 (In Topic #1558)
Regular
JumpyVB is in the usergroup ‘Regular’
I need to use Gambas wiki / help without an internet connection. However I am facing a problem with not being able to select and copy text with the Gambas "Help browser". Is there a way to enable such a feature?

I also tried to download the wiki with

Code (gambas)

  1. wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://gambaswiki.org/wiki
but the urls don't work with this method.
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
cogier is in the usergroup ‘GambOS Contributor’
If you go to Preferences [Ctrl]+[Alt]+P, click on help and select 'Use offline documentation'

<IMG src="https://www.cogier.com/gambas/gbhelp_offline.png"> </IMG>
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
JumpyVB is in the usergroup ‘Regular’

cogier said

If you go to Preferences [Ctrl]+[Alt]+P, click on help and select 'Use offline documentation'

Thats what I'm using. But the "Help browser F1" won't let me select text with a mouse for copy pasting. I can only look at text and click links. I'm looking for a way to highlight and copy help texts offline. So far I can only select and copy text if I'm online and use a web browser to access / - Gambas Documentation
Online now: No Back to the top

Post

Posted
Rating:
#4
Banned
You can't.

only way if you need to copy text is to use the online wiki in your browser.
/ - Gambas Documentation

EDIT: or do not use offline mode
Online now: No Back to the top

Post

Posted
Rating:
#5
Regular
JumpyVB is in the usergroup ‘Regular’

BruceSteers said

You can't.
:cry:
Online now: No Back to the top

Post

Posted
Rating:
#6
Regular
JumpyVB is in the usergroup ‘Regular’
I don't want to give up just yeat. So I did some digging through Gambas source code and found "~/Downloads/gambas-stable/app/src/gambas3/.src/Help/HelpBrowser.class". It seems like Gambas Help browser is using WebView to display text. And by default the WebView control does support highlighting and copying highlighted text as seen on the screenshot below which I took as proof of concept. Now I need to find the correct spot to tweak Gambas source code and recompile to enable this feature for the built-in Help browser.

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#7
Banned
If it was possible it would already be done.
We have asked Benoit for the same in the past.
He says he cannot do it.

It seems Cogier had the correct answer, only to be more precise you must "click" offline documentation so it is de-selected,
If you look at the source more closely you will find it uses HtmlView not WebView if using "offline help"
Only if you use online help will it use HelpBrowser.class that inherits WebView, then copying text is possible.

Code (gambas)

  1.  
  2.     If bOffline Then
  3.       $hView = New HtmlView($hPanel) As "HtmlView"
  4.       $hView.LoadCss(File.Load("help/wiki/style-offline-htmlview.css"))
  5.     Else
  6.       $hView = New HelpBrowser($hPanel) As "hvwHelp"
  7.     Endif
  8.  
  9.  
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Regular
thatbruce is in the usergroup ‘Regular’
 So would it be possible to build a help viewer based on something "better" than htmlview?
b

Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’
gbWilly leads the usergroup ‘GambOS Contributor’
gbWilly is in the usergroup ‘Blogger’

thatbruce said

So would it be possible to build a help viewer based on something "better" than htmlview?
b
It shouldn't be to hard to use webview instead of htmlview.
Webview can read local files as well and I suppose offline means there is some folder structure with help in html format.
I do something likewise with my guides (local folders with html files) and use webview.

I guess Benoit's idea here is that either
1. webview is an overkill for handling local html files compared to htmlview.
It is a bare bone viewer of local html files, not much more. To get the functionality of webview would require al lot of own code to handle what webview offeres default. If I didn't have online references in my guides, I would have used htmlview as well as it is way more lightweight and easier to use for local html files with NO online references. htnlview doesn't handle online links, you would have to code getting it using gb.net.curl

OR

2 if you use webview for local offline docs, clicking on a link in there might get you online instead of local.
This would defeat the whole purpose of offline docs  :D

I don't know, I haven't studied the code, just my 2 cents on options and possibilities with possible caveats.

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!
Online now: No Back to the top

Post

Posted
Rating:
#10
Regular
JumpyVB is in the usergroup ‘Regular’
Thank you, I find it easier to accept the way things are when I hear the reasoning behind the design decision.
Online now: No Back to the top
1 guest and 0 members have just viewed this.