summaryrefslogtreecommitdiffstats
path: root/poky/documentation/tools
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 10:05:37 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-22 21:26:31 -0400
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /poky/documentation/tools
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadtalos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz
talos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/documentation/tools')
-rw-r--r--poky/documentation/tools/eclipse-help.sed18
-rw-r--r--poky/documentation/tools/mega-manual.sed40
-rwxr-xr-xpoky/documentation/tools/poky-docbook-to-pdf51
-rw-r--r--poky/documentation/tools/update-documentation-conf168
4 files changed, 277 insertions, 0 deletions
diff --git a/poky/documentation/tools/eclipse-help.sed b/poky/documentation/tools/eclipse-help.sed
new file mode 100644
index 000000000..ab5c9affd
--- /dev/null
+++ b/poky/documentation/tools/eclipse-help.sed
@@ -0,0 +1,18 @@
+# Process poky-ref-manual and yocto-project-qs manual (<word>-<word>-<word> style)
+# For example:
+# "ulink" href="http://www.yoctoproject.org/docs/1.3/poky-ref-manual/poky-ref-manual.html#faq"
+# -> "link" href="../poky-ref-manual/faq.html"
+s@"ulink" href="http://www.yoctoproject.org/docs/[^/]*/([a-z]*-[a-z]*-[a-z]*)/[a-z]*-[a-z]*-[a-z]*.html#([^"]*)"/@"link" href="../1/2.html"@g
+
+# Processes all other manuals (<word>-<word> style)
+# For example:
+# "ulink" href="http://www.yoctoproject.org/docs/1.3/kernel-manual/kernel-manual.html#faq"
+# -> "link" href="../kernel-manual/faq.html"
+s@"ulink" href="http://www.yoctoproject.org/docs/[^/]*/([a-z]*-[a-z]*)/[a-z]*-[a-z]*.html#([^"]*)"@"link" href="../1/2.html"@g
+
+# Process cases where just an external manual is referenced without an id anchor
+# For example:
+# "ulink" href="http://www.yoctoproject.org/docs/1.3/kernel-manual/kernel-manual.html
+# -> "link" href="../kernel-manual/index.html"
+s@"ulink" href="http://www.yoctoproject.org/docs/[^/]*/([a-z]*-[a-z]*-[a-z]*)/[a-z]*-[a-z]*-[a-z]*.html"@"link" href="../1/index.html"@g
+s@"ulink" href="http://www.yoctoproject.org/docs/[^/]*/([a-z]*-[a-z]*)/[a-z]*-[a-z]*.html"@"link" href="../1/index.html"@g
diff --git a/poky/documentation/tools/mega-manual.sed b/poky/documentation/tools/mega-manual.sed
new file mode 100644
index 000000000..64fa4d219
--- /dev/null
+++ b/poky/documentation/tools/mega-manual.sed
@@ -0,0 +1,40 @@
+# Processes poky-ref-manual and yocto-project-qs manual (<word>-<word>-<word> style).
+# This style is for manual folders like "yocto-project-qs" and "poky-ref-manual".
+# This is the old way that did it. Can't do that now that we have "bitbake-user-manual" strings
+# in the mega-manual.
+# s@"ulink" href="http://www.yoctoproject.org/docs/2.5/[a-z]*-[a-z]*-[a-z]*/[a-z]*-[a-z]*-[a-z]*.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/yocto-project-qs/yocto-project-qs.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/poky-ref-manual/poky-ref-manual.html#@"link" href="#@g
+
+# Processes all other manuals (<word>-<word> style) except for the BitBake User Manual because
+# it is not included in the mega-manual.
+# This style is for manual folders that use two word, which is the standard now (e.g. "ref-manual").
+# This was the one-liner that worked before we introduced the BitBake User Manual, which is
+# not in the mega-manual.
+# s@"ulink" href="http://www.yoctoproject.org/docs/2.5/[a-z]*-[a-z]*/[a-z]*-[a-z]*.html#@"link" href="#@g
+
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/sdk-manual/sdk-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/bsp-guide/bsp-guide.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/overview-manual/overview-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/brief-yoctoprojectqs/brief-yoctoprojectqs.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/kernel-dev/kernel-dev.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/profile-manual/profile-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/ref-manual/ref-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/toaster-manual/toaster-manual.html#@"link" href="#@g
+
+# Process cases where just an external manual is referenced without an id anchor
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/brief-yoctoprojectqs/brief-yoctoprojectqs.html" target="_top">Yocto Project Quick Build</a>@Yocto Project Quick Build@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/yocto-project-qs/yocto-project-qs.html" target="_top">Yocto Project Quick Start</a>@Yocto Project Quick Start@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html" target="_top">Yocto Project Development Tasks Manual</a>@Yocto Project Development Tasks Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/overview-manual/overview-manual.html" target="_top">Yocto Project Overview and Concepts Manual</a>@Yocto project Overview and Concepts Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/sdk-manual/sdk-manual.html" target="_top">Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</a>@Yocto Project Application Development and the Extensible Software Development Kit (eSDK)@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/bsp-guide/bsp-guide.html" target="_top">Yocto Project Board Support Package (BSP) Developer's Guide</a>@Yocto Project Board Support Package (BSP) Developer's Guide@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/profile-manual/profile-manual.html" target="_top">Yocto Project Profiling and Tracing Manual</a>@Yocto Project Profiling and Tracing Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/kernel-dev/kernel-dev.html" target="_top">Yocto Project Linux Kernel Development Manual</a>@Yocto Project Linux Kernel Development Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/ref-manual/ref-manual.html" target="_top">Yocto Project Reference Manual</a>@Yocto Project Reference Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/toaster-manual/toaster-manual.html" target="_top">Toaster User Manual</a>@Toaster User Manual@g
+
+# Process a single, rouge occurrence of a linked reference to the Mega-Manual.
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/mega-manual/mega-manual.html" target="_top">Yocto Project Mega-Manual</a>@Yocto Project Mega-Manual@g
+
diff --git a/poky/documentation/tools/poky-docbook-to-pdf b/poky/documentation/tools/poky-docbook-to-pdf
new file mode 100755
index 000000000..f55fd278a
--- /dev/null
+++ b/poky/documentation/tools/poky-docbook-to-pdf
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+if [ -z "$1" -o -z "$2" ]; then
+ echo "usage: [-v] $0 <docbook file> <templatedir>"
+ echo
+ echo "*NOTE* you need xsltproc, fop and nwalsh docbook stylesheets"
+ echo " installed for this to work!"
+ echo
+ exit 0
+fi
+
+FO=`echo $1 | sed s/.xml/.fo/` || exit 1
+PDF=`echo $1 | sed s/.xml/.pdf/` || exit 1
+TEMPLATEDIR=$2
+
+##
+# These URI should be rewritten by your distribution's xml catalog to
+# match your localy installed XSL stylesheets.
+XSL_BASE_URI="http://docbook.sourceforge.net/release/xsl/current"
+
+# Creates a temporary XSL stylesheet based on titlepage.xsl
+xsltproc -o /tmp/titlepage.xsl \
+ --xinclude \
+ $XSL_BASE_URI/template/titlepage.xsl \
+ $TEMPLATEDIR/titlepage.templates.xml || exit 1
+
+# Creates the file needed for FOP
+xsltproc --xinclude \
+ --stringparam hyphenate false \
+ --stringparam formal.title.placement "figure after" \
+ --stringparam ulink.show 1 \
+ --stringparam body.font.master 9 \
+ --stringparam title.font.master 11 \
+ --stringparam draft.watermark.image "$TEMPLATEDIR/draft.png" \
+ --stringparam chapter.autolabel 1 \
+ --stringparam appendix.autolabel A \
+ --stringparam section.autolabel 1 \
+ --stringparam section.label.includes.component.label 1 \
+ --output $FO \
+ $TEMPLATEDIR/poky-db-pdf.xsl \
+ $1 || exit 1
+
+# Invokes the Java version of FOP. Uses the additional configuration file common/fop-config.xml
+fop -c $TEMPLATEDIR/fop-config.xml -fo $FO -pdf $PDF || exit 1
+
+rm -f $FO
+rm -f /tmp/titlepage.xsl
+
+echo
+echo " #### Success! $PDF ready. ####"
+echo
diff --git a/poky/documentation/tools/update-documentation-conf b/poky/documentation/tools/update-documentation-conf
new file mode 100644
index 000000000..3f8d28009
--- /dev/null
+++ b/poky/documentation/tools/update-documentation-conf
@@ -0,0 +1,168 @@
+#!/usr/bin/env python
+
+# documentation.conf update script
+#
+# Author: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+import sys
+import os
+import argparse
+import re
+from lxml import etree
+import logging
+
+def logger_create(name):
+ logger = logging.getLogger(name)
+ loggerhandler = logging.StreamHandler()
+ loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+ logger.addHandler(loggerhandler)
+ logger.setLevel(logging.INFO)
+ return logger
+logger = logger_create('docconfupdater')
+
+def main():
+ parser = argparse.ArgumentParser(description="documentation.conf updater")
+ parser.add_argument('basepath', help='Path to OE-Core base directory')
+ parser.add_argument('-q', '--quiet', help='Print only warnings/errors', action='store_true')
+
+ args = parser.parse_args()
+
+ if args.quiet:
+ logger.setLevel(logging.WARN)
+
+ if not os.path.isdir(args.basepath):
+ logger.error('Specified base path %s not found')
+ return 1
+
+ doc_conf = os.path.join(args.basepath, 'meta', 'conf', 'documentation.conf')
+ if not os.path.exists(doc_conf):
+ logger.error('Unable to find %s' % doc_conf)
+ return 1
+
+ allowed_flags = ['doc']
+ flag_re = re.compile(r'\[(.+?)\]')
+
+ infos = {}
+ tree = etree.parse('ref-manual/ref-variables.xml')
+ root = tree.getroot()
+ for glossary in root.findall('glossary'):
+ for glossdiv in glossary.findall('glossdiv'):
+ for glossentry in glossdiv.findall('glossentry'):
+ info = glossentry.find('info')
+ if info is not None:
+ infoline = ' '.join(info.text.split())
+ infolinesplit = infoline.split('=', 1)
+ if len(infoline) < 2:
+ logger.warn('Invalid info line (no = character), ignoring: %s' % infoline)
+ continue
+ flags = flag_re.findall(infolinesplit[0])
+ if not flags:
+ logger.warn('Invalid info line (no varflag), ignoring: %s' % infoline)
+ continue
+ for flag in flags:
+ if flag not in allowed_flags:
+ logger.warn('Invalid info line (varflag %s not in allowed list), ignoring: %s' % (flag, infoline))
+ continue
+ infos[infolinesplit[0].rstrip()] = infolinesplit[1].lstrip()
+
+ if not infos:
+ logger.error('ERROR: Unable to find any info tags in the glossary')
+ return 1
+
+ def sortkey(key):
+ # Underscores sort undesirably, so replace them
+ return key.split('[')[0].replace('_', '-')
+
+ changed = False
+ lines = []
+ invars = False
+ lastletter = None
+ added = []
+ with open(doc_conf, 'r') as dcf:
+ for line in dcf:
+ if not invars:
+ if line.startswith('#') and 'DESCRIPTIONS FOR VARIABLES' in line:
+ invars = True
+ elif not line.startswith('#'):
+ linesplit = line.split('=', 1)
+ if len(linesplit) > 1:
+ key = linesplit[0].rstrip()
+ lastletter = key[0]
+ # Find anything in the dict that should come before the current key
+ for dkey in sorted(infos.keys()):
+ if sortkey(dkey) < sortkey(key):
+ lines.append('%s = %s\n' % (dkey, infos[dkey]))
+ added.append(dkey)
+ del infos[dkey]
+ changed = True
+ newvalue = infos.get(key, None)
+ if newvalue:
+ del infos[key]
+ if newvalue != linesplit[1].strip():
+ lines.append('%s = %s\n' % (key, newvalue))
+ changed = True
+ continue
+ elif key in added:
+ # We already added a new value for this key, so skip it
+ continue
+ elif lastletter:
+ # Ensure we write out anything anything left over for this letter
+ for dkey in sorted(infos.keys()):
+ if dkey[0] == lastletter:
+ lines.append('%s = %s\n' % (dkey, infos[dkey]))
+ del infos[dkey]
+ changed = True
+ elif dkey[0] > lastletter:
+ # List is sorted, so we're done
+ break
+ lastletter = None
+ lines.append(line)
+
+ if not invars:
+ logger.error('ERROR: Unable to find variables section in documentation.conf')
+ return 1
+
+ if infos:
+ changed = True
+ # Write out anything left over
+ lines.append('\n\n')
+ for key in sorted(infos.keys()):
+ lines.append('%s = %s\n' % (key, infos[key]))
+
+ if changed:
+ logger.info('Updating %s' % doc_conf)
+ with open(doc_conf, 'w') as dcf:
+ for line in lines:
+ dcf.write(line)
+ else:
+ logger.info('No changes required')
+
+ return 0
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc(5)
+ sys.exit(ret)
+
+
OpenPOWER on IntegriCloud