Skip to content

Commit

Permalink
Merge pull request #1408 from lucaswerkmeister/texinfo
Browse files Browse the repository at this point in the history
Add Texinfo support
  • Loading branch information
quintesse committed Aug 21, 2015
2 parents 8c42ffb + cb6f9bb commit e349c39
Show file tree
Hide file tree
Showing 8 changed files with 496 additions and 0 deletions.
56 changes: 56 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<property name="db.style.fopdf" value="fopdf.xsl"/>
<property name="db.style.html" value="html_chunk.xsl"/>
<property name="db.style.htmlsingle" value="html.xsl"/>
<property name="db.style.info" value="texinfo.xsl"/>

<!-- Local repository -->
<property name="ceylon.repo.dir" location="${user.home}/.ceylon/repo"/>
Expand All @@ -57,6 +58,11 @@
<property name="ceylon.module-resolver.jar" value="${ceylon.module-resolver.dir}/com.redhat.ceylon.module-resolver-${module.com.redhat.ceylon.module-resolver.version}.jar"/>
<property name="ceylon.module-resolver.lib" location="${ceylon.repo.dir}/${ceylon.module-resolver.jar}"/>


<condition property="hasInfo">
<os family="unix"/>
</condition>


<!-- Classpath for the build tools. -->
<path id="lib.classpath">
Expand Down Expand Up @@ -104,6 +110,17 @@

</target>

<target name="info"
depends="clean.doc"
description="Compile Texinfo documentation for all languages.">

<!-- TRANSLATOR: Duplicate this line for your language -->
<antcall target="lang.docinfo">
<param name="lang" value="en"/>
</antcall>

</target>

<target name="revdiff"
description="Generates a diff report for all translated versions.">

Expand Down Expand Up @@ -135,6 +152,7 @@
<antcall target="lang.dochtml"/>
<antcall target="lang.dochtmlsingle"/>
<antcall target="lang.htmlmisc"/>
<antcall target="lang.docinfo"/>
</target>


Expand Down Expand Up @@ -295,6 +313,44 @@

</target>

<target name="lang.docinfo.texi">

<mkdir dir="${build.dir}/${lang}/info/"/>

<java classname="com.icl.saxon.StyleSheet" fork="true" dir="${basedir}" maxmemory="192m">
<classpath refid="lib.classpath"/>
<arg value="-o"/>
<arg value="${build.dir}/${lang}/info/ceylon-spec.texi"/>
<arg value="${basedir}/${lang}/master.xml"/>
<arg value="${basedir}/${lang}/styles/${db.style.info}"/>
</java>

</target>

<target name="lang.docinfo.make" if="hasInfo">

<exec executable="makeinfo" dir="${build.dir}/${lang}/info/">
<arg value="ceylon-spec.texi"/>
</exec>

</target>

<target name="lang.docinfo"
depends="lang.docinfo.texi,lang.docinfo.make"
description="Generates the Texinfo documentation only for a language (set lang)"/>

<target name="lang.docinfo.install"
depends="lang.docinfo"
if="hasInfo">

<exec executable="sudo" dir="${build.dir}/${lang}/info/">
<arg value="sh"/>
<arg value="-c"/>
<arg value="install --owner=root --group=root --mode=0644 ceylon-spec.info* /usr/share/info &amp;&amp; install-info --info-dir=/usr/share/info /usr/share/info/ceylon-spec.info"/>
</exec>

</target>

<target name="lang.revdiff"
description="Reports difference between English and translation (set lang)">

Expand Down
48 changes: 48 additions & 0 deletions support/docbook-xsl/texinfo/block.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="exsl"
version='1.0'>

<xsl:template match="para">
<xsl:apply-templates/>
<xsl:text> <!-- explicit blank line -->

</xsl:text>
</xsl:template>

<xsl:template match="itemizedlist">
@itemize @bullet
<xsl:apply-templates/>
@end itemize
</xsl:template>

<xsl:template match="listitem">
@item <xsl:apply-templates/>
</xsl:template>

<xsl:template match="comment">
@smallindentedblock
<xsl:apply-templates/>
@end smallindentedblock
</xsl:template>

<xsl:template match="programlisting">
@example
<xsl:apply-templates/>
@end example
</xsl:template>

<xsl:template match="screen">
@quotation
<xsl:apply-templates/>
@end quotation
</xsl:template>

