Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  [erl_docgen] Updated the vsn.mk
  [erl_docgen] Add db_eix.xsl to the Makefile
  [safs] Add pdfname to the html target for the users guide
  [erl_docgen] Add possibility to specify pdf filename
  Updated system/doc/Makefile with the new xsltproc options.
  A possibility to configure erl_docgen so it can generate documentation for other products than Erlang/OTP.
  • Loading branch information
lthor committed Nov 19, 2012
2 parents 22e6663 + c344975 commit 2cec24c
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 24 deletions.
3 changes: 2 additions & 1 deletion lib/erl_docgen/priv/xsl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ XSL_FILES = \
db_pdf_params.xsl \
db_html.xsl \
db_html_params.xsl \
db_man.xsl
db_man.xsl \
db_eix.xsl


# ----------------------------------------------------
Expand Down
36 changes: 32 additions & 4 deletions lib/erl_docgen/priv/xsl/db_html.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,22 @@
<xsl:param name="curModule"/>
<html>
<head>
<link rel="stylesheet" href="{$topdocdir}/otp_doc.css" type="text/css"/>
<title>Erlang -- <xsl:value-of select="header/title"/></title>
<xsl:choose>
<xsl:when test="string-length($stylesheet) > 0">
<link rel="stylesheet" href="{$topdocdir}/{$stylesheet}" type="text/css"/>
</xsl:when>
<xsl:otherwise>
<link rel="stylesheet" href="{$topdocdir}/otp_doc.css" type="text/css"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length($winprefix) > 0">
<title><xsl:value-of select="$winprefix"/> -- <xsl:value-of select="header/title"/></title>
</xsl:when>
<xsl:otherwise>
<title>Erlang -- <xsl:value-of select="header/title"/></title>
</xsl:otherwise>
</xsl:choose>
</head>
<body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000">

Expand Down Expand Up @@ -719,7 +733,14 @@


<xsl:template name="menu_top">
<img alt="Erlang logo" src="{$topdocdir}/erlang-logo.png"/>
<xsl:choose>
<xsl:when test="string-length($logo) > 0">
<img alt="Erlang logo" src="{$topdocdir}/{$logo}"/>
</xsl:when>
<xsl:otherwise>
<img alt="Erlang logo" src="{$topdocdir}/erlang-logo.png"/>
</xsl:otherwise>
</xsl:choose>
<br/>
<small>
<xsl:if test="boolean(/book/parts/part)">
Expand All @@ -731,7 +752,14 @@
<xsl:if test="boolean(/book/releasenotes)">
<a href="release_notes.html">Release Notes</a><br/>
</xsl:if>
<a href="{$pdfdir}/{$appname}-{$appver}.pdf">PDF</a><br/>
<xsl:choose>
<xsl:when test="string-length($pdfname) > 0">
<a href="{$pdfdir}/{$pdfname}.pdf">PDF</a><br/>
</xsl:when>
<xsl:otherwise>
<a href="{$pdfdir}/{$appname}-{$appver}.pdf">PDF</a><br/>
</xsl:otherwise>
</xsl:choose>
<a href="{$topdocdir}/index.html">Top</a>
</small>
</xsl:template>
Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/priv/xsl/db_pdf.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@

<fo:flow flow-name="xsl-region-body">
<fo:block xsl:use-attribute-sets="cover.logo">
<fo:external-graphic src="{$docgen}/priv/images/erlang-logo.gif"/>
<fo:external-graphic src="{$logo}"/>
</fo:block>
<fo:block xsl:use-attribute-sets="cover.title" id="cover-page">
<xsl:apply-templates/>
Expand Down
8 changes: 4 additions & 4 deletions lib/erl_docgen/priv/xsl/db_pdf_params.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<xsl:attribute-set name="cover.title">
<xsl:attribute name="border-before-style">solid</xsl:attribute>
<xsl:attribute name="border-before-width">10pt</xsl:attribute>
<xsl:attribute name="border-color">#960003</xsl:attribute>
<xsl:attribute name="border-color"><xsl:value-of select="$pdfcolor"/></xsl:attribute>
<xsl:attribute name="font-size">2.3em</xsl:attribute>
<xsl:attribute name="padding-before">0.5em</xsl:attribute>
<xsl:attribute name="text-align">end</xsl:attribute>
Expand All @@ -101,7 +101,7 @@
<xsl:attribute-set name="cover.inner.copyright">
<xsl:attribute name="border-before-style">solid</xsl:attribute>
<xsl:attribute name="border-before-width">1pt</xsl:attribute>
<xsl:attribute name="border-color">#960003</xsl:attribute>
<xsl:attribute name="border-color"><xsl:value-of select="$pdfcolor"/></xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="padding-before">0.5em</xsl:attribute>
<xsl:attribute name="space-before">200mm</xsl:attribute>
Expand Down Expand Up @@ -160,7 +160,7 @@
<xsl:attribute-set name="h1">
<xsl:attribute name="border-after-style">solid</xsl:attribute>
<xsl:attribute name="border-after-width">1pt</xsl:attribute>
<xsl:attribute name="border-color">#960003</xsl:attribute>
<xsl:attribute name="border-color"><xsl:value-of select="$pdfcolor"/></xsl:attribute>
<xsl:attribute name="break-before">page</xsl:attribute>
<xsl:attribute name="font-family">sans-serif</xsl:attribute>
<xsl:attribute name="font-size">1.83em</xsl:attribute>
Expand Down Expand Up @@ -226,7 +226,7 @@
<xsl:attribute-set name="page-header">
<xsl:attribute name="border-after-style">solid</xsl:attribute>
<xsl:attribute name="border-after-width">2pt</xsl:attribute>
<xsl:attribute name="border-color">#960003</xsl:attribute>
<xsl:attribute name="border-color"><xsl:value-of select="$pdfcolor"/></xsl:attribute>
<xsl:attribute name="font-family">sans-serif</xsl:attribute>
<xsl:attribute name="font-size">0.9em</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
Expand Down
2 changes: 1 addition & 1 deletion lib/erl_docgen/vsn.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ERL_DOCGEN_VSN = 0.3.2
ERL_DOCGEN_VSN = 0.3.3

18 changes: 16 additions & 2 deletions make/otp.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,22 @@ TEXDIR = .

SPECDIR = $(DOCDIR)/specs

ifeq ($(CSS_FILE),)
CSS_FILE = otp_doc.css
endif
ifeq ($(WINPREFIX),)
WINPREFIX = Erlang
endif
ifeq ($(HTMLLOGO),)
HTMLLOGO_FILE = erlang-logo.png
endif
ifeq ($(PDFLOGO),)
PDFLOGO_FILE = $(DOCGEN)/priv/images/erlang-logo.gif
endif
ifeq ($(PDFCOLOR),)
PDFCOLOR = \#960003
endif

# HTML & GIF files that always are generated and must be delivered
SGML_COLL_FILES = $(SGML_APPLICATION_FILES) $(SGML_PART_FILES)
XML_COLL_FILES = $(XML_APPLICATION_FILES) $(XML_PART_FILES)
Expand Down Expand Up @@ -250,12 +266,10 @@ $(MAN1DIR)/%.1: %.xml
date=`date +"%B %e %Y"`; \
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<


$(MAN2DIR)/%.2: %.xml
date=`date +"%B %e %Y"`; \
xsltproc --output "$@" --stringparam company "Ericsson AB" --stringparam docgen "$(DOCGEN)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude -path $(DOCGEN)/priv/dtd -path $(DOCGEN)/priv/dtd_man_entities $(DOCGEN)/priv/xsl/db_man.xsl $<


ifneq ($(wildcard $(SPECDIR)),)
$(MAN3DIR)/%.3: %.xml $(SPECDIR)/specs_%.xml
date=`date +"%B %e %Y"`; \
Expand Down
34 changes: 29 additions & 5 deletions make/otp_release_targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,34 @@ $(HTMLDIR)/index.html: $(XML_FILES) $(SPECS_FILES)
--stringparam gendate "$$date" \
--stringparam appname "$(APPLICATION)" \
--stringparam appver "$(VSN)" \
--stringparam stylesheet "$(CSS_FILE)" \
--stringparam winprefix "$(WINPREFIX)" \
--stringparam logo "$(HTMLLOGO_FILE)" \
--stringparam pdfname "$(PDFNAME)" \
-path $(DOCGEN)/priv/dtd \
-path $(DOCGEN)/priv/dtd_html_entities \
$(DOCGEN)/priv/xsl/db_html.xsl book.xml

endif

$(HTMLDIR)/users_guide.html: $(XML_FILES)
date=`date +"%B %e %Y"`; \
$(XSLTPROC) --noout --stringparam outdir $(HTMLDIR) --stringparam docgen "$(DOCGEN)" --stringparam topdocdir "$(TOPDOCDIR)" \
$(XSLTPROC) --noout \
--stringparam outdir $(HTMLDIR) \
--stringparam docgen "$(DOCGEN)" \
--stringparam topdocdir "$(TOPDOCDIR)" \
--stringparam pdfdir "$(PDFDIR)" \
--stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude \
-path $(DOCGEN)/priv/dtd -path $(DOCGEN)/priv/dtd_html_entities $(DOCGEN)/priv/xsl/db_html.xsl book.xml
--stringparam gendate "$$date" \
--stringparam appname "$(APPLICATION)" \
--stringparam appver "$(VSN)" \
--stringparam stylesheet "$(CSS_FILE)" \
--stringparam winprefix "$(WINPREFIX)" \
--stringparam logo "$(HTMLLOGO_FILE)" \
--stringparam pdfname "$(PDFNAME)" \
--xinclude \
-path $(DOCGEN)/priv/dtd \
-path $(DOCGEN)/priv/dtd_html_entities \
$(DOCGEN)/priv/xsl/db_html.xsl book.xml

