Files
help/source/text/sbasic/shared/conventions.xhp
Ilmari Lauhakangas 7e42394ecb 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>
2022-12-07 17:39:02 +00:00

71 lines
5.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<meta>
<topic id="org.LibreOffice.Help.conventions">
<title id="tit" xml-lang="en-US">Syntax Diagrams</title>
<filename>/text/sbasic/shared/conventions.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id861593777289558">
<bookmark_value>Syntax diagrams; How to read</bookmark_value>
<bookmark_value>Statements syntax;How to read</bookmark_value>
<bookmark_value>Typographical conventions</bookmark_value>
</bookmark>
<h1 id="hd_id221543446540070"><link href="text/sbasic/shared/conventions.xhp">How to Read Syntax Diagrams and Statements</link></h1>
<paragraph role="paragraph" id="par_id601593699108443">%PRODUCTNAME Basic statements use syntax diagrams and textual conventions that follow these typographical rules:</paragraph>
<list type="unordered">
<listitem><paragraph id="par_id158193699546735" role="listitem">%PRODUCTNAME Basic keywords or functions use proper casing: Call, DimArray, InputBox, Property.</paragraph></listitem>
<listitem><paragraph id="par_id711593699548486" role="listitem">Lowercase characters indicate information to supply: end, expression, start, variable.</paragraph></listitem>
</list>
<paragraph role="paragraph" id="par_id881593760345504">The syntax of a %PRODUCTNAME Basic one line statement is illustrated herewith:</paragraph>
<h2 id="hd_id871593700670279">Diagram example</h2>
<list type="unordered">
<listitem><paragraph id="par_id181593699574635" role="listitem">Basic statement diagrams start and end with double vertical bars,</paragraph></listitem>
<listitem><paragraph id="par_id711596399548486" role="listitem">Loops indicate a possible repetition, an optional separator may be present,</paragraph></listitem>
<listitem><paragraph id="par_id541593706654897" role="listitem">Rectangles denote subsequent diagram fragments,</paragraph></listitem>
<listitem><paragraph id="par_id251593706717957" role="listitem">Diagram fragments extremities exhibit single vertical bars.</paragraph></listitem>
</list>
<paragraph role="image" id="par_id831588865616326"><image src="media/helpimg/sbasic/a_statement.svg" id="img_id651588865616326"><alt id="alt_id281588865616326">syntax of a statement</alt></image></paragraph>
<paragraph role="paragraph" id="par_id411579301639711">A set of %PRODUCTNAME Basic statements - with optional labels - is using a colon <literal>:</literal> sign to separate them, it can be terminated with an optional comment. <literal>REM</literal> or an apostrophe sign introduce a comment.</paragraph>
<paragraph role="image" id="par_id931593707147102"><image src="media/helpimg/sbasic/comment_fragment.svg" id="img_id191593707147102"><alt id="alt_id111593707147102">diagram fragment</alt></image></paragraph>
<h2 id="hd_id71593700691968">Textual example</h2>
<section id="Typography">
<list type="unordered">
<listitem><paragraph id="par_id181593700546735" role="listitem"><emph>[opt1|opt2|opt3]</emph> Items inside brackets are optional, alternatives are indicated with a vertical bar,</paragraph></listitem>
<listitem><paragraph id="par_id181593699546735" role="listitem"><emph>case[[sep]…]</emph> An ellipsis indicates a possible repetition, an optional separator may be specified,</paragraph></listitem>
<listitem><paragraph id="par_id712593699548486" role="listitem"><emph>{choice1|choice2}</emph> Items inside curly braces are compulsory, alternatives are indicated with a vertical bar.</paragraph></listitem>
</list>
</section>
<paragraph role="paragraph" id="par_id881593759547050" localize="false"><literal>[ [label:] statement [: …] ] [{REM|'} text]</literal></paragraph>
<paragraph role="paragraph" id="par_id411593701639711">A set of %PRODUCTNAME Basic statements - with optional labels - is using a colon <literal>:</literal> sign to separate them, it can be terminated with an optional comment. <literal>REM</literal> or an apostrophe sign introduce a comment.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<bascode>
<paragraph role="bascode" id="N0008" localize="false">Sub Main<br/></paragraph>
<paragraph role="bascode" id="N0018" xml-lang="en-US"> GoTo there &apos; skip first statement</paragraph>
<paragraph role="bascode" id="N0019" xml-lang="en-US"> here: Print 1, : there: Print 2 REM explanatory text here</paragraph>
<paragraph role="bascode" id="N0021" localize="false">End Sub</paragraph>
</bascode>
<section id="relatedtopics" >
<embed href="text/sbasic/shared/03090302.xhp#GoToh1"/>
<embed href="text/sbasic/shared/03010103.xhp#Print_h1"/>
<embed href="text/sbasic/shared/03090407.xhp#remstatement"/>
<embed href="text/sbasic/shared/03090409.xhp#Sub_h1"/>
</section>
</body>
</helpdocument>