Skip to content

Commit 2e53f34

Browse files
committed
Docs: add showcase section with Lekis example
1 parent b2d080b commit 2e53f34

11 files changed

+117
-12
lines changed

.github/workflows/tests.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
- uses: actions/checkout@v3
3636
with:
3737
submodules: true
38+
- name: Get tag
39+
uses: olegtarasov/get-tag@v2
3840
- name: Install Python ${{ env.current_python }}
3941
uses: actions/setup-python@v4
4042
with:
@@ -294,7 +296,7 @@ jobs:
294296
with:
295297
submodules: true
296298
- name: Get tag
297-
uses: olegtarasov/get-tag@v2.1
299+
uses: olegtarasov/get-tag@v2
298300
- name: Install Python ${{ env.current_python }}
299301
uses: actions/setup-python@v4
300302
with:
@@ -305,7 +307,7 @@ jobs:
305307
- name: Get package version from Poetry
306308
run: echo "PKG_VERSION=$(poetry version --short)" >> $GITHUB_ENV
307309
- name: Check whether the tag matches the package version
308-
uses: jannekem/run-python-script-action@utilities
310+
uses: jannekem/run-python-script-action@v1
309311
with:
310312
script: |
311313
if '${{ env.GIT_TAG_NAME }}' != 'v${{ env.PKG_VERSION }}':

CHANGES.rst

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ Release History
1717
Release 0.5.5 (in development)
1818
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1919

20+
Documentation changes:
21+
22+
* A showcase section was added to the manual to show examples of documents that
23+
can be produces by rinohtype.
24+
2025
New Features:
2126

2227
* Enumerated list item labels now also respect the *number_separator* style

README.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ rinohtype
2828

2929
rinohtype is a batch-mode document processor. It renders structured documents
3030
to PDF based on a document template and a style sheet. An important design goal
31-
of rinohtype is make document layout and style customization user-friendly. See
32-
the documentation_ to learn how to customize the style of your document.
31+
of rinohtype is make document layout and style customization user-friendly. Have
32+
a look at the showcase_ to get an idea of the level of customization that is
33+
possible. See the documentation_ to learn how to customize the style of your
34+
document.
35+
36+
.. _showcase: https://www.mos6581.org/rinohtype/master/showcase.html
37+
.. _documentation: http://www.mos6581.org/rinohtype/master/
3338

3439

3540
Call for Contributions
@@ -92,7 +97,6 @@ a look at the `rinohtype manual`_ for an example of the output.
9297
There is also a commercial DITA_ frontend, but it's development is currently
9398
on hold. Please `contact me`_ if you are interested in testing it.
9499

95-
.. _documentation: http://www.mos6581.org/rinohtype/master/
96100
.. _create a ticket: https://github.com/brechtm/rinohtype/issues/new/choose
97101
.. _Google Fonts: https://fonts.google.com
98102
.. _reStructuredText: http://docutils.sourceforge.net/rst.html

doc/conf.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# serve to show the default.
1515

1616

17+
import os
1718
import time
1819

1920
try:
@@ -40,13 +41,14 @@
4041
# ones.
4142
extensions = [
4243
'sphinx.ext.autodoc',
44+
'sphinx.ext.autosummary',
4345
'sphinx.ext.coverage',
4446
'sphinx.ext.doctest',
47+
'sphinx.ext.extlinks',
48+
'sphinx.ext.githubpages',
4549
'sphinx.ext.intersphinx',
4650
'sphinx.ext.napoleon',
4751
'sphinx.ext.todo',
48-
'sphinx.ext.autosummary',
49-
'sphinx.ext.githubpages',
5052
'sphinx_immaterial',
5153
'sphinxcontrib.autoprogram',
5254
]
@@ -124,6 +126,12 @@
124126
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
125127
'sphinx': ('https://www.sphinx-doc.org/en/master', None)}
126128

129+
GIT_TAG = os.environ.get('GIT_TAG_NAME')
130+
SHOWCASE_URL = (f'http://www.mos6581.org/rinohtype/{GIT_TAG}/showcase/%s'
131+
if GIT_TAG else './showcase/%s')
132+
133+
extlinks = {'showcase': (SHOWCASE_URL, '%s')}
134+
127135
# -- Options for HTML output ----------------------------------------------
128136

129137
# The theme to use for HTML and HTML Help pages. See the documentation for

doc/intro.rst

-2
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,3 @@ database or other data sources. When parsing the document tree from a
105105
structured document format, a templating engine like Jinja2_ can be used.
106106

