1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 08:45:04 -05:00

Fix intra-XEP links (regression from 609a081

This commit is contained in:
Jonas Wielicki 2017-08-24 14:31:17 +02:00
parent 607dc078c5
commit 238329a536
2 changed files with 24 additions and 8 deletions

View File

@ -7,8 +7,15 @@ XMLDEPS=xep.xsd xep.ent xep.dtd ref.xsl $(OUTDIR)
TEXMLDEPS=xep2texml.xsl $(OUTDIR)/xmpp.pdf $(OUTDIR)/xmpp-text.pdf TEXMLDEPS=xep2texml.xsl $(OUTDIR)/xmpp.pdf $(OUTDIR)/xmpp-text.pdf
XEPDIRS=. inbox XEPDIRS=. inbox
HTMLDEPS=xep.xsl $(CSSTARGETS) $(JSTARGETS) HTMLDEPS=xep.xsl $(CSSTARGETS) $(JSTARGETS)
CSSTARGETS=$(OUTDIR)/xmpp.css $(OUTDIR)/prettify.css
JSTARGETS=$(OUTDIR)/prettify.js base_CSSTARGETS=xmpp.css prettify.css
CSSTARGETS=$(addprefix $(OUTDIR)/,$(base_CSSTARGETS))
proto_CSSTARGETS=$(addprefix $(OUTDIR)/inbox/,$(base_CSSTARGETS))
base_JSTARGETS=prettify.js
JSTARGETS=$(addprefix $(OUTDIR)/,$(base_JSTARGETS))
proto_JSTARGETS=$(addprefix $(OUTDIR)/inbox/,$(base_JSTARGETS))
proto_HTMLDEPS=xep.xsl $(proto_CSSTARGETS) $(proto_JSTARGETS)
DO_XELATEX=cd $(OUTDIR); xelatex --interaction=nonstopmode -no-shell-escape "$(notdir $(basename $@)).tex" >/dev/null DO_XELATEX=cd $(OUTDIR); xelatex --interaction=nonstopmode -no-shell-escape "$(notdir $(basename $@)).tex" >/dev/null
@ -94,11 +101,15 @@ $(EXAMPLESDIR)/%.xml: xep-%.xml $(XMLDEPS) examples.xsl $(EXAMPLESDIR)
$(REFSDIR)/reference.XSF.XEP-%.xml: xep-%.xml $(XMLDEPS) ref.xsl $(REFSDIR) $(REFSDIR)/reference.XSF.XEP-%.xml: xep-%.xml $(XMLDEPS) ref.xsl $(REFSDIR)
xsltproc --path $(CURDIR) ref.xsl "$<" > "$@" && echo "Finished building $@" xsltproc --path $(CURDIR) ref.xsl "$<" > "$@" && echo "Finished building $@"
$(all_xep_htmls): $(OUTDIR)/%.html: %.xml $(XMLDEPS) $(HTMLDEPS) $(xep_htmls): $(OUTDIR)/xep-%.html: xep-%.xml $(XMLDEPS) $(HTMLDEPS)
# we dont put it as a dependency to avoid a rebuild due to a timestamp xmllint --nonet --noout --noent --loaddtd --valid "$<"
# change on the directory # Check for non-data URIs
mkdir -p $(OUTDIR)/inbox ! xmllint --nonet --noout --noent --loaddtd --xpath "//img/@src[not(starts-with(., 'data:'))]" $< 2>/dev/null && true
# Actually build the HTML
xsltproc --path $(CURDIR) --param htmlbase "$(if $(findstring inbox,$<),'../','./')" xep.xsl "$<" > "$@" && echo "Finished building $@"
$(proto_xep_htmls): $(OUTDIR)/inbox/%.html: inbox/%.xml $(XMLDEPS) $(proto_HTMLDEPS)
xmllint --nonet --noout --noent --loaddtd --valid "$<" xmllint --nonet --noout --noent --loaddtd --valid "$<"
# Check for non-data URIs # Check for non-data URIs
! xmllint --nonet --noout --noent --loaddtd --xpath "//img/@src[not(starts-with(., 'data:'))]" $< 2>/dev/null && true ! xmllint --nonet --noout --noent --loaddtd --xpath "//img/@src[not(starts-with(., 'data:'))]" $< 2>/dev/null && true
@ -130,7 +141,13 @@ $(JSTARGETS): $(OUTDIR)
$(CSSTARGETS): $(OUTDIR) $(CSSTARGETS): $(OUTDIR)
cp "$(notdir $@)" "$@" cp "$(notdir $@)" "$@"
$(EXAMPLESDIR) $(REFSDIR) $(OUTDIR): $(proto_JSTARGETS): $(OUTDIR)/inbox
cp "$(notdir $@)" "$@"
$(proto_CSSTARGETS): $(OUTDIR)/inbox
cp "$(notdir $@)" "$@"
$(EXAMPLESDIR) $(REFSDIR) $(OUTDIR) $(OUTDIR)/inbox:
mkdir -p "$@" mkdir -p "$@"
.PHONY: clean .PHONY: clean

View File

@ -40,7 +40,6 @@ OR OTHER DEALINGS IN THE SOFTWARE.
<html> <html>
<head> <head>
<title>XEP-<xsl:value-of select='/xep/header/number'/>:<xsl:text> </xsl:text><xsl:value-of select='/xep/header/title' /></title> <title>XEP-<xsl:value-of select='/xep/header/number'/>:<xsl:text> </xsl:text><xsl:value-of select='/xep/header/title' /></title>
<base><xsl:attribute name='href'><xsl:value-of select='$htmlbase'/></xsl:attribute></base>
<link rel='stylesheet' type='text/css' href='xmpp.css' /> <link rel='stylesheet' type='text/css' href='xmpp.css' />
<link href="prettify.css" type="text/css" rel="stylesheet" /> <link href="prettify.css" type="text/css" rel="stylesheet" />
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' /> <link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />