Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rolling with Speedata Publisher #1

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ NPX ?= npx
PAGEDJS ?= $(NPX) pagedjs-cli
SED ?= sed
SILE ?= sile
SPEEDATA ?= sp
TERA ?= tera
TOMLQ ?= tomlq
TYPST ?= typst
Expand All @@ -27,6 +28,8 @@ PAGEDJS_ARGS = -i $< -o $@

SILE_ARGS = -o $@ $<

SPEEDATA_ARGS = --dummy --layout $< --jobname $*-speedata

TYPST_ARGS = compile $< $@

WEASYPRINT_ARGS = $< $@
Expand Down Expand Up @@ -70,6 +73,9 @@ node_modules:
%-sile.pdf %-sile.toml: %/sile.xml
$(call make_manifest,$(SILE) $(SILE_ARGS))

%-speedata.pdf %-speedata.toml: %/speedata.xml
$(call make_manifest,$(SPEEDATA) $(SPEEDATA_ARGS))

%-typst.pdf %-typst.toml: %/typst.typ
$(call make_manifest,$(TYPST) $(TYPST_ARGS))

Expand Down
2 changes: 1 addition & 1 deletion content/hello-world.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
title = "Hello World!"
description = "Your most basic greeting."
extra.typesetters = [ "sile", "typst", "xelatex", "pagedjs", "weasyprint" ]
extra.typesetters = [ "sile", "typst", "xelatex", "pagedjs", "weasyprint", "speedata" ]
+++

Just the simplest way to get a phrase onto a numbered page.
30 changes: 30 additions & 0 deletions data/hello-world/speedata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Layout
xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">

<Pagetype name="page" test="true()">
<AtPageShipout>
<PlaceObject column="1" row="{sd:number-of-rows() - 1}">
<Table stretch="max">
<Tr>
<Td align="center">
<Paragraph>
<Value select="sd:current-page()"/>
</Paragraph>
</Td>
</Tr>
</Table>
</PlaceObject>
</AtPageShipout>
</Pagetype>

<Record element="data">
<PlaceObject>
<Textblock>
<Paragraph>
<Value>Hello World</Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record>
</Layout>
2 changes: 1 addition & 1 deletion templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h3 class="title is-3">{{ typesetter }}</h3>
</p>

<h4 class="title is-4">Input document</h4>
{% set source = load_data(path=manifest.src) %}
{% set source = load_data(path=manifest.src, format="plain") %}
<pre>{{ source }}</pre>

<h4 class="title is-4">Render command</h4>
Expand Down
Loading