Replacements¶
This page
Attention
As of today 2023-08-26 19:46, use this DRC to render this page:
docker pull ghcr.io/t3docs/render-documentation:develop
docker tag ghcr.io/t3docs/render-documentation:develop t3docs/render-documentation:develop
eval "$(docker run --rm t3docs/render-documentation:develop show-shell-commands)"
dockrun_t3rd makehtml-no-cache
Available replacements¶
Overview¶
Meaning |
Used by theme |
Markup |
Importance |
Name |
Prefix |
---|---|---|---|---|---|
Audience |
|
desired |
|
|
|
Author |
|
expected |
|
|
|
Contact |
yes |
|
optional |
|
|
Copyright |
yes |
|
expected |
|
|
Description |
|
recommended |
|
|
|
Discussions |
yes |
|
optional |
|
|
Doctype |
|
desired |
|
|
|
Home |
yes |
|
optional |
|
|
Issues |
yes |
|
optional |
|
|
Language (any text) |
|
optional |
|
|
|
Language (letter code) |
yes |
|
required if not |
|
|
License |
|
desired |
|
|
|
Maintainer |
|
optional |
|
|
|
Project |
yes |
|
required |
|
|
Release |
|
is alias |
|
|
|
Release |
yes |
|
required |
|
|
Rendered |
|
is read only |
|
||
Repository |
yes |
|
optional |
|
|
Version |
|
is alias |
|
|
|
Version |
yes |
|
required |
|
|
Website |
|
optional |
|
|
If present, the following settings are used to create an "Edit" button.
Name |
Markup |
Example |
---|---|---|
edit_button_type |
|
github |
repo_file_edit_url |
|
https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test/edit/master |
Meaning of prefixes¶
- std_¶
- Spoken as
standard
- Section in Settings.cfg
[general]
- Assignment in conf.py
name = "text"
- Provider
built in, comes with Sphinx
- hto_¶
- Spoken as
html_theme_options
- Section in Settings.cfg
[html_theme_options]
- Assignment in conf.py
html_theme_options["name"] = "text"
- Provider
built in, comes with Sphinx
- dt3m_¶
- Spoken as
docs typo 3 meta
- Section in Settings.cfg
[docstypo3-meta]
- Assignment in conf.py
docstypo3["meta"]["name"] = "text"
- Provider
extension sphinxcontrib-docstypo3
Optional postfixes¶
You may append a postfix to the replacement key to specify through which function the replacement text should go.
- _json¶
'json' means that the replacement text should be valid json code.
- _r¶
'r' signals that you want a 'representation' of the text, not just the text itself. A represention is a string that can be evaluated (by Python) and results in the original string.
- _linked¶
Urls and email addresses in the replacement will become a link.
Forms:
url
text-a url text-b
linktext (url) text-b
The parentheses and the url will not be shown, instead the preceeding text is linked.
text-a [linktext](url) text-b
Result is: text-a, no brackets, linktext is linked to url, no parentheses, no url, text-b
All forms can be mixed and added.
Example output of 'Description':
- |dt3m_description|
This project demonstrates how [reStructuredText markup](https://docutils.sourceforge.io/rst.html) looks like when rendered with the [sphinx_typo3_theme](https://github.com/TYPO3-Documentation/sphinx_typo3_theme). The focus is on technical aspects and behaviour. It is used for theme testing. Everything in here "should work". NOTE: This project DOES NOT show TYPO3 best practices. The purpose is (a) to demonstrate what the theme can handle and (b) to serve as a test for the theme.
- |dt3m_description_r|
'This project\ndemonstrates how [reStructuredText markup](https://docutils.sourceforge.io/rst.html)\nlooks like when rendered with the\n[sphinx_typo3_theme](https://github.com/TYPO3-Documentation/sphinx_typo3_theme).\nThe focus is on technical aspects and behaviour. It is used for theme\ntesting. Everything in here "should work".\n\nNOTE: This project DOES NOT show TYPO3 best practices. The purpose is\n(a) to demonstrate what the theme can handle and\n(b) to serve as a test for the theme.'
- |dt3m_description_json|
"This project\ndemonstrates how [reStructuredText markup](https://docutils.sourceforge.io/rst.html)\nlooks like when rendered with the\n[sphinx_typo3_theme](https://github.com/TYPO3-Documentation/sphinx_typo3_theme).\nThe focus is on technical aspects and behaviour. It is used for theme\ntesting. Everything in here \"should work\".\n\nNOTE: This project DOES NOT show TYPO3 best practices. The purpose is\n(a) to demonstrate what the theme can handle and\n(b) to serve as a test for the theme."
- |dt3m_description_linked|
This project demonstrates how reStructuredText markup looks like when rendered with the sphinx_typo3_theme. The focus is on technical aspects and behaviour. It is used for theme testing. Everything in here "should work". NOTE: This project DOES NOT show TYPO3 best practices. The purpose is (a) to demonstrate what the theme can handle and (b) to serve as a test for the theme.
Postfix example¶
Consider this definition:
# in Settings.cfg
[docstypo3-meta]
description =
Some explicite description
follow up line 2
follow up line 3
project_home = https://docs.typo3.org/
The replacement text goes to one of three function, depending on what postfix you use:
Markup |
Function |
Replacement |
|
---|---|---|---|
|
str |
→ |
Some explicite description follow up line 2 follow up line 3 |
|
repr |
→ |
'\nSome explicite description\nfollow up line 2\nfollow up line 3' |
|
json.dumps |
→ |
"\nSome explicite description\nfollow up line 2\nfollow up line 3" |
|
str |
→ |
https :// docs .typo3 .org/ (think of this as if there were no blanks) |
|
special |
→ |
Demo usage¶
As field table¶
Source¶
..
:Audience: |dt3m_audience|
:Author: |std_author|
:Contact: |hto_project_contact|
:Copyright: |std_copyright|
:Description: |dt3m_description|
:Discussions: |hto_project_discussions|
:Doctype: |dt3m_doctype|
:Home: |hto_project_home|
:Issues: |hto_project_issues|
:Language 1: |std_language|
:Language 2: |dt3m_language|
:License: |dt3m_license|
:Maintainer: |dt3m_maintainer|
:Project: |std_project|
:Release alias: |std_release|
:Release: |release|
:Rendered: |today|
:Repository: |hto_project_repository|
:Version alias: |std_version|
:Version: |version|
:Website: |dt3m_website|
Rendering result¶
- Audience
Developers and editors of TYPO3 documentation
- Author
TYPO3 Documentation Team
- Contact
https://typo3.org/community/teams/documentation
- Copyright
2020, TYPO3 Documentation Team
- Description
This project demonstrates how [reStructuredText markup](https://docutils.sourceforge.io/rst.html) looks like when rendered with the [sphinx_typo3_theme](https://github.com/TYPO3-Documentation/sphinx_typo3_theme). The focus is on technical aspects and behaviour. It is used for theme testing. Everything in here "should work". NOTE: This project DOES NOT show TYPO3 best practices. The purpose is (a) to demonstrate what the theme can handle and (b) to serve as a test for the theme.
- Discussions
https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test/discussions
- Doctype
Technical rendering test example
- Home
https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test
- Issues
https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test/issues
- Language 1
en
- Language 2
English (us)
- License
CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
- Maintainer
Martin Bless <martin.bless@mbless.de>
- Project
Sphinx TYPO3 Theme Rendering Test
- Release alias
main
- Release
main
- Rendered
2023-08-26 19:46
- Repository
https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test
- Version alias
main
- Version
main
- Website
Read online (https://typo3-documentation.github.io/sphinx_typo3_theme_rendering_test/)
Recreate Settings.cfg¶
Source¶
..
.. parsed-literal::
[general]
author = |std_author|
copyright = |std_copyright|
language = |std_language_json|
project = |std_project|
release = |std_release|
version = |std_version|
[docstypo3-meta]
audience = |dt3m_audience|
description = |dt3m_description_json|
doctype = |dt3m_doctype|
language = |dt3m_language|
license = |dt3m_license|
maintainer = |dt3m_maintainer|
website = |dt3m_website|
[html-theme-options]
project_contact = |hto_project_contact|
project_discussions = |hto_project_discussions|
project_home = |hto_project_home|
project_issues = |hto_project_issues|
project_repository = |hto_project_repository|
Rendering result¶
[general] author = TYPO3 Documentation Team copyright = 2020, TYPO3 Documentation Team language = "en" project = "Sphinx TYPO3 Theme Rendering Test" release = "main" version = "main" [docstypo3-meta] audience = "Developers and editors of TYPO3 documentation" description = "This project\ndemonstrates how [reStructuredText markup](https://docutils.sourceforge.io/rst.html)\nlooks like when rendered with the\n[sphinx_typo3_theme](https://github.com/TYPO3-Documentation/sphinx_typo3_theme).\nThe focus is on technical aspects and behaviour. It is used for theme\ntesting. Everything in here \"should work\".\n\nNOTE: This project DOES NOT show TYPO3 best practices. The purpose is\n(a) to demonstrate what the theme can handle and\n(b) to serve as a test for the theme." doctype = "Technical rendering test example" language = "English (us)" license = "CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)" maintainer = "Martin Bless <martin.bless@mbless.de>" website = "Read online (https://typo3-documentation.github.io/sphinx_typo3_theme_rendering_test/)" [html-theme-options] project_contact = "https://typo3.org/community/teams/documentation" project_discussions = "https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test/discussions" project_home = "https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test" project_issues = "https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test/issues" project_repository = "https://github.com/TYPO3-Documentation/sphinx_typo3_theme_rendering_test"
About the settings¶
Missing values will show up as empty string.
Choose only one of the example lines if multiple are given here for explanatory purposes.
Audience¶
What audience is this documentation for?
- audience¶
- Name
audience
- Prefix
dt3m_
- Section
[docstypo3-meta]
- Notation
|dt3m_audience|
- Importance
optional
- Value
any text
Example
Settings.cfg
:[docstypo3-meta] audience = Developers (and everybody interested)
Example
conf.py
:docstypo3["meta"]["audience"] = "developers (and everybody interested)"
Example source:
.. This book is written for |dt3m_audience|.
Example result:
This book is written for developers (and everybody interested).
Author¶
List names and emails of authors.
- author¶
- Name
author
- Prefix
std_
- Section
[general]
- Notation
|std_author|
- Importance
required
- Value
any text
- Recommended
John Doe <john.doe@example.org>
- Sphinx docs
Example
Settings.cfg
:[general] author = Ernest Hemingway <ernest@example.org>
Example
conf.py
:author = "Ernest Hemingway <ernest@example.org>"
Example source:
.. The author of those short stories was |std_author|.
Example result:
The author of those short stories was Ernest Hemingway <ernest@example.org>.
Contact¶
How to contact the authors. Leave empty or provide just the url or email address.
- project_contact¶
- Name
project_contact
- Prefix
hto_
- Section
[html-theme-options]
- Value
Leave empty or provide an url like
https://example.org/contact
orcontact@example.org
- Notation
|hto_project_contact|
- Used by
sphinx_typo3_theme
Example
Settings.cfg
:[html-theme-options] project_contact = http://example.org/contact
Example
conf.py
:html_theme_options["project_contact"] = "http://example.org/contact"
Example source:
.. If you want to get in contact visit |hto_project_contact|.
Example result:
If you want to get in contact visit http://example.org/contact.
Copyright¶
((describe))
- copyright¶
- Name
copyright
- Prefix
std_
- Section
[general]
- Notation
|std_copyright|
- Importance
required
- Sphinx docs
- Used by
sphinx_typo3_theme
Example
Settings.cfg
:[general] copyright = 2021, TYPO3 Documentation Team
Example
conf.py
:copyright = "2021, TYPO3 Documentation Team"
Example source:
.. This material is copyrighted: |std_copyright|.
Example result:
This material is copyrighted: 2021, TYPO3 Documentation Team.
Description¶
((describe,
The theme does not used the value in web pages. However, it goes into pdf, epub, man, ... ))
- description¶
- Name
description
- Prefix
dt3m_
- Section
[docstypo3-meta]
- Notation
|dt3m_description|
- Importance
optional
- Value
Any text. Preferably some sentences suited for the cover of a book.
Example
Settings.cfg
:[docstypo3-meta] description = This project contains examples of documentation code in reStructuredText format. The purpose is to demonstrate what the sphinx_typo3_theme can handle and to test the theme.
Example
conf.py
:docstypo3["meta"]["description"] = ( "This project contains" " examples of documentation code in reStructuredText format. The purpose" " is to demonstrate what the sphinx_typo3_theme can handle and to test" " the theme." )
Example source:
.. Abstract: |dt3m_description|
Example result:
Abstract:
"This project\ndemonstrates how [reStructuredText markup](https://docutils.sourceforge.io/rst.html)\nlooks like when rendered with the\n[sphinx_typo3_theme](https://github.com/TYPO3-Documentation/sphinx_typo3_theme).\nThe focus is on technical aspects and behaviour. It is used for theme\ntesting. Everything in here \"should work\".\n\nNOTE: This project DOES NOT show TYPO3 best practices. The purpose is\n(a) to demonstrate what the theme can handle and\n(b) to serve as a test for the theme."
Discussions¶
Leave empty or provide just the url for discussions.
- project_discussions¶
- Name
project_discussions
- Prefix
hto_
- Section
[html-theme-options]
- Notation
|hto_project_discussions|
- Importance
optional
- Value
empty or url
- Used by
sphinx_typo3_theme
Example
Settings.cfg
:[html-theme-options] project_discussions = https://example.org/discussions/
Example
conf.py
:html_theme_options["project_discussions"] = "https://example.org/discussions/"
Example source:
.. Join the discussions at |hto_project_discussions|.
Example result:
Join the discussions at https://example.org/discussions/.
Documentation type¶
What kind of documentation is it? ((Tutorial? Reference?, Example? ...))
- doctype¶
- Name
doctype
- Prefix
dt3m_
- Section
[docstypo3-meta]
- Notation
|dt3m_doctype|
- Importance
recommended
- Value
any text
Example
Settings.cfg
:[docstypo3-meta] doctype = Tutorial
Example
conf.py
:docstypo3["meta"]["doctype"] = "Tutorial"
Example source:
.. This text is meant as "|dt3m_doctype|".
Example result:
This text is meant as "Tutorial".
Home¶
Leave empty or provide an url to the source project.
- project_home¶
- Name
project_home
- Prefix
hto_
- Section
[html-theme-options]
- Notation
|hto_project_home|
- Importance
optional
- Value
empty or url
- Used by
sphinx_typo3_theme
Example
Settings.cfg
:[html-theme-options] project_home = https://example.org/
Example
conf.py
:html_theme_options["project_home"] = "https://example.org/"
Example source:
.. Visit the project in the internet at |hto_project_home|.
Example result:
Visit the project in the internet at https://example.org/.
Issues¶
Leave empty or provide just the url of "Issues".
- project_issues¶
- Name
project_issues
- Prefix
hto_
- Section
[html-theme-options]
- Notation
|hto_project_issues|
- Importance
optional
- Value
empty or url
- Used by
sphinx_typo3_theme
Example
Settings.cfg
:[html-theme-options] project_issues = https://github.com/example/test/issues/
Example
conf.py
:html_theme_options["project_issues"] = "https://github.com/example/test/issues/"
Example source:
.. Report bugs at |hto_project_issues|.
Example result:
Report bugs at https://github.com/example/test/issues/.
Language (std_language)¶
Default is 'en'. Provide one of the prescribed values that Sphinx recognizes to specify the language of the documentation.
- std_language¶
- Name
language
- Prefix
std_
- Section
[general]
- Notation
|std_language|
- Default
empty, which means 'en'
- Importance
optional
- Value
Must be one of the predefined Sphinx keys like`de` or
en
.- Sphinx docs
- Used by
Sphinx translation mechanism
Sphinx will translate text constants accordingly, like "previous" (en) or "zurück" (de).
Language (dt3m_language)¶
To specify the language in a human readable form, that is, as word or sentence.
- dt3m_language¶
- Name
language
- Prefix
dt3m_
- Section
[docstypo3-meta]
- Notation
|dt3m_language|
- Importance
optional
- Value
any text
Example:
[docstypo3-meta] language = English (US)
License¶
The name and url of the license for the documentation.
- license¶
- Name
license
- Prefix
dt3m_
- Section
[docstypo3-meta]
- Notation
|dt3m_license|
- Importance
optional
- Value
any text
- Used by
((sphinx_typo3_theme, planned for footer))
Example
Settings.cfg
:[docstypo3-meta] license = CC-BY 4.0 [https://creativecommons.org/licenses/by/4.0/]
Example
conf.py
:docstypo3["meta"]["license"] = "CC"
Example source:
.. Respect this license: |dt3m_license|. Respect this license: |dt3m_license_linked|.
Example result:
Respect this license: CC-BY 4.0 [https://creativecommons.org/licenses/by/4.0/].
Respect this license: CC-BY 4.0.
Maintainer¶
Who is the maintainer of the documentation?
- maintainer¶
- Name
maintainer
- Prefix
dt3m_
- Section
[docstypo3-meta]
- Notation
|dt3m_maintainer|
- Importance
optional
- Value
any text
Example
Settings.cfg
:[docstypo3-meta] maintainer = Jon Doe <john.doe@example.org>
Example
conf.py
:docstypo3["meta"]["maintainer"] = "Jon Doe <john.doe@example.org>"
Example source:
.. In case of doubt ask the maintainer: |dt3m_maintainer|.
Example result:
In case of doubt ask the maintainer: Jon Doe <john.doe@example.org>.
Project¶
Short and concise name of the project that the documentation describes.
- project¶
- Name
project
- Prefix
std_
- Section
[general]
- Notation
|std_project|
- Importance
required
- Value
Any string. Provide the most short and concise name.
- Sphinx docs
- Used by
sphinx_typo3_theme
Examples:
[general] project = extkey project = News project = adminpanel project = Core changelog
Repository¶
URL to create a link "Repository" or "Source".
- project_repository¶
- Name
project_repository
- Prefix
hto_
- Section
[html-theme-options]
- Notation
|hto_project_repository|
- Importance
optional
- Value
empty or url
- Used by
sphinx_typo3_theme
Example
Settings.cfg
:[html-theme-options] project_repository = https://github.com/example/test/
Example
conf.py
:html_theme_options["project_repository"] = "https://github.com/example/test/"
Example source:
.. Get the source from |hto_project_repository|.
Example result:
Get the source from https://github.com/example/test/.
Release¶
((describe))
- release¶
- Name
release
- Prefix
std_
- Section
[general]
- Notation
|std_release|
- Importance
required
- Value
Strict form would be a full semver like
1.2.3
. We are more liberal and usually use the branch name.- Remark
Use the same value for
release
andversion
if there is no difference.- Sphinx docs
- Used by
sphinx_typo3_theme
Example:
[general] release = 1.2.3 release = v1.2.dev3 release = main release = develop
Version¶
((describe))
- version¶
- Name
version
- Prefix
std_
- Section
[general]
- Notation
|std_version|
- Importance
required
- Value
Strict form would be a part of semver like
1.2
. We are more liberal and usually use the branch name.- Remark
Use the same value for
release
andversion
if there is no difference.- Sphinx docs
- Used by
sphinx_typo3_theme
Example:
[general] version = 1.2 version = v1.2 version = main version = develop
About "Edit button" settings¶
For DRC (Docker Rendering Container) >= v3.0.dev21
edit_button_type¶
This is a theme variable, that, in the end, controls whether the "Edit on …" button is to be shown and whether it targets a Bitbucket, GitHub or GitLab like hosting.
Works together with repo_file_edit_url
.
- edit_button_type¶
- Name
edit_button_type
- Prefix
hto_
- Section
[html_theme_options]
- Notation
|hto_edit_button_type|
- Required
No, since it comes with 'auto' as default value.
- Default
auto
- Value
Pick one of: auto | bitbucket | github | gitlab | none
- Used by
sphinx_typo3_theme
Example 1:
[html_theme_options] # Never show the edit button edit_button_type = none
Example 2:
[html_theme_options] # Try to guess the type, looking for # '//bitbucket', '//github' or '//gitlab' in the url. # This is the default. edit_button_type = auto
Example 3:
[html_theme_options] # Do not guess the type. Always show "Edit on GitLab". edit_button_type = gitlab
repo_file_edit_url¶
This is the real theme variable representing the leading, constant part of the
url that is used to edit files on Bitbucket, GitHub or GitLab.
Usually you don't set this value yourself but specify repository_url
and repository_branch
.
However, if you DO specify a value, it will always take effect and no further
calculation takes place.
Works together with edit_button_type
.
- repo_file_edit_url¶
- Name
repo_file_edit_url
- Prefix
hto_
- Section
[html_theme_options]
- Notation
|hto_repo_file_edit_url|
- Required
No, because usually it is calculated internally and derived from
repository_url
andrepository_branch
.- Default
"" (empty string)
- Used by
sphinx_typo3_theme
Example 1:
[html_theme_options] # Show 'Edit on Bitbucket' button, use custom url edit_button_type = bitbucket repo_file_edit_url = https://bitbucket.com/USER/REPOSITORY/src/BRANCH
Example 2:
[html_theme_options] # Show 'Edit on GitHub' button, use custom url edit_button_type = github repo_file_edit_url = https://github.com/USER/REPOSITORY/edit/BRANCH
Example 3:
[html_theme_options] # Show edit on GitLab button, use custom url edit_button_type = gitlab repo_file_edit_url = https://gitlab.com/USER/REPOSITORY/-/edit/BRANCH
repository_url¶
This setting works together with repository_branch
. If both are
given the "Edit on …" button will be shown, unless you explicitely turned the
button off by setting edit_button_type
to "none".
repository_url
and repository_branch
are not real theme
variables. They are only used to calculate the real theme variables
edit_button_type
and repo_file_edit_url
and they are
dropped afterwards. This is why they aren't available for replacements.
- repository_url¶
- Name
repository_url
- Prefix
-
- Section
[html_theme_options]
- Notation
-
- Required
yes, together with
repository_branch
, if the Edit button is to be shown- Default
"" (empty string)
- Used for
internal calculation
Example 1:
[html_theme_options] # Turn on the 'Edit on Bitbucket' button repository_url = https://bitbucket.org/USER/REPOSITORY repository_branch = main
Example 2:
[html_theme_options] # Turn on the 'Edit on GitHub' button repository_url = https://github.com/USER/REPOSITORY repository_branch = main
Example 3:
[html_theme_options] # Turn on the 'Edit on GitLab' button repository_url = https://gitlab.com/USER/REPOSITORY repository_branch = main
repository_branch¶
This setting works together with repository_repository
. If both are
given the "Edit on …" button will be shown, unless you explicitely turned the
button off by setting edit_button_type
to "none".
- repository_branch¶
- Name
repository_branch
- Prefix
-
- Section
[html_theme_options]
- Notation
-
- Required
yes, together with
repository_url
, if the Edit button is to be shown- Default
"" (empty string)
- Used for
internal calculation
github_branch (deprecated)¶
Is used as value for repository_branch
, if that value is otherwise
empty.
- github_branch (deprecated)¶
- Name
github_branch
- Prefix
-
- Section
[html_theme_options]
- Notation
-
- Required
no, deprecated, use
repository_branch
instead- Default
"" (empty string)
- Used for
internal calculation
github_repository (deprecated)¶
Is used as value https://github.com/[github_repository]
for
repository_url
, if that value is otherwise empty.
- github_repository (deprecated)¶
- Name
github_repository
- Prefix
-
- Section
[html_theme_options]
- Notation
-
- Required
no, deprecated, use
repository_url
instead- Default
"" (empty string)
- Value
user/repository
- Used for
internal calculation
Example:
[html_theme_options] # Deprecated form - remove these two lines github_repository = USER/REPOSITORY github_branch = main # Correct form - use these two lines instead repository_url = https://gitlab.com/USER/REPOSITORY repository_branch = main