Monday, April 29, 2019

New Help: Copy BASIC and PYTHON code to Clipboard on a Click

The next release for LibreOffice will have a small but handy improvement for every macro developer, either experienced or beginner.

Hover the mouse on BASIC and Python code in the new Help pages and a tip shows that when you click your mouse, the code exerpt is copied in the system clipboard. You can paste in the BASIC IDE (Integrated Development environment) or any other text application in your system.



With this little feature, you save time of typing the exerpt to test in your IDE or document. Another alternative was to use a collateral file, however, collateral files with embedded macros is likely to trigger security warnings in most LibreOffice installations. Just copying the fragment is easier.

Happy Basic macro programming!
Happy Python macro programming!

Monday, January 14, 2019

Report on the New LIbreOffice Help Pages Online Editor

The Online Help Editor is getting a shape

I have improved and fixed a bit the XHP editor, and changed the page address:

https://newdesign.libreoffice.org/help_editor/index.html

 The editor is still work in progress, but starts to become interesting for creating and editing Help pages.

What's new

  • Mike Saunders implementation of the autocompletion of XHP tags for Codemirror editor.
  • The left and right panes are now fixed in browser screen and scrollable,
  • The right pane uses 99% of the current Help transformation rendering, plus
  • some visual debug information left intentionally to help Author in adjusting <embed>s, <image>s and <link>s . 
  • You can now open a Help page directly from the interface. 
    • The help page is normally source/text/AAA/BBB/myHelpPage.xhp  
    • Type /AAA/BBB/myHelpPage.xhp in the text box and click Open File to load in the editor. 
    • Press Render page to see it on the right. 
  • A set of buttons with XHP snippets to shorten editing workload: 
    • For <paragraph>s, <note>s, <heading>s, <emph>s, <menuitem>s, etc... select the raw text or contents and click the corresponding button. The raw text will be wrapped with the opening and closing tag. For paragraph-like contents, an unique id will be created automatically, a feture required for translations. 
    • Other snippets builds fragments of XHP tags, such as <table>s, <tablerow>, <list>s, <section>s, and more.
    • Just play with and do not forget to render the page on the right. 

Restrictions

  • The editor works with Firefox only. Issues with Chrome and Edge. Other browsers not yet tested.
  • Saving files not implemented. However you can copy the editor contents and finish the patch in you preferred editor
  • More XHP checking are under development, specially id's unicity and DTD checking
  • If you get a blank page on the right, this is because you hit a bug in the browser transformation. Unfortunately debugging the browser transformation is very hard, support is almost none.

Invitation for developers and testers

  • You are invited to test the editor, report bugs and suggest improvements.  
  • The user interface is simple HTML and Javascript. If you have skills in these technologies you are a potential developer for the editor, but we know that PHP will be the right tech choice in near future.  
  • The source code is in the dev-tool repository. 
    • To clone the dev-tool repository : 
    •  git clone https://gerrit.libreoffice.org/dev-tools dev-tools 
    • The editor is in dev-tools/help3/html/ 
  • If you have a web server working in your computer (Apache, Nginx, etc...) you can run the editor locally: create a link between the web server root and the editor. For example, under Debian-like Linux: 
    • sudo cd /var/www/html 
    • sudo ln -s help-editor /dev-tools/help3/html 
    • and point your browser to http://localhost/help-editor 

Seeking Help and discussion on the editor

Please use the documentation list, the developer list and our IRC channels to get in touch with the development of the editor. 

Ackowledgements

The Javascript editor used is CodeMirror and was carefully selected by Mike Saunders who also set the initial confguration for working with XML and our XML dialect XHP, as well as configured the autocompletion features.

The XHP snippets were originally designed for the KDE Kate editor and ported to the online editor.
 

Thursday, October 25, 2018

Proposed XHP Extensions

After significant amount of time spent writing and fixing LibreOffice Help pages (XHP), I came to conclusion that the LibreOffice Help XML (XHP) is a powerful markup but a bit too hard to master for newcomers and easy to have errors and mistakes slipped in files. Some of its complexity are not absolutely required so I wrote a wiki page suggesting the implementation of XHP extensions, aiming to make life simpler for adding and reading XHP contents textually (markup).

Please note that in any case the current markup is affected, so it will preserve the legacy contents as well as the current translations. For example, the new markup for 'tip' paragraph should be

<tip id="123456" localize="true" xml-lang="en-US"></tip>

So it can replace

<paragraph id="123456" localize="true" role="tip" xml-lang="en-US"></paragraph>

Yes, it is a trivial change but I hope it will make reading easier for all.

Handling of the XHP extensions will be in the XSLT transformation and it will be patched accordingly, as well as the DTD, wiki documentation on XHP, and string extractors for Pootle.

The wiki page is

https://wiki.documentfoundation.org/Documentation/Proposed_Extensions_for_XHP

And comments are welcome, do's and dont's, thumbs up or thumbs down.

Happy help writing.

Monday, September 10, 2018

Hovering icons in Help pages

Last week I implemented a feature in our help pages using a modern CSS (Cascade Style Sheets) technique when hovering the mouse pointer on icons displayed in the page: the hovered icon is enlarged twice its size.

Almost every icon in the help pages are sized 0.22 in x 0.22in (~0,5cm x 0,5cm) which is sometimes a bit too small, especially with minimalistic designed icons such as the Colibre icon family. Enlarging the icons helps user to visualize and since it was implemented in CSS, there was no need to change the icons dimensions in the source help pages.

To see it working, please check this page and hover the mouse on icons.

Normal size

Enlarged on hover


Comments and suggestions are welcome.

Happy icon hovering!

Wednesday, August 22, 2018

Compress Images

I just submitted a patch for LibreOffice Help to document the Compress Image feature.

The Compress Image feature is active when an image is selected and you want to change the data size of the image, at the expense of a optional and controllable loss of quality set in a dialog box.

The Compress Image dialog


Compressing is useful if you insert a high resolution image in a document. For example a 4000x4000 pixel image in bitmap format (BMP) is approximately of  48MB size, which can turn you document edition hard in constrained-resources computers. By compressing the image with the right format and quality index you can reduce the size of the picture with no loss of visual quality and have the document file much lighter to edit.

Enjoy!




Tuesday, August 7, 2018

When nothing else works...

Few things in life makes me unhappy than a unoptimal or broken system. When my machine does not work at its best I start to suffer itches and bad mood.

Like many other nerds, I can't avoid to update my laptop operating system with the latest developments. No exceptions with Kubuntu 18.04, where I innocently thought it will fix some nasty bugs of 17.10 I was enduring, notably, a very slow desktop login. I took the radical approach, let's format the root partition and install from scratch.

All backups done, machine reinstalled and bingo! now I can't get a second user session, without disconnecting the first. To put in perspective, what is an operating system, especially linux, that can't get more than one user session active at the time?

As usual, Google here, Google there, countless web pages of irrelevant content... and nothing. Greping the syslog, and the culprit was sddm, the login service of Kubuntu. On Github, a report on the issue, but no further indication that the bug will be fixed someday.

Then a hint on the bug report, and it was related to the dual hybrid graphics architecture of the laptop. In my case, I have an Intel and a Radeon dual graphic laptop. The suggestion was to disable the Radeon chip and work only with the Intel, which is no big deal for me. I was happy to finally fix it.

Too easy huh? Not at all. The laptop began to warm too much, even with no CPU load. It was uncomfortable even to rest the hand on the keyboard.

Another set of Google searches and a page in Ubuntu on hybrid graphics. Joining the two solutions, I enabled back the radeon driver, and enabled the switch to let the kernel manage the second graphic chip, so sddm know about it, even if I don't use it.

Second session working, and laptop in normal temperature.





Sunday, June 24, 2018

The Styles Menu and UI Customization

Yesterday I was reviewing a nice feature implemented by the User Experience Team of LibreOffice about the Style menu in WRITER. Like all help pages I review, I must test and explore the feature, looking to get the benefits but also to note the possible pitfalls.

What caught my attention was a nice combination of LibreOffice UI and menu customization. LibreOffice allows documents to carry the customized user interface menus, toolbars and much more. If you have a document that requires a specific set of commands you can customize the user interface in Tools - Customize and store the user interface in your document. When opening the document in another machine with LibreOffice, the user interface carried by the document is displayed. I used this feature professionally when I had to convert some old Excel macros to LibreOffice and the macros had hundreds of lines just to modify the user interface. I drop these lines, did the changes in UI once and stored in the document.



So I applied the same strategy to the Styles menu. I was glad to see that you can format your document with little amount click or by activating the style menu with the keyboard. All my custom style were in the menu.

Then closed my document and opened a new document. I wanted to apply my custom styles as before but hey... it does not work. The custom styles were just doing nothing.

The trick is to customize the Styles menu with your preferred styles and add them to your document instead of the LibreOffice Writer interface (the default). This detail slipped under my nose.



Lessons learned: If you want a document with custom styles in the Styles menu, create a template with your custom styles and custom user interface and each new document based on the template will have everything set up.

Happy Text Styling !