tdf#152323 drop name attribute from <link> elements

Replacement done with

find . -name \*.xhp -print0 |xargs -0 -P 0 perl -CS -pi -e \
        's#(<link[^>]*?) +name *="[^"]*" *( [^>]+|) *>#$1$2>#g'

(note some inconsistencies with space between name and = and also having
empty value, and some more complicated expression to also clear up
double space before/after the attribute)

translation files will be prepped with:

find */helpcontent2 -name \*.po -print0 |xargs -0 -P 0 perl -CS -pi -e \
    $'s#(<link[^>]*?) +name=(?:\\\\"[^"]*\\\\"|\'[^\']*\') *( [^>]+|) *(/?>)#$1$2$3#g unless /^#/'

(note that not all languages use the " as quote character for the
attributes, but that also single quotes appera in the po file. Hence
the use of the shell $'string' syntax to be able to quote ' as \'
It also requires to quote the backslash, so that it needs to be escaped
once for the shell, then another time for perl. Also don't work on
obsolete strings (those are prefixed with #~ in the po files)
Also note that <link..></link> gets turned into <link ../> during
translation extraction (along with removal of the space between the
attribute name and the value), so the pattern needs to be slightly
different here)

Change-Id: I95e53a08e6b0095cd894109ea0de154cc4859d8f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143713
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Ilmari Lauhakangas
2022-12-06 14:05:20 +02:00
committed by Christian Lohmaier
parent 490d42493e
commit 7e42394ecb
2085 changed files with 4560 additions and 4560 deletions

View File

@ -26,11 +26,11 @@
<bookmark_value>uno.py;getDocument</bookmark_value>
</bookmark>
<section id="pythonprogramming">
<h1 id="hd_id691546462755220"><variable id="pythonprogrammingheading"><link href="text/sbasic/python/python_programming.xhp" name="python programming">Programming with Python Scripts</link></variable></h1>
<h1 id="hd_id691546462755220"><variable id="pythonprogrammingheading"><link href="text/sbasic/python/python_programming.xhp">Programming with Python Scripts</link></variable></h1>
</section>
<paragraph role="paragraph" id="N0220">A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of <link href="text/sbasic/shared/uno_objects.xhp" name="UNO objects functions or services">UNO objects functions or services</link>, Python macros use the <literal>XSCRIPTCONTEXT</literal> UNO single object, shared with JavaScript and BeanShell. The <literal>g_exportedScripts</literal> global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another.</paragraph>
<paragraph role="paragraph" id="N0220">A Python macro is a function within a .py file, identified as a module. Unlike %PRODUCTNAME Basic and its dozen of <link href="text/sbasic/shared/uno_objects.xhp">UNO objects functions or services</link>, Python macros use the <literal>XSCRIPTCONTEXT</literal> UNO single object, shared with JavaScript and BeanShell. The <literal>g_exportedScripts</literal> global tuple explicitly lists selectable macros from a module. Python modules hold autonomous code logic, and are independent from one another.</paragraph>
<h2 id="N0221">XSCRIPTCONTEXT Global Variable</h2>
<paragraph role="paragraph" id="N0222">Genuine Basic UNO facilities can be inferred from <literal>XSCRIPTCONTEXT</literal> global variable. Refer to %PRODUCTNAME API for a complete <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScriptContext.html" name="description of XSCRIPTCONTEXT">description of XSCRIPTCONTEXT</link>. <literal>XSCRIPTCONTEXT</literal> methods summarize as:</paragraph>
<paragraph role="paragraph" id="N0222">Genuine Basic UNO facilities can be inferred from <literal>XSCRIPTCONTEXT</literal> global variable. Refer to %PRODUCTNAME API for a complete <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScriptContext.html">description of XSCRIPTCONTEXT</link>. <literal>XSCRIPTCONTEXT</literal> methods summarize as:</paragraph>
<table id="N0223">
<tablerow>
<tablecell>
@ -82,10 +82,10 @@
<h2 id="N0239">Module import</h2>
<warning id="N0240"><literal>XSCRIPTCONTEXT</literal> is not provided to imported modules.</warning>
<section id="PythonFileSystemImport" >
<paragraph role="paragraph" id="N0241">%PRODUCTNAME Basic libraries contain classes, routines and variables, Python modules contain classes, functions and variables. Common pieces of reusable Python or UNO features must be stored in <link href="text/sbasic/python/python_locations.xhp" name="My macros">My macros</link> within <literal>(User Profile)/Scripts/python/pythonpath</literal>. Python libraries help organize modules in order to prevent module name collisions. Import <literal>uno.py</literal> inside shared modules.</paragraph>
<paragraph role="paragraph" id="N0241">%PRODUCTNAME Basic libraries contain classes, routines and variables, Python modules contain classes, functions and variables. Common pieces of reusable Python or UNO features must be stored in <link href="text/sbasic/python/python_locations.xhp">My macros</link> within <literal>(User Profile)/Scripts/python/pythonpath</literal>. Python libraries help organize modules in order to prevent module name collisions. Import <literal>uno.py</literal> inside shared modules.</paragraph>
</section>
<section id="uno">
<paragraph role="paragraph" id="N0242">Genuine BASIC UNO facilities can be inferred using <literal>uno.py</literal> module. Use <link href="text/sbasic/python/python_shell.xhp" name="Python interactive shell">Python interactive shell</link> to get a complete module description using <literal>dir()</literal> and <literal>help()</literal> Python commands.</paragraph>
<paragraph role="paragraph" id="N0242">Genuine BASIC UNO facilities can be inferred using <literal>uno.py</literal> module. Use <link href="text/sbasic/python/python_shell.xhp">Python interactive shell</link> to get a complete module description using <literal>dir()</literal> and <literal>help()</literal> Python commands.</paragraph>
<bookmark xml-lang="en-US" branch="index" id="bm_id391659034206678">
<bookmark_value>uno.py</bookmark_value>
<bookmark_value>uno.py;absolutize</bookmark_value>
@ -221,7 +221,7 @@
</tablerow>
<tablerow>
<tablecell>
<paragraph role="tablecontent" id="N0284">See <link href="text/sbasic/python/python_dialogs.xhp" name="Opening a Dialog">Opening a Dialog</link></paragraph>
<paragraph role="tablecontent" id="N0284">See <link href="text/sbasic/python/python_dialogs.xhp">Opening a Dialog</link></paragraph>
</tablecell>
<tablecell>
<paragraph role="tablecontent" localize="false" id="N0285">CreateUnoDialog()</paragraph>
@ -229,7 +229,7 @@
</tablerow>
<tablerow>
<tablecell>
<paragraph role="tablecontent" id="N0286">See <link href="text/sbasic/python/python_listener.xhp" name="Creating a Listener">Creating a Listener</link></paragraph>
<paragraph role="tablecontent" id="N0286">See <link href="text/sbasic/python/python_listener.xhp">Creating a Listener</link></paragraph>
</tablecell>
<tablecell>
<paragraph role="tablecontent" localize="false" id="N0287">CreateUnoListener()</paragraph>
@ -303,7 +303,7 @@
</table>
<h2 id="N1297">Importing an embedded Module</h2>
<section id="PythonEmbeddedImport" >
<paragraph role="paragraph" id="N1298">Similarly to %PRODUCTNAME Basic that supports browsing and dynamic loading of libraries, Python libraries can be explored and imported on demand. For more information on library containers, visit <link href="https://api.libreoffice.org/" name="API Documentation site">%PRODUCTNAME Application Programming Interface</link> (API) or download <link href="https://www.libreoffice.org/download/download/" name="SDK download page">%PRODUCTNAME Software Development Kit</link> (SDK).</paragraph>
<paragraph role="paragraph" id="N1298">Similarly to %PRODUCTNAME Basic that supports browsing and dynamic loading of libraries, Python libraries can be explored and imported on demand. For more information on library containers, visit <link href="https://api.libreoffice.org/">%PRODUCTNAME Application Programming Interface</link> (API) or download <link href="https://www.libreoffice.org/download/download/">%PRODUCTNAME Software Development Kit</link> (SDK).</paragraph>
<paragraph role="paragraph" id="N3299">Importing a Python document embedded module is illustrated below, exception handling is not detailed:</paragraph>
<pycode>
<paragraph role="pycode" localize="false" id="N1300">import uno, sys</paragraph>
@ -329,7 +329,7 @@
</pycode>
</section>
<section id="relatedtopics">
<paragraph role="paragraph" id="N0321"><link href="text/sbasic/shared/uno_objects.xhp" name="UNO objects page">Basic UNO Objects, Functions and Services</link></paragraph>
<paragraph role="paragraph" id="N0321"><link href="text/sbasic/shared/uno_objects.xhp">Basic UNO Objects, Functions and Services</link></paragraph>
<embed href="text/sbasic/python/python_import.xhp#pythonimporth1"/>
<embed href="text/sbasic/python/python_screen.xhp#ioscreen"/>
<embed href="text/sbasic/python/main0000.xhp#pythonscriptshelp"/>