merge_doc.xsl: move from libosmocore.git
Allow building manuals without the libosmocore source. Related: OS#3385 Change-Id: Ifb81b18422987cdf36b75993d2782abf93b5f48c
This commit is contained in:
parent
10ffc82237
commit
161365fa6f
6
Makefile
6
Makefile
|
@ -1,5 +1,3 @@
|
||||||
LIBOSMO_DIR ?= ~/source/gsm/libosmocore
|
|
||||||
|
|
||||||
all: check-deps
|
all: check-deps
|
||||||
cd OsmoBTS; $(MAKE)
|
cd OsmoBTS; $(MAKE)
|
||||||
cd OsmoNITB; $(MAKE)
|
cd OsmoNITB; $(MAKE)
|
||||||
|
@ -80,9 +78,6 @@ endef
|
||||||
define check_dep_python2_module
|
define check_dep_python2_module
|
||||||
@echo "import $(1)" | python2 - >/dev/null 2>&1 || { echo >&2 "Failed to import '$(1)' module, please install $(2)."; exit 1; }
|
@echo "import $(1)" | python2 - >/dev/null 2>&1 || { echo >&2 "Failed to import '$(1)' module, please install $(2)."; exit 1; }
|
||||||
endef
|
endef
|
||||||
define check_dep_dir
|
|
||||||
@test -d $(1) || { echo >&2 "Directory '$(1)' not found, please set $(2) to the path of your libosmocom source tree: make LIBOSMO_DIR=/path/to/libosmocore"; exit 1; }
|
|
||||||
endef
|
|
||||||
|
|
||||||
check-deps:
|
check-deps:
|
||||||
$(call check_dep_bin,mscgen,mscgen)
|
$(call check_dep_bin,mscgen,mscgen)
|
||||||
|
@ -95,4 +90,3 @@ check-deps:
|
||||||
$(call check_dep_bin,dot,graphviz)
|
$(call check_dep_bin,dot,graphviz)
|
||||||
$(call check_dep_bin,python2,python2)
|
$(call check_dep_bin,python2,python2)
|
||||||
$(call check_dep_python2_module,pychart,python2-pychart)
|
$(call check_dep_python2_module,pychart,python2-pychart)
|
||||||
$(call check_dep_dir,$(LIBOSMO_DIR),LIBOSMO_DIR)
|
|
||||||
|
|
|
@ -25,8 +25,7 @@ DOCBOOKS = $(VTY_REFERENCE)
|
||||||
DOCBOOKS_DEPS = generated/docbook_vty.xml
|
DOCBOOKS_DEPS = generated/docbook_vty.xml
|
||||||
include $(TOPDIR)/build/Makefile.docbook.inc
|
include $(TOPDIR)/build/Makefile.docbook.inc
|
||||||
|
|
||||||
LIBOSMO_DIR ?= ~/source/gsm/libosmocore
|
MERGE_DOC = $(shell realpath $(TOPDIR)/merge_doc.xsl)
|
||||||
MERGE_DOC = $(shell realpath $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl)
|
|
||||||
|
|
||||||
CLEAN_FILES += generated
|
CLEAN_FILES += generated
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
|
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:vty="urn:osmocom:xml:libosmocore:vty:doc:1.0">
|
||||||
|
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
|
||||||
|
|
||||||
|
|
||||||
|
<xsl:template match="@*|node()">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@*|node()" />
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Copy the name of the node -->
|
||||||
|
<xsl:template match="vty:node">
|
||||||
|
<xsl:variable name="info" select="document($with)/vty:vtydoc/vty:node[@id=current()/@id]/." />
|
||||||
|
<xsl:if test="not($info/vty:hide)">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@*|node()" />
|
||||||
|
<xsl:for-each select="$info/*">
|
||||||
|
<xsl:copy-of select="." />
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Copy command and add nodes -->
|
||||||
|
<xsl:template match="vty:command">
|
||||||
|
<xsl:variable name="info" select="document($with)/vty:vtydoc/vty:node[@id=current()/../@id]/vty:command[@id=current()/@id]/." />
|
||||||
|
<xsl:variable name="info_generic" select="document($with)/vty:vtydoc/vty:common/vty:command[@id=current()/@id]/." />
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@*|node()" />
|
||||||
|
|
||||||
|
<!-- Copy the specific issue... -->
|
||||||
|
<xsl:for-each select="$info/*">
|
||||||
|
<xsl:copy-of select="." />
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
|
<xsl:if test="not($info)">
|
||||||
|
<xsl:for-each select="$info_generic/*">
|
||||||
|
<xsl:copy-of select="." />
|
||||||
|
</xsl:for-each>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:transform>
|
||||||
|
|
Loading…
Reference in New Issue