107107
.. _Jinja2: http://jinja.pocoo.org
108-
109-
.. todo:: sample documents

doc/manual.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
:hidden:
66

77
intro
8+
showcase
89
install
910
quickstart
1011
basicstyling

doc/rinohtype.rts

+34-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ number_format=None
227227
font_color=#4d4d4d
228228

229229
[external hyperlink]
230-
base=internal hyperlink
230+
font_color=#004d4d
231231

232232
[broken hyperlink]
233233
font_color=#ff0000
@@ -297,6 +297,39 @@ font_slant=italic
297297
base=body
298298
space_above=1pt
299299

300+
[image]
301+
space_above=10pt
302+
horizontal_align=CENTER
303+
304+
[figure]
305+
space_above=10pt
306+
space_below=12pt
307+
308+
[figure image]
309+
base=image
310+
keep_with_next=true
311+
312+
[caption : Caption]
313+
base=default
314+
font_size=9pt
315+
line_spacing=Fixed(10pt)
316+
indent_first=0pt
317+
space_above=4pt
318+
space_below=0pt
319+
text_align=CENTER
320+
label_suffix=' '
321+
322+
[figure caption]
323+
base=caption
324+
325+
[figure legend]
326+
margin_left=30pt
327+
328+
[figure legend paragraph]
329+
base=caption
330+
space_above=5pt
331+
text_align=LEFT
332+
300333
# (Sphinx) object descriptions
301334

302335
[object description]

doc/showcase.rst

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.. _showcase:
2+
3+
Showcase
4+
========
5+
6+
Some examples of PDF documents produced by rinohtype are collected here. This
7+
section mainly serves to give users an idea of the level of customization that
8+
is achievable by means of custom templates and style sheets.
9+
10+
11+
Lekis
12+
-----
13+
14+
:showcase:`Odpisy.pdf` makes use of both a custom template and style sheet. The
15+
custom template (Python) and configuration (INI file):
16+
17+
- configures Czech as the document's language, which prevents a line break
18+
after specific words (following Czech typography rules)
19+
- defines custom title (with vector logo) and colophon pages
20+
- sets a background for content pages, marking the page header
21+
- defines a custom back page, listing company contact details
22+
23+
Actually, there are two template configuration files: a base configuration and
24+
one for a special type of documents. The latter inherits from the base template
25+
configuration and only overrides what needs changing. In this case, it omits
26+
the table of contents part from the document. The PDF linked to above is an
27+
example of such a document.
28+
29+
30+
.. magick montage -density 20 "doc/showcase/Odpisy.pdf[0,2,5]" -background grey
31+
-tile x1 -border 4 -bordercolor white -geometry +0+0 doc/showcase/Odpisy.png
32+
.. figure:: showcase/Odpisy.png
33+
34+
Some pages from :showcase:`Odpisy.pdf`
35+
36+
37+
A single style sheet is used for both types of documents. It does not specify
38+
the Sphinx style sheet included with rinohtype as a base stylesheet so as to
39+
avoid unexpected changes in the document style in case the Sphinx style sheet
40+
is updated in a future rinohtype release. The style sheet defines:
41+
42+
- the ``[VARIABLES]`` section defines monospaced, serif and sans-serif
43+
typefaces and a set of key colors that are referenced in style definitions
44+
- custom 'numbering' for headings (square glyph) and bullet lists (fast forward
45+
glyph)
46+
- a top border for certain headings
47+
- custom in-line titles (in-line images or specific font glyphs) for
48+
admonitions
49+
- coloured styling for the ``menuselection`` role
50+
- small-capital styling for keyboard shortcuts

doc/showcase/Odpisy.pdf

2.82 MB
Binary file not shown.

doc/showcase/Odpisy.png

95.1 KB
Loading

noxfile.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ def build_docs(session):
5656
'sphinxcontrib-autoprogram'])
5757
session.chdir('doc')
5858
session.run('python', 'build.py', *session.posargs)
59-
for pdf in glob.glob("_build/rinoh/*.pdf"):
60-
shutil.copy(pdf, "_build/html")
59+
# copy 'showcase' directory to the HTML output directory
60+
shutil.copytree('showcase', '_build/html/showcase', dirs_exist_ok=True)
61+
# copy PDF docs to the HTML output directory
62+
for pdf in glob.glob('_build/rinoh/*.pdf'):
63+
shutil.copy(pdf, '_build/html')
64+
6165

6266

6367
@nox_poetry.session(python=PYTHONS)

0 commit comments

Comments
 (0)