forked from Mirrors/openclonk
docs: Improvements to chm generation and in-browser xslt preview
parent
55fa80fac1
commit
df635390f9
|
@ -92,10 +92,10 @@ sdk-de/%.xml: sdk/%.xml de.mo xml2po.py clonk.py
|
|||
|
||||
define run-xslt
|
||||
@echo generate $@
|
||||
@xsltproc -o $@ --param webnotes $(webnotes) --param fileext "'.html'" $(XSLTFLAGS) $(stylesheet) $<
|
||||
@xsltproc -o $@ --param chm $(chm) --param fileext "'.html'" $(XSLTFLAGS) $(stylesheet) $<
|
||||
endef
|
||||
online/%: webnotes=1
|
||||
chm/%: webnotes=0
|
||||
online/%: chm=0
|
||||
chm/%: chm=1
|
||||
online/en/sdk/%.html: sdk/%.xml $(stylesheet) ; $(run-xslt)
|
||||
online/de/sdk/%.html: sdk-de/%.xml $(stylesheet) ; $(run-xslt)
|
||||
chm/en/sdk/%.html: sdk/%.xml $(stylesheet) ; $(run-xslt)
|
||||
|
@ -118,3 +118,4 @@ chm/en/Developer.chm: chm/en/Output.hhp chm/en/Output.hhk chm/en/Output.hhc $(ad
|
|||
"$(HHC)" $<
|
||||
chm/de/Entwickler.chm: chm/de/Output.hhp chm/de/Output.hhk chm/de/Output.hhc $(addprefix chm/de/, $(sdk-dirs) images $(htmlfiles) $(extra-files-chm))
|
||||
"$(HHC)" $<
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Compatibility=1.1 or later
|
||||
Compiled file=Entwickler.chm
|
||||
Contents file=Output.hhc
|
||||
Default topic=sdk\content.html
|
||||
Default topic=sdk\index.html
|
||||
Display compile progress=No
|
||||
Full-text search=Yes
|
||||
Index file=Output.hhk
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Compatibility=1.1 or later
|
||||
Compiled file=Developer.chm
|
||||
Contents file=Output.hhc
|
||||
Default topic=sdk\content.html
|
||||
Default topic=sdk\index.html
|
||||
Display compile progress=No
|
||||
Full-text search=Yes
|
||||
Index file=Output.hhk
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<xsl:variable name="procinst" select="processing-instruction('xml-stylesheet')" />
|
||||
<xsl:param name="relpath" select="substring-after(substring-before($procinst, 'clonk.xsl'),'href="')" />
|
||||
<xsl:param name="webnotes" />
|
||||
<xsl:param name="chm" />
|
||||
<xsl:param name="fileext" select="'.xml'" />
|
||||
<xsl:template name="head">
|
||||
<head>
|
||||
|
@ -14,7 +14,7 @@
|
|||
<link rel="stylesheet">
|
||||
<xsl:attribute name="href"><xsl:value-of select="$relpath" />doku.css</xsl:attribute>
|
||||
</link>
|
||||
<xsl:if test="$webnotes">
|
||||
<xsl:if test="not($chm)">
|
||||
<link rel="stylesheet" href="http://www.openclonk.org/header/header.css" />
|
||||
</xsl:if>
|
||||
<xsl:if test="descendant::table[bitmask]">
|
||||
|
@ -47,21 +47,8 @@
|
|||
<xsl:template match="title" />
|
||||
|
||||
<xsl:template name="header">
|
||||
<xsl:if test="$webnotes">
|
||||
<!--<xsl:processing-instruction name="php">
|
||||
<xsl:choose><xsl:when test='lang("en")'>
|
||||
readfile("http://www.openclonk.org/header/header.html?p=docs");
|
||||
</xsl:when><xsl:otherwise>
|
||||
readfile("http://www.openclonk.org/header/header.html?p=docsde");
|
||||
</xsl:otherwise></xsl:choose>
|
||||
?</xsl:processing-instruction> -->
|
||||
<!-- <xsl:copy-of select='document("header.xml")/*/*' /> -->
|
||||
<xsl:apply-templates select="document('header.xml')" />
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="document('header.xml')" />
|
||||
</xsl:template>
|
||||
<!-- <xsl:template match="header//@action">
|
||||
<xsl:attribute name="action"><xsl:value-of select="concat($relpath, current())" /></xsl:attribute>
|
||||
</xsl:template>-->
|
||||
<xsl:template match="header|header//*|header//@*">
|
||||
<xsl:copy><xsl:apply-templates select="@*|node()" /></xsl:copy>
|
||||
</xsl:template>
|
||||
|
@ -76,13 +63,19 @@
|
|||
<html>
|
||||
<xsl:call-template name="head" />
|
||||
<body>
|
||||
<xsl:call-template name="header" />
|
||||
<div id="iframe"><iframe>
|
||||
<xsl:attribute name="src"><xsl:value-of select="$relpath" />sdk/content<xsl:value-of select="$fileext" /></xsl:attribute>
|
||||
</iframe></div>
|
||||
<div id="content">
|
||||
<xsl:if test="$chm">
|
||||
<xsl:attribute name="id">chm</xsl:attribute>
|
||||
<xsl:apply-templates />
|
||||
</div>
|
||||
</xsl:if>
|
||||
<xsl:if test="not($chm)">
|
||||
<xsl:call-template name="header" />
|
||||
<div id="iframe"><iframe>
|
||||
<xsl:attribute name="src"><xsl:value-of select="$relpath" />sdk/content<xsl:value-of select="$fileext" /></xsl:attribute>
|
||||
</iframe></div>
|
||||
<div id="content">
|
||||
<xsl:apply-templates />
|
||||
</div>
|
||||
</xsl:if>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
|
|
@ -4,9 +4,6 @@ body {
|
|||
font-family: Verdana, Arial, 'Trebuchet MS';
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: small;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
@ -32,6 +29,16 @@ body {
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#chm {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 0 1em;
|
||||
margin: 0 auto;
|
||||
position: absolute; top: 145px; left: 300px; right: 0; bottom: 0; overflow: auto;
|
||||
}
|
||||
|
||||
.text, pre.code, ul, ol, dl {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
|
@ -43,15 +50,6 @@ div.fnsyntax {
|
|||
margin-left: 1em;
|
||||
}
|
||||
|
||||
#toc {
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 0 1em;
|
||||
margin: 0 auto;
|
||||
position: absolute; top: 145px; left: 300px; right: 0; bottom: 0; overflow: auto;
|
||||
}
|
||||
|
||||
div.example {
|
||||
margin-top: 12px;
|
||||
margin-bottom: 36px;
|
||||
|
@ -66,7 +64,7 @@ dd {
|
|||
margin-right: 6px;
|
||||
}
|
||||
|
||||
img#cpem {
|
||||
img.cpem {
|
||||
float: left;
|
||||
margin: 12px;
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@ and needs at least some of the whitespace added with xsl:text below, and perhaps
|
|||
<LI><xsl:text> </xsl:text><OBJECT type="text/sitemap"><xsl:text>
|
||||
</xsl:text>
|
||||
<param name="Name">
|
||||
<xsl:attribute name="value"><xsl:for-each select="text()|a/text()"><xsl:value-of select="normalize-space(string(.))" /></xsl:for-each></xsl:attribute>
|
||||
<xsl:attribute name="value"><xsl:for-each select="text()|emlink/text()"><xsl:value-of select="normalize-space(string(.))" /></xsl:for-each></xsl:attribute>
|
||||
</param><xsl:text>
|
||||
</xsl:text>
|
||||
<xsl:if test="a/@href"><param name="Local">
|
||||
<xsl:attribute name="value">sdk\<xsl:value-of select="translate(string(a/@href), '/', '\\')" /></xsl:attribute>
|
||||
<xsl:if test="emlink/@href"><param name="Local">
|
||||
<xsl:attribute name="value">sdk\<xsl:value-of select="translate(string(emlink/@href), '/', '\\')" /></xsl:attribute>
|
||||
</param><xsl:text>
|
||||
</xsl:text></xsl:if>
|
||||
</OBJECT>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<title>OpenClonk Documentation</title>
|
||||
<h>OpenClonk Documentation</h>
|
||||
<part>
|
||||
<img src="../images/cpem.gif" width="52" height="52" alt=""/>
|
||||
<img src="../images/cpem.gif" width="52" height="52" alt="" class="cpem" />
|
||||
<text>Welcome to the developer documentation for the creation of custom game content. This documentation includes a thorough reference of the game data and its file hierarchy. <br/>
|
||||
Also included is a script reference which explains the syntax and semantics of Clonk's own scripting language - C4Script. In the script reference, all functions, constants and callbacks that are available for the scripter are documented with example usages.
|
||||
</text>
|
||||
|
|
Loading…
Reference in New Issue