%.fo: $(XML_FILES) $(SPECS_FILES)
date=`date +"%B %e %Y"`; \
Expand All @@ -61,6 +78,8 @@ $(HTMLDIR)/users_guide.html: $(XML_FILES)
--stringparam gendate "$$date" \
--stringparam appname "$(APPLICATION)" \
--stringparam appver "$(VSN)" \
--stringparam logo "$(PDFLOGO_FILE)" \
--stringparam pdfcolor "$(PDFCOLOR)" \
--xinclude $(TOP_SPECS_PARAM) \
-path $(DOCGEN)/priv/dtd \
-path $(DOCGEN)/priv/dtd_html_entities \
Expand All @@ -77,8 +96,13 @@ ifneq ($(XML_FILES),)
$(HTMLDIR)/$(APPLICATION).eix: $(XML_FILES) $(SPECS_FILES)
date=`date +"%B %e %Y"`; \
$(XSLTPROC) --stringparam docgen "$(DOCGEN)" \
--stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" --stringparam appver "$(VSN)" --xinclude $(TOP_SPECS_PARAM) \
-path $(DOCGEN)/priv/dtd -path $(DOCGEN)/priv/dtd_html_entities $(DOCGEN)/priv/xsl/db_eix.xsl book.xml > $@
--stringparam gendate "$$date" \
--stringparam appname "$(APPLICATION)" \
--stringparam appver "$(VSN)" \
-xinclude $(TOP_SPECS_PARAM) \
-path $(DOCGEN)/priv/dtd \
-path $(DOCGEN)/priv/dtd_html_entities \
$(DOCGEN)/priv/xsl/db_eix.xsl book.xml > $@

docs: $(HTMLDIR)/$(APPLICATION).eix

Expand Down
29 changes: 23 additions & 6 deletions system/doc/top/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,34 @@ $(MAN_INDEX): $(MAN_INDEX_SCRIPT)

$(HTMLDIR)/highlights.html: highlights.xml
date=`date +"%B %e %Y"`; \
$(XSLTPROC) --output $(@) --stringparam docgen "$(DOCGEN)" --stringparam topdocdir "$(TOPDOCDIR)" \
--stringparam pdfdir "$(PDFREFDIR)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" \
--stringparam appver "$(VSN)" -path $(DOCGEN)/priv/dtd -path $(DOCGEN)/priv/dtd_html_entities \
$(XSLTPROC) --output $(@) \
--stringparam docgen "$(DOCGEN)" \
--stringparam topdocdir "$(TOPDOCDIR)" \
--stringparam pdfdir "$(PDFREFDIR)" \
--stringparam gendate "$$date" \
--stringparam appname "$(APPLICATION)" \
--stringparam appver "$(VSN)" \
--stringparam stylesheet "$(CSS_FILE)" \
--stringparam winprefix "$(WINPREFIX)" \
--stringparam logo "$(HTMLLOGO_FILE)" \
-path $(DOCGEN)/priv/dtd \
-path $(DOCGEN)/priv/dtd_html_entities \
$(DOCGEN)/priv/xsl/db_html.xsl $<


$(HTMLDIR)/incompatible.html: incompatible.xml
date=`date +"%B %e %Y"`; \
$(XSLTPROC) --output $(@) --stringparam docgen "$(DOCGEN)" --stringparam topdocdir "$(TOPDOCDIR)" \
--stringparam pdfdir "$(PDFREFDIR)" --stringparam gendate "$$date" --stringparam appname "$(APPLICATION)" \
--stringparam appver "$(VSN)" -path $(DOCGEN)/priv/dtd -path $(DOCGEN)/priv/dtd_html_entities \
$(XSLTPROC) --output $(@) --stringparam docgen "$(DOCGEN)" \
--stringparam topdocdir "$(TOPDOCDIR)" \
--stringparam pdfdir "$(PDFREFDIR)" \
--stringparam gendate "$$date" \
--stringparam appname "$(APPLICATION)" \
--stringparam appver "$(VSN)" \
--stringparam stylesheet "$(CSS_FILE)" \
--stringparam winprefix "$(WINPREFIX)" \
--stringparam logo "$(HTMLLOGO_FILE)" \
-path $(DOCGEN)/priv/dtd \
-path $(DOCGEN)/priv/dtd_html_entities \
$(DOCGEN)/priv/xsl/db_html.xsl $<

#--------------------------------------------------------------------------
Expand Down

0 comments on commit 2cec24c

Please sign in to comment.