<xsl:template match="synopsis">
@verbatim
<xsl:value-of select="."/>
@end verbatim
</xsl:template>

</xsl:stylesheet>
30 changes: 30 additions & 0 deletions support/docbook-xsl/texinfo/docbook.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version='1.0'?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="exsl"
version='1.0'>

<xsl:output method="text"
encoding="ISO-8859-1"
indent="no"/>

<xsl:include href="../VERSION"/>
<xsl:include href="param.xsl"/>
<xsl:include href="empty.xsl"/>
<xsl:include href="text.xsl"/>
<xsl:include href="inline.xsl"/>
<xsl:include href="block.xsl"/>
<xsl:include href="structure.xsl"/>
<xsl:include href="../lib/lib.xsl"/>
<xsl:include href="../common/l10n.xsl"/>
<xsl:include href="../common/common.xsl"/>
<xsl:include href="../common/titles.xsl"/>

<xsl:param name="stylesheet.result.type" select="'texinfo'"/>

<xsl:key name="id" match="*" use="@id"/>

<xsl:template match="/"><xsl:apply-templates/></xsl:template>

</xsl:stylesheet>
11 changes: 11 additions & 0 deletions support/docbook-xsl/texinfo/empty.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="exsl"
version='1.0'>

<xsl:template match="bookinfo"/>
<xsl:template match="title"/>
<xsl:template match="toc"/>

</xsl:stylesheet>
12 changes: 12 additions & 0 deletions support/docbook-xsl/texinfo/inline.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="exsl"
version='1.0'>

<xsl:template match="literal">@code{<xsl:apply-templates/>}</xsl:template>
<xsl:template match="emphasis">@emph{<xsl:value-of select="."/>}</xsl:template>
<xsl:template match="xref">@ref{<xsl:value-of select="@linkend"/>, ,<xsl:value-of select="key('id',@linkend)[1]/title"/>}</xsl:template>
<xsl:template match="filename">@file{<xsl:value-of select="."/>}</xsl:template>

</xsl:stylesheet>
40 changes: 40 additions & 0 deletions support/docbook-xsl/texinfo/param.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This file contains a bunch of params and templates that we don't care about, but the runtime needs. -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:src="http://nwalsh.com/xmlns/litprog/fragment" exclude-result-prefixes="src" version="1.0">

<xsl:template name="is.graphic.format"><xsl:param name="format"/>0</xsl:template>
<xsl:template name="is.graphic.extension"><xsl:param name="format"/>0</xsl:template>
<xsl:template name="write.chunk"/>
<xsl:template name="href.target"/>
<xsl:template name="xref.xreflabel"/>

<xsl:param name="appendix.autolabel" select="1"/>
<xsl:param name="author.othername.in.middle" select="1"/>
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="collect.xref.targets" select="'no'"/>
<xsl:param name="formal.procedures" select="1"/>
<xsl:param name="graphic.default.extension"/>
<xsl:param name="l10n.gentext.default.language" select="'en'"/>
<xsl:param name="l10n.gentext.language" select="''"/>
<xsl:param name="l10n.gentext.use.xref.language" select="0"/>
<xsl:param name="olink.base.uri" select="''"/>
<xsl:param name="part.autolabel" select="1"/>
<xsl:param name="preface.autolabel" select="0"/>
<xsl:param name="preferred.mediaobject.role"/>
<xsl:param name="punct.honorific" select="'.'"/>
<xsl:param name="qanda.defaultlabel">number</xsl:param>
<xsl:param name="qanda.inherit.numeration" select="1"/>
<xsl:param name="qandadiv.autolabel" select="1"/>
<xsl:param name="section.autolabel" select="0"/>
<xsl:param name="section.label.includes.component.label" select="0"/>
<xsl:param name="targets.filename" select="'target.db'"/>
<xsl:param name="tex.math.in.alt" select="''"/>
<xsl:param name="use.role.for.mediaobject" select="1"/>
<xsl:param name="use.svg" select="1"/>
<xsl:param name="xref.with.number.and.title" select="1"/>
<xsl:param name="xref.label-title.separator">: </xsl:param>
<xsl:param name="xref.label-page.separator"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="xref.title-page.separator"><xsl:text> </xsl:text></xsl:param>
<xsl:param name="insert.xref.page.number">no</xsl:param>
</xsl:stylesheet>
Loading

0 comments on commit e349c39

Please sign in to comment.