Files
help/source/text/swriter/guide/section_insert.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

98 lines
5.7 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<meta>
<topic id="textswriterguidesection_insertxml" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">Inserting Sections</title>
<filename>/text/swriter/guide/section_insert.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id3149695">
<bookmark_value>sections; inserting</bookmark_value>
<bookmark_value>inserting; sections</bookmark_value>
<bookmark_value>HTML documents;inserting linked sections</bookmark_value>
<bookmark_value>updating;linked sections, manually</bookmark_value>
<bookmark_value>links;inserting sections</bookmark_value>
</bookmark>
<paragraph id="hd_id3149695" role="heading" level="1" xml-lang="en-US"><variable id="section_insert"><link href="text/swriter/guide/section_insert.xhp">Inserting Sections</link></variable></paragraph>
<paragraph id="par_id3155917" role="paragraph" xml-lang="en-US">You can insert new sections, or links to sections in other documents into the current document. If you insert a section as a link, the content of the link changes when you modify the source document.</paragraph>
<paragraph id="hd_id3155863" role="heading" level="2" xml-lang="en-US">To Insert a New Section</paragraph>
<list type="ordered">
<listitem>
<paragraph id="par_id3149843" role="listitem" xml-lang="en-US">Click in your document where you want to insert a new section, or select the text that you want to convert to a section.</paragraph>
<paragraph id="par_id3156103" role="listitem" xml-lang="en-US">If you select a text that occurs within a paragraph, the text is automatically converted into a new paragraph.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3149281" role="listitem" xml-lang="en-US">Choose <emph>Insert - Section</emph>.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3153404" role="listitem" xml-lang="en-US">In the <item type="menuitem">New Section</item> box, type a name for the section.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3153127" role="listitem" xml-lang="en-US">Set the options for the section, and then click <emph>Insert</emph>.</paragraph>
</listitem>
</list>
<paragraph id="hd_id3149635" role="heading" level="2" xml-lang="en-US">To Insert a Section as a Link</paragraph>
<paragraph id="par_id3149648" role="paragraph" xml-lang="en-US">Before you can insert a section as link, you must first create sections in the source document.</paragraph>
<paragraph id="par_id3149611" role="paragraph" xml-lang="en-US">When you open a document that contains linked sections, $[officename] prompts you to update the contents of the sections. To manually update a link, choose <emph>Tools - Update - Links</emph>.</paragraph>
<paragraph id="par_id3149860" role="paragraph" xml-lang="en-US">You can also insert linked sections in HTML documents. When you view the page in a web browser, the content of the sections corresponds to the content of the sections at the time the HTML document was last saved.</paragraph>
<list type="ordered">
<listitem>
<paragraph id="par_id3145104" role="listitem" xml-lang="en-US">Click in your document where you want to insert the linked section.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3156241" role="listitem" xml-lang="en-US">Choose <emph>Insert - Section</emph>.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3153363" role="listitem" xml-lang="en-US">In the <item type="menuitem">New Section</item> box, type a name for the section.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3153387" role="listitem" xml-lang="en-US">In the <item type="menuitem">Link</item> area, select the <item type="menuitem">Link</item> check box. <switchinline select="sys"><caseinline select="WIN">Under Windows, you can also select the <item type="menuitem">DDE</item> check box to automatically update the contents of the section when the section in the source document is changed.
</caseinline></switchinline></paragraph>
</listitem>
<listitem>
<paragraph id="par_id3154852" role="listitem" xml-lang="en-US">Click the <emph>Browse</emph> button next to the <emph>File name</emph> box.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3155882" role="listitem" xml-lang="en-US">Locate the document containing the section that you want to link to, and then click <emph>Insert</emph>.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3149978" role="listitem" xml-lang="en-US">In the <item type="menuitem">Section</item> box, select the section that you want to insert.</paragraph>
</listitem>
<listitem>
<paragraph id="par_id3150003" role="listitem" xml-lang="en-US">Click <emph>Insert</emph>.</paragraph>
</listitem>
</list>
<embed href="text/shared/00/00000004.xhp#related"/>
<embed href="text/swriter/guide/sections.xhp#sections"/>
<embed href="text/swriter/guide/section_edit.xhp#section_edit"/>
</body>
</helpdocument>