LibreOffice Calc - Click on cell -> open info window using Zenity or YAD

Does anyone know of a way (or available plugin) that would open a context-specific (a.k.a. cell-specific) formatted information window (using YAD or zenity) to provide guidance related to the topic listed in the specified cell?

For context, I’m looking to add a TARGET-specific pop-up window for each of the TARGETS with guidance specific to the context of that TARGET for the given Chain/Table combination.

I’m already aware that I could add a hyperlink, which would force me to store the Guidance docs as distinct web pages available from GitHub, but I would rather have that guidance somehow embedded in a single companion document that is parsed by the “click-function” of what will likely be a macro calling an external function or an embedded bash script. I did a quick test with the mouse-over “Comment” function, but that just doesn’t cut it for the reason that I can’t format the contents.

Any ideas or suggestions?

2 Likes

Maybe yad with --text-info? YAD Text

1 Like

I’m NOT an expert with either Zenity or Yad, yet in spite of that, I’ve taken work that OTHERS have done, grabbed their code, modified the parts I wanted to use, and thus I’ve written several really simple, functional, quick interfaces for various tools. Examples I’ve written from the code I extracted include clocks, system and package updating via a simple graphical interface and test tools for one of my favorite distributions.

2 Likes

Thank you, Hayden and Brian!

I am less concerned with the Zenity/YAD aspect, as I am with identifying the proper functionality (macro/function) within LibreOffice that will allow me to call that external function which will react to the click-on-box to

  • extract the context “label” from the box,
  • then extract the appropriate guidance segment,
  • then present the guidance in a pop-up window using the Zenity/YAD
3 Likes

After further research and consideratoin, I am making a hard pivot, away from using LibreOffice as my documentation “launchpad”, to using straight HTML with CSS/JavaScript.

Using the “Save As” HTML calc.

(EDIT: continuing after rushing off due to Tornado warning and hail!)

The HTML generated is single HTML page with each individual sheet generated as a separately reference section with its own URL tag and an index list at the top of the page pointing to each of the sheets.

That will give me a good start, preserving the work I already did, but I will “massage” that into proper “modern” tags which are DIV-based.


Given this new approach, the resulting document could be monolithic, but the capabilities dictate using separate distinct files for each “sheet” and each cell-driven guidance.

So, the plan is to build the resulting “demo” with the necessary templates for the Outgoing packets under the PREROUTING/OUTPUT chain/table combination … then get feedback on that approach before continuing with the rest of the overall “project”. TTFN!

:slight_smile:

2 Likes

To close off on the hard pivot decision, for a given LibreOffice Calc spreadsheet (*.ods), the following script will perform,

  • as step 1, extraction of all sheets as a monolithic HTML file, then
  • as step 2, convert that monolithic HTML into distinct HTML files for each individual Tab/Sheet.

Enjoy!


Script: USER__Ods2Html.sh

( I tried to upload the script but it kept giving me an error! :frowning: )


Session Log:

$ ./USER__Ods2Html.sh   --debug   --ods *.ods   --prefix "IPTABLES__ChainGuidance"

ods
suffix = ods
baseFile = IPTABLES__ChainGuidance_v0.4.ods
inBase = IPTABLES__ChainGuidance_v0.4
convert /host/myFW/00__Docn/RawHarvest__02_ToDistill/IPTABLES__Mine/DocTools/IPTABLES__ChainGuidance_v0.4.ods -> /host/myFW/00__Docn/RawHarvest__02_ToDistill/IPTABLES__Mine/DocTools/IPTABLES__ChainGuidance_v0.4.html using filter : HTML (StarCalc)
Overwriting: /host/myFW/00__Docn/RawHarvest__02_ToDistill/IPTABLES__Mine/DocTools/IPTABLES__ChainGuidance_v0.4.html

-rw-rw-r-- 1 ericthered ericthered 540465 Jul 16 22:28 IPTABLES__ChainGuidance_v0.4.html

	 DEBUG |Overview  NR = 25
	 DEBUG |HREF  NR = 26
	 DEBUG |HREF  NR = 27
	 DEBUG |HREF  NR = 28
	 DEBUG |HREF  NR = 29
	 DEBUG |HREF  NR = 30
	 DEBUG |HREF  NR = 31
	 DEBUG |HREF  NR = 32
	 DEBUG |center  NR = 34
	 DEBUG |sheetNames  NR = 36
	 DEBUG |sheetNames  NR = 138
	 DEBUG |sheetNames  NR = 240
	 DEBUG |sheetNames  NR = 1032
	 DEBUG |sheetNames  NR = 1405
	 DEBUG |sheetNames  NR = 1708
	 DEBUG |sheetNames  NR = 2133
	 DEBUG |body  NR = 4918
	 Saving "table0" to "IPTABLES__ChainGuidance__Sheet001.html" ...
001🮐table0🮐Chain Visibility🮐36🮐137🮐
	 Saving "table1" to "IPTABLES__ChainGuidance__Sheet002.html" ...
002🮐table1🮐REJECT or DROP🮐138🮐239🮐
	 Saving "table2" to "IPTABLES__ChainGuidance__Sheet003.html" ...
003🮐table2🮐Targets Permitted - Format 1🮐240🮐1031🮐
	 Saving "table3" to "IPTABLES__ChainGuidance__Sheet004.html" ...
004🮐table3🮐Local Host - Outgoing Flow🮐1032🮐1404🮐
	 Saving "table4" to "IPTABLES__ChainGuidance__Sheet005.html" ...
005🮐table4🮐Local Host - Incoming Flow🮐1405🮐1707🮐
	 Saving "table5" to "IPTABLES__ChainGuidance__Sheet006.html" ...
006🮐table5🮐Flow Forwarded to Peer🮐1708🮐2132🮐
	 Saving "table6" to "IPTABLES__ChainGuidance__Sheet007.html" ...
007🮐table6🮐Targets Permitted - Format 2🮐2133🮐4917🮐

-rw-rw-r-- 1 ericthered ericthered  10309 Jul 16 22:28 IPTABLES__ChainGuidance__Sheet001.html
-rw-rw-r-- 1 ericthered ericthered  10539 Jul 16 22:28 IPTABLES__ChainGuidance__Sheet002.html
-rw-rw-r-- 1 ericthered ericthered  91900 Jul 16 22:28 IPTABLES__ChainGuidance__Sheet003.html
-rw-rw-r-- 1 ericthered ericthered  42549 Jul 16 22:28 IPTABLES__ChainGuidance__Sheet004.html
-rw-rw-r-- 1 ericthered ericthered  32985 Jul 16 22:28 IPTABLES__ChainGuidance__Sheet005.html
-rw-rw-r-- 1 ericthered ericthered  51437 Jul 16 22:28 IPTABLES__ChainGuidance__Sheet006.html
-rw-rw-r-- 1 ericthered ericthered 300763 Jul 16 22:28 IPTABLES__ChainGuidance__Sheet007.html
3 Likes