Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename the document element from "guide" to "devbook" #352

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ install: all

validate: devbook.rng
@xmllint --noout --quiet --relaxng $< $(XMLS)
@# Check if /guide/@self agrees with the document path
@# Check if /devbook/@self agrees with the document path
@for file in $(XMLS); do \
self=$$(xmllint --quiet --xpath 'string(/guide/@self)' $${file}); \
self=$$(xmllint --quiet --xpath 'string(/devbook/@self)' $${file}); \
if test "$${self}text.xml" != "$${file#./}"; then \
echo "$${file}: bad self attribute '$${self}'"; exit 1; \
fi; \
Expand Down
4 changes: 2 additions & 2 deletions appendices/common-problems/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/common-problems/">
<devbook self="appendices/common-problems/">
<chapter>
<title>Common problems</title>
<body>
Expand Down Expand Up @@ -195,4 +195,4 @@ by tricking the build system into using a safer location. See
</body>
</section>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions appendices/contributing/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/contributing/">
<devbook self="appendices/contributing/">
<chapter>
<title>Contributing to this document</title>

Expand Down Expand Up @@ -144,4 +144,4 @@ amount of depth.
</body>
</section>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions appendices/contributors/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/contributors/">
<devbook self="appendices/contributors/">
<chapter>
<title>Contributions</title>
<body>
Expand Down Expand Up @@ -133,4 +133,4 @@ This page lists the contributions to the Gentoo Development Guide:

</body>
</chapter>
</guide>
</devbook>
18 changes: 9 additions & 9 deletions appendices/devbook-guide/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/devbook-guide/">
<devbook self="appendices/devbook-guide/">
<chapter>
<title>Gentoo DevBook XML guide</title>

Expand Down Expand Up @@ -34,18 +34,18 @@ used in a DevBook XML document:

<codesample lang="sgml" caption="The preamble of a DevBook XML document">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;guide self="appendices/devbook-guide/"&gt;
&lt;devbook self="appendices/devbook-guide/"&gt;
&lt;chapter&gt;
&lt;title&gt;Gentoo DevBook XML guide&lt;/title&gt;
</codesample>

<p>
On the first lines, we see the XML declaration that identifies this as an XML
document. Next, there's a <c>&lt;guide&gt;</c> tag <d/> the entire document is
enclosed within a <c>&lt;guide&gt; &lt;/guide&gt;</c> pair. Its <c>self</c>
document. Next, there's a <c>&lt;devbook&gt;</c> tag <d/> the entire document is
enclosed within a <c>&lt;devbook&gt; &lt;/devbook&gt;</c> pair. Its <c>self</c>
attribute must point to the relative path of the document from the root node;
in the example above the path is <c>appendices/devbook-guide/</c>. An exception
is the root node itself, which has <c>&lt;guide root="true"&gt;</c> instead.
is the root node itself, which has <c>&lt;devbook root="true"&gt;</c> instead.
</p>

<p>
Expand All @@ -60,7 +60,7 @@ All elements must be closed of course, so the document ends with:

<codesample lang="sgml">
&lt;/chapter&gt;
&lt;/guide&gt;
&lt;/devbook&gt;
</codesample>

</body>
Expand Down Expand Up @@ -125,7 +125,7 @@ tag. Note that the trailing slash in the <c>href</c> value is mandatory.
</p>

<p>
A table of contents can be generated with <c>&lt;contentsTree&gt;</c>.
A table of contents can be generated with <c>&lt;contents/&gt;</c>.
Typically, this would be the only element in its own section body, as in
the following example:
</p>
Expand All @@ -134,7 +134,7 @@ the following example:
&lt;section&gt;
&lt;title&gt;Contents&lt;/title&gt;
&lt;body&gt;
&lt;contentsTree/&gt;
&lt;contents/&gt;
&lt;/body&gt;
&lt;/section&gt;
</codesample>
Expand Down Expand Up @@ -714,4 +714,4 @@ possible. In other words, the
</subsection>
</section>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions appendices/editor-configuration/emacs/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/editor-configuration/emacs/">
<devbook self="appendices/editor-configuration/emacs/">
<chapter>
<title>Configuring GNU Emacs</title>

Expand Down Expand Up @@ -106,4 +106,4 @@ for each document type.
</section>

</chapter>
</guide>
</devbook>
6 changes: 3 additions & 3 deletions appendices/editor-configuration/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/editor-configuration/">
<devbook self="appendices/editor-configuration/">
<chapter>
<title>Editor configuration</title>
<body>
Expand All @@ -14,7 +14,7 @@ with ebuilds.
<section>
<title>Contents</title>
<body>
<contentsTree/>
<contents/>
</body>
</section>
</chapter>
Expand All @@ -23,4 +23,4 @@ with ebuilds.
<include href="emacs/"/>
<include href="xemacs/"/>

</guide>
</devbook>
4 changes: 2 additions & 2 deletions appendices/editor-configuration/vim/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/editor-configuration/vim/">
<devbook self="appendices/editor-configuration/vim/">
<chapter>
<title>Configuring <c>vim</c> and <c>gvim</c></title>
<body>
Expand All @@ -22,4 +22,4 @@ of interest. The ! is required to replace spaces with tabs.

</body>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions appendices/editor-configuration/xemacs/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/editor-configuration/xemacs/">
<devbook self="appendices/editor-configuration/xemacs/">
<chapter>
<title>Configuring XEmacs for UTF-8</title>
<body>
Expand Down Expand Up @@ -45,4 +45,4 @@ status line.

</body>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions appendices/further-reading/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/further-reading/">
<devbook self="appendices/further-reading/">
<chapter>
<title>Further reading</title>
<body>
Expand Down Expand Up @@ -57,5 +57,5 @@ recommendations, not padding designed to make this document look important.
</body>
</section>
</chapter>
</guide>
</devbook>

6 changes: 3 additions & 3 deletions appendices/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/">
<devbook self="appendices/">
<chapter>
<title>Appendices</title>

Expand All @@ -12,7 +12,7 @@ This section incorporates various auxiliary documents which may be useful as a r
<section>
<title>Contents</title>
<body>
<contentsTree/>
<contents/>
</body>
</section>
</chapter>
Expand All @@ -25,4 +25,4 @@ This section incorporates various auxiliary documents which may be useful as a r
<include href="contributors/"/>
<include href="todo-list/"/>

</guide>
</devbook>
6 changes: 3 additions & 3 deletions appendices/todo-list/text.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="appendices/todo-list/">
<devbook self="appendices/todo-list/">
<chapter>
<title>TODO list</title>
<body>
<p>
This TODO list is automatically generated from the <c>&lt;todo&gt;</c> directives in other documents.
</p>

<contentsTree root="" extraction="todo"/>
<contents root="" extraction="todo"/>
</body>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions archs/alpha/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="archs/alpha/">
<devbook self="archs/alpha/">
<chapter>
<title>Arch specific notes — Alpha</title>
<body>
Expand Down Expand Up @@ -155,4 +155,4 @@ The Alpha team can be contacted:
</body>
</section>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions archs/amd64/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="archs/amd64/">
<devbook self="archs/amd64/">
<chapter>
<title>Arch specific notes — AMD64/EM64T</title>

Expand Down Expand Up @@ -493,4 +493,4 @@ segmentation faults or strange behaviour. GCC 4.0 refuses to compile such code.
</body>
</section>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions archs/mips/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="archs/mips/">
<devbook self="archs/mips/">
<chapter>
<title>Arch specific notes — MIPS</title>
<body>
Expand Down Expand Up @@ -135,4 +135,4 @@ The MIPS team can be contacted:
</body>
</section>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions archs/ppc/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="archs/ppc/">
<devbook self="archs/ppc/">
<chapter>
<title>Arch specific notes — PPC</title>
<body>
Expand Down Expand Up @@ -103,4 +103,4 @@ The PowerPC team can be reached by:
</body>
</section>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions archs/sparc/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="archs/sparc/">
<devbook self="archs/sparc/">
<chapter>
<title>Arch specific notes — SPARC</title>
<body>
Expand Down Expand Up @@ -149,6 +149,6 @@ The SPARC team can be contacted:
</body>
</section>
</chapter>
</guide>
</devbook>


6 changes: 3 additions & 3 deletions archs/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="archs/">
<devbook self="archs/">
<chapter>
<title>Arch specific notes</title>
<body>
Expand All @@ -22,7 +22,7 @@ happens to work best in any situation.
<section>
<title>Contents</title>
<body>
<contentsTree/>
<contents/>
</body>
</section>
</chapter>
Expand All @@ -34,4 +34,4 @@ happens to work best in any situation.
<include href="sparc/"/>
<include href="x86/"/>

</guide>
</devbook>
4 changes: 2 additions & 2 deletions archs/x86/text.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<guide self="archs/x86/">
<devbook self="archs/x86/">
<chapter>
<title>Arch specific notes — x86</title>
<body>
Expand Down Expand Up @@ -63,4 +63,4 @@ The x86 team can be contacted:
</body>
</section>
</chapter>
</guide>
</devbook>
4 changes: 2 additions & 2 deletions bin/build_search_documents.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/python3
# Copyright 2019 Gentoo Authors
# Copyright 2019-2024 Gentoo Authors
# Distributed under the terms of the GNU GPL version 2 or later
import json
import os.path
Expand Down Expand Up @@ -83,7 +83,7 @@ def process_node(documents: list, node: ET.Element, name: str, url: str) -> None

for child in node:
process_node(documents, child, name, url)
elif node.tag in ['body', 'dl', 'guide', 'ul', 'table', 'tr']:
elif node.tag in ['devbook', 'body', 'dl', 'ul', 'table', 'tr']:
for child in node:
process_node(documents, child, name, url)
elif node.tag in ['p', 'dd', 'dt', 'important', 'li', 'note', 'warning', 'th', 'ti']:
Expand Down
4 changes: 2 additions & 2 deletions bin/gen-eclass-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ find "${OUTPUTDIR}" -mindepth 1 -maxdepth 1 -mtime +1 -exec rm -R {} \;
# build the index, rebuilding it each time
cat << 'EOF' > "${OUTPUTDIR}"/text.xml || exit 1
<?xml version="1.0" encoding="UTF-8"?>
<guide self="eclass-reference/">
<devbook self="eclass-reference/">
<chapter>
<title>Eclass reference</title>
<body>
Expand Down Expand Up @@ -212,7 +212,7 @@ fi

cat << 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1
</chapter>
</guide>
</devbook>
EOF

# Local Variables:
Expand Down
4 changes: 2 additions & 2 deletions depend.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<xsl:template match="/">
<xsl:variable name="refs">
<!-- all descendants -->
<xsl:call-template name="contentsTree"/>
<xsl:call-template name="contents"/>
<!-- all ancestors -->
<xsl:call-template name="printParentDocs"/>
<!-- previous and next documents -->
<xsl:call-template name="findPrevious"/>
<xsl:call-template name="findNext"/>
</xsl:variable>
<xsl:variable name="self" select="/guide/@self"/>
<xsl:variable name="self" select="/devbook/@self"/>
<xsl:value-of select="concat($self, 'index.html:')"/>
<xsl:for-each select="exslt:node-set($refs)//a/@href[. != '#']">
<xsl:text> </xsl:text>
Expand Down
Loading