Package: lo-dev-search
LibreOffice Developer SearchSimplified searching for LibreOffice Developers. This version targets LibreOffice7.4.Installationpiplo-dev-searchPyPIpipinstalllo-dev-searchFor LibreOffice7.3pipinstall"lo-dev-search<2.0"Finding API Documentation OnlineThe online API documentation can be time-consuming to search due to its great size.If you want to have a browse, start atLibreOffice API Namespaces, which takes a while to load.Each Office application (e.g. Writer, Draw, Impress, Calc, Base, Math) is supported by multiple modules. For example, most of Writer's API is in Office's "text" module, while Impress' functionality comes from the "presentation" and "drawing" modules. These modules are located incom.sun.star package.Rather than searching manually through a module for a given class, it's a lot quicker to get a search engine to do it for you. This is the purpose of mylodoccli, which utilizesGoogle. For instance, at the command line, you can type:lodocxtextand the Office API documentation on the XText interface will open in your browser.lodoc'almost' always returns the right page, mainly because Office interfaces, and many of its services, have long unique names. (I'll explain what a service is shortly.)lodoccan be access by typinglodocin the terminal.Service names are less unusual, and so you should probably add the word "service" to your search. For instance, if you're looking for the Text service, type:lodoctextserviceModule names are also quite common words, so add "module" to the search. If you want to reach the "text" module (which implements most of Writer), search for:lodoctextmoduleYou can call lodoc with Office application names, which are mapped to API module names. For instance:lodocImpressbrings up the "presentation" module page.Searching the Online Developer's GuideThe online Developer's Guide can also be time-consuming to search because it's both long (around 1650 pages), and poorly organized. To help, I've written aloguidecli which is quite similar tolodoc. It callsGoogle, limiting the search to the Developer's Guide web pages, and loads the first matching page into your web browser.The first argument ofloguidemust be an Office application name, which restricts the search to the part of the guide focusing on that application's API or otherwise,general.Typeloguide -hfor options.General example:loguidegeneralLifetimeofUNOObjectsloads the guide page with that heading into the browser. A less precise query will probably produce the same page, but even when the result is 'wrong' it'll still be somewhere in the guide.Impress example:loguideimpressPageFormattingCallingloguidewith just an application name, opens the guide at the start of the chapter on that topic. For example:loguidewriteropens the guide at the start of the "Text Documents" chapter.Callingloguidewith no arguments, makes the browser load the first page of the guide.loapiloapiuses a local database to narrow class names and namespaces for a more focused search.loapi comploapi compcan search for a componentsconst,enum,exception,interface,singleton,service,struct,typedeforany.Typeloapi comp -hto see options available forcomp.For example:loapicomp--searchwriter
Chooseanoption(default1):[0],Cancel[1],UnsupportedOverwriteRequest-com.sun.star.task.UnsupportedOverwriteRequest-exception[2],LayerWriter-com.sun.star.configuration.backend.xml.LayerWriter-service[3],ManifestWriter-com.sun.star.packages.manifest.ManifestWriter-service[4],Writer-com.sun.star.xml.sax.Writer-service[5],XCompatWriterDocProperties-com.sun.star.document.XCompatWriterDocProperties-interface[6],XManifestWriter-com.sun.star.packages.manifest.XManifestWriter-interface[7],XSVGWriter-com.sun.star.svg.XSVGWriter-interface[8],XWriter-com.sun.star.xml.sax.XWriter-interfaceChoosing any number greater than0opens the that components url.
Option4would open tohttps://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1xml_1_1sax_1_1Writer.htmlSearch can be narrowed by including--component-typeoption.loapicomp--component-typeservice--searchwriter
Chooseanoption(default1):[0],Cancel[1],LayerWriter-com.sun.star.configuration.backend.xml.LayerWriter-service[2],ManifestWriter-com.sun.star.packages.manifest.ManifestWriter-service[3],Writer-com.sun.star.xml.sax.Writer-serviceA search parameter can be more that one word.For example:loapicomp--component-typeexception--search"ill arg"Chooseanoption(default1):[0],Cancel[1],IllegalArgumentIOException-com.sun.star.frame.IllegalArgumentIOException-exception[2],IllegalArgumentException-com.sun.star.lang.IllegalArgumentException-exceptionsearches for all components of typeexceptionthat containillfollowed by any number of characters and thenarg.loapi nsSimilar toloapi comp,loapi nssearch strictly in namespaces.Typeloapi ns -hto see options available forns.For example:loapins--searchxml
Chooseanoption(default1):[0],Cancel[1],com.sun.star.xml[2],com.sun.star.xml.crypto.sax[3],com.sun.star.xml.dom[4],com.sun.star.xml.crypto[5],com.sun.star.xml.xslt[6],com.sun.star.xml.input[7],com.sun.star.xml.sax[8],com.sun.star.xml.wrapper[9],com.sun.star.xml.xpath[10],com.sun.star.xml.dom.viewsChoosing any number greater than0opens the that components url.
Option4would open tohttps://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1xml_1_1crypto.htmlloprocWhile developing/debugging code, it's quite easy to inadvertently trigger a runtime exception in the Office API. In the worst case, this can cause your program to exit without shutting down thesofficeprocess.loproc --runningshow if the process is running.loproc --killkills the process if it is running.There is no issue runningloproc --killwithout runningloproc --running.