Skip to content

mkdocs (Dokumentationsseite)

Die Dokumentation der Engine Pi ist mit MkDocs und dem Theme Material realisiert. Sie verwendet Tutorials und Bilder aus dem Engine Alpha Wiki, die unter der Creative Commons „Namensnennung, Weitergabe unter gleichen Bedingungen“ Lizenz stehen.

Makros:

Das MkDocs-Plugin Mkdocs-Macros ermöglicht den Einsatz von Makros. Die Makros sind in der Datei docs/macros.py definiert. Folgende Makros können verwendet werden:

Java spezifisch

{{ package('pi', 'Haupt-Paket') }}

Haupt-Paket


{{ class('pi.Controller', 'Spiel') }}

Spiel

{{ method('pi.actor.Actor', 'color(java.awt.Color)', 'color()') }}

color()


{{ attribute('pi.Controller', 'colors', 'statisches Attribute colors') }}

statisches Attribute colors


demo(relpath, hash?, lines?)

{{ demo('docs/dev/design/SimpleGeometricActorsDemo') }}

Zum Java-Code: demos/docs/dev/design/SimpleGeometricActorsDemo.java

{{ demo('docs/dev/design/SimpleGeometricActorsDemo', 'd9e92a3759dce13923528f62a1afa8328be5126e', 'L38-L42') }}

Zum Java-Code: demos/docs/dev/design/SimpleGeometricActorsDemo.java


{{ code('docs/main_classes/actor/hello_world/HelloWorldVersion2.java', 25) }}
Ohne Argumente

Ohne Argumente wird die komplette Java-Datei eingebunden.

{{ code('docs/HelloWorldVersion.java') }}

/*
 * Source: https://github.com/engine-alpha/tutorials/blob/master/src/eatutorials//.java
 *
 * Engine Alpha ist eine anfängerorientierte 2D-Gaming Engine.
 *
 * Copyright (c) 2011 - 2024 Michael Andonie and contributors.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package demos.docs.main_classes.actor.hello_world;

// Go to file:///data/school/repos/inf/java/engine-pi/docs/manual/main-classes/actor/text.md

import pi.Controller;
import pi.Scene;
import pi.Circle;
import pi.Rectangle;
import pi.Text;

public class HelloWorldVersion2 extends Scene
{
    public HelloWorldVersion2()
    {
        Text helloworld = new Text("Hello, World!");
        helloworld.height(2);
        helloworld.center(0, 1);
        add(helloworld);
        helloworld.color("black");
        // Ein grünes Rechteck als Hintergrund
        Rectangle background = new Rectangle(12, 3);
        background.color("green");
        background.center(0, 1);
        background.layerPosition(-1);
        // Ein blauer Kreis
        Circle circle = new Circle(8);
        circle.color("blue");
        circle.center(0, 1);
        circle.layerPosition(-2);
        add(background, circle);
        camera().meter(20);
    }

    public static void main(String[] args)
    {
        Controller.instantMode(false);
        Controller.start(new HelloWorldVersion2(), 400, 300);
    }
}
Zum Java-Code: demos/subprojects/demos/src/main/java/demos/docs/main_classes/actor/hello_world/HelloWorldVersion2.java

from_import=true

Ist das Argument from_import auf wahr gesetzt, so wird der Quelltext ab dem ersten import-Statement angezeigt.

{{ code('docs/HelloWorldVersion.java', from_import=true) }}

import pi.Controller;
import pi.Scene;
import pi.Circle;
import pi.Rectangle;
import pi.Text;

public class HelloWorldVersion2 extends Scene
{
    public HelloWorldVersion2()
    {
        Text helloworld = new Text("Hello, World!");
        helloworld.height(2);
        helloworld.center(0, 1);
        add(helloworld);
        helloworld.color("black");
        // Ein grünes Rechteck als Hintergrund
        Rectangle background = new Rectangle(12, 3);
        background.color("green");
        background.center(0, 1);
        background.layerPosition(-1);
        // Ein blauer Kreis
        Circle circle = new Circle(8);
        circle.color("blue");
        circle.center(0, 1);
        circle.layerPosition(-2);
        add(background, circle);
        camera().meter(20);
    }

    public static void main(String[] args)
    {
        Controller.instantMode(false);
        Controller.start(new HelloWorldVersion2(), 400, 300);
    }
}
Zum Java-Code: demos/subprojects/demos/src/main/java/demos/docs/main_classes/actor/hello_world/HelloWorldVersion2.java


link=false

Das Argument link steuert, ob eine Link zum Github-Repository angehängt werden soll.

{{ code('docs/HelloWorldVersion.java', link=false) }}
        Controller.start(new HelloWorldVersion2(), 400, 300);

line(relpath, line)

{{ line('docs/main_classes/actor/hello_world/HelloWorldVersion1.java', 42) }}
        Controller.start(new HelloWorldVersion1(), 400, 300);

assets (Mediendaten)

image(relpath, caption?)

{{ image('logo/logo.svg', 'Das Logo der Engine Pi') }}

Das Logo der Engine Pi


video(relpath, caption?)

{{ video('docs/MainAnimation.mp4', 'Die Hauptanimation der Engine Pi. <br>Sie erscheint, wenn <code>Controller.start()</code> ohne Szene ausgeführt wird.') }}

Die Hauptanimation der Engine Pi.
Sie erscheint, wenn Controller.start() ohne Szene ausgeführt wird.


Projekt spezifisch

contribute()

{{ contribute() }}

Warning

Diese Hilfeseite hat leider noch keinen Inhalt. Hilf mit und fülle diese Seite mit Inhalt.


{{ repo_link('docs/macros.py') }}

docs/macros.py

drawio(basename)

{{ drawio('main-classes') }}


Vom Macros-Plugin bereit gestellt.

Macros Plugin Environment

General List

All available variables and filters within the macros plugin:

Variable Type Content
extra dict version = '0.44.0', generator = False, social = [{'icon': 'fontawesome/brands/github', 'link': 'https://github.com/engine-pi/engine-pi'}, {'icon': 'simple/forgejo', 'link': 'https://inf.pirckheimer-gymnasium.de/engine-pi/engine-pi'}, {'icon': 'fontawesome/brands/java', 'link': 'https://engine-pi.github.io/javadocs/pi/package-summary.html'}, {'icon': 'fontawesome/solid/paper-plane', 'link': 'mailto:josef.friedrich@pirckheimer-gymnasium.de'}]
config MkDocsConfig {'config_file_path': '/home/runner/work/engine-pi/engine-pi/mkdocs.yml', 'site_name': 'Engine Pi', 'nav': [{'Handbuch': ['index.md', {'Hauptklassen': ['manual/main-classes/index.md', {'Controller (Steuerung)': ['manual/main-classes/controller/index.md', 'manual/main-classes/controller/coordinate-system.md', 'manual/main-classes/controller/instant-mode.md', 'manual/main-classes/controller/game-loop.md', 'manual/main-classes/controller/dialog.md']}, 'manual/main-classes/scene.md', 'manual/main-classes/camera.md', 'manual/main-classes/layer.md', {'Actor (Figur)': ['manual/main-classes/actor/index.md', 'manual/main-classes/actor/animation.md', 'manual/main-classes/actor/circle.md', 'manual/main-classes/actor/counter.md', 'manual/main-classes/actor/grid.md', 'manual/main-classes/actor/image-font.md', 'manual/main-classes/actor/image.md', 'manual/main-classes/actor/line.md', 'manual/main-classes/actor/polygon.md', 'manual/main-classes/actor/rectangle.md', 'manual/main-classes/actor/square.md', 'manual/main-classes/actor/star.md', 'manual/main-classes/actor/stateful-animation.md', 'manual/main-classes/actor/stop-watch.md', 'manual/main-classes/actor/text-block.md', 'manual/main-classes/actor/text.md', 'manual/main-classes/actor/tile-map.md', 'manual/main-classes/actor/triangle.md', 'manual/main-classes/actor/turtle.md']}]}, {'events (Ereignissteuerung)': ['manual/events/index.md', 'manual/events/key-event.md', 'manual/events/key-stroke.md', 'manual/events/mouse-click.md', 'manual/events/collision.md', 'manual/events/repeat.md', 'manual/events/shortcuts.md']}, {'physics (Physiksimulation)': ['manual/physics/index.md', 'manual/physics/body-type.md', 'manual/physics/gravity.md', 'manual/physics/density.md', 'manual/physics/restitution.md', 'manual/physics/impulse.md', 'manual/physics/joints.md']}, {'Ressourcenverwaltung': ['manual/resources/index.md', 'manual/resources/colors.md', 'manual/resources/fonts.md', 'manual/resources/images.md', 'manual/resources/sounds.md', 'manual/resources/config.md']}, {'Java': ['manual/java/index.md', 'manual/java/packages.md']}, {'Entwicklung': ['manual/dev/index.md', 'manual/dev/monorepo.md', 'manual/dev/design.md', 'manual/dev/coding-style.md', 'manual/dev/javadoc.md', 'manual/dev/mkdocs.md', 'manual/dev/setter-getter.md', 'manual/dev/versions.md', 'manual/dev/tests.md', 'manual/dev/go-to-file.md', 'manual/dev/screen-recording.md', 'manual/dev/logging.md', 'manual/dev/vibe-coding.md']}]}, {'API (javadocs)': 'https://engine-pi.github.io/javadocs/pi/package-summary.html'}, 'download.md'], 'pages': None, 'exclude_docs': None, 'draft_docs': None, 'not_in_nav': None, 'site_url': 'https://engine-pi.github.io/engine-pi/', 'site_description': None, 'site_author': None, 'theme': Theme(name='material', dirs=['/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/site-packages/material/templates', '/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/site-packages/mkdocs/templates'], static_templates={'sitemap.xml', '404.html'}, name='material', locale=Locale('en'), language='en', direction=None, features=['navigation.indexes', 'navigation.footer', 'content.code.copy', 'content.code.select', 'content.action.edit'], font={'text': 'Cantarell', 'code': 'Ubuntu Mono'}, icon=None, favicon='assets/images/favicon.png', logo='_assets/logo.svg'), 'docs_dir': '/home/runner/work/engine-pi/engine-pi/docs', 'site_dir': '/home/runner/work/engine-pi/engine-pi/site', 'copyright': 'Copyright © 2024 - 2026 Josef Friedrich', 'google_analytics': None, 'dev_addr': _IpAddressValue(host='127.0.0.1', port=8000), 'use_directory_urls': True, 'repo_url': 'https://github.com/engine-pi/engine-pi', 'repo_name': 'Engine Pi', 'edit_uri_template': None, 'edit_uri': 'edit/main/docs/', 'extra_css': ['_assets/extra.css'], 'extra_javascript': ['_assets/mathjax.js', 'https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js'], 'extra_templates': [], 'markdown_extensions': ['toc', 'tables', 'fenced_code', 'pymdownx.highlight', 'pymdownx.inlinehilite', 'pymdownx.snippets', 'pymdownx.superfences', 'footnotes', 'pymdownx.magiclink', 'attr_list', 'md_in_html', 'pymdownx.blocks.caption', 'admonition', 'pymdownx.details', 'pymdownx.emoji', 'pymdownx.arithmatex'], 'mdx_configs': {'pymdownx.highlight': {'anchor_linenums': True, 'line_spans': '__span', 'pygments_lang_class': True}, 'pymdownx.emoji': {'emoji_index': , 'emoji_generator': }, 'pymdownx.arithmatex': {'generic': True}}, 'strict': True, 'remote_branch': 'gh-pages', 'remote_name': 'origin', 'extra': {'version': '0.44.0', 'generator': False, 'social': [{'icon': 'fontawesome/brands/github', 'link': 'https://github.com/engine-pi/engine-pi'}, {'icon': 'simple/forgejo', 'link': 'https://inf.pirckheimer-gymnasium.de/engine-pi/engine-pi'}, {'icon': 'fontawesome/brands/java', 'link': 'https://engine-pi.github.io/javadocs/pi/package-summary.html'}, {'icon': 'fontawesome/solid/paper-plane', 'link': 'mailto:josef.friedrich@pirckheimer-gymnasium.de'}]}, 'plugins': {'macros': , 'drawio': }, 'hooks': {}, 'watch': ['/home/runner/work/engine-pi/engine-pi/docs'], 'validation': {'nav': {'omitted_files': 20, 'not_found': 30, 'absolute_links': 20}, 'links': {'not_found': 30, 'absolute_links': 20, 'unrecognized_links': 20, 'anchors': 20}}}
environment dict system = 'Linux', system_version = '6.17.0-1008-azure', python_version = '3.14.3', mkdocs_version = '1.6.1', macros_plugin_version = '1.5.0', jinja2_version = '3.1.6'
plugin LegacyConfig {'module_name': 'docs/macros', 'modules': [], 'render_by_default': True, 'force_render_paths': '', 'include_dir': '', 'include_yaml': [], 'j2_block_start_string': '', 'j2_block_end_string': '', 'j2_variable_start_string': '', 'j2_variable_end_string': '', 'j2_comment_start_string': '', 'j2_comment_end_string': '', 'j2_extensions': [], 'on_undefined': 'keep', 'on_error_fail': False, 'verbose': False}
git dict status = True, date [datetime], short_commit = '8f6f1a9', commit = '8f6f1a934dd509845705e6fd003a253fe6150799', tag = '', short_tag = '', author = 'Josef Friedrich', author_email = 'josef@friedrich.rocks', committer = 'Josef Friedrich', committer_email = 'josef@friedrich.rocks', date_ISO = 'Thu Apr 2 17:02:39 2026 +0200', message = 'Add center line and sound to the game pong', raw = 'commit 8f6f1a934dd509845705e6fd003a253fe6150799\nAuthor: Josef Friedrich \nDate: Thu Apr 2 17:02:39 2026 +0200\n\n Add center line and sound to the game pong', root_dir = '/home/runner/work/engine-pi/engine-pi'
version str '0.44.0'
generator bool False
social SuperList [{'icon': 'fontawesome/brands/github', 'link': 'https://github.com/engine-pi/engine-pi'}, {'icon': 'simple/forgejo', 'link': 'https://inf.pirckheimer-gymnasium.de/engine-pi/engine-pi'}, {'icon': 'fontawesome/brands/java', 'link': 'https://engine-pi.github.io/javadocs/pi/package-summary.html'}, {'icon': 'fontawesome/solid/paper-plane', 'link': 'mailto:josef.friedrich@pirckheimer-gymnasium.de'}]
macros SuperDict context [function], macros_info [function], now [function], fix_url [function], class [function], java_class [function], package [function], method [function], methods [function], attribute [function], demo [function], image [function], video [function], contribute [function], repo_link [function], code [function], line [function], drawio [function]
filters dict pretty [function], relative_url [function]
filters_builtin dict abs [builtin_function_or_method], attr [function], batch [function], capitalize [function], center [function], count [builtin_function_or_method], d [function], default [function], dictsort [function], e [function], escape [function], filesizeformat [function], first [function], float [function], forceescape [function], format [function], groupby [function], indent [function], int [function], join [function], last [function], length [builtin_function_or_method], list [function], lower [function], items [function], map [function], min [function], max [function], pprint [function], random [function], reject [function], rejectattr [function], replace [function], reverse [function], round [function], safe [function], select [function], selectattr [function], slice [function], sort [function], string [function], striptags [function], sum [function], title [function], trim [function], truncate [function], unique [function], upper [function], urlencode [function], urlize [function], wordcount [function], wordwrap [function], xmlattr [function], tojson [function]
navigation Navigation
files Files
page Page Page(title='`mkdocs` (Dokumentationsseite)', url='/engine-pi/manual/dev/mkdocs/')

Config Information

Standard MkDocs configuration information. Do not try to modify.

e.g. {{ config.docs_dir }}

See also the MkDocs documentation on the config object.

Variable Type Content
config_file_path str '/home/runner/work/engine-pi/engine-pi/mkdocs.yml'
site_name str 'Engine Pi'
nav list [{'Handbuch': ['index.md', {'Hauptklassen': ['manual/main-classes/index.md', {'Controller (Steuerung)': ['manual/main-classes/controller/index.md', 'manual/main-classes/controller/coordinate-system.md', 'manual/main-classes/controller/instant-mode.md', 'manual/main-classes/controller/game-loop.md', 'manual/main-classes/controller/dialog.md']}, 'manual/main-classes/scene.md', 'manual/main-classes/camera.md', 'manual/main-classes/layer.md', {'Actor (Figur)': ['manual/main-classes/actor/index.md', 'manual/main-classes/actor/animation.md', 'manual/main-classes/actor/circle.md', 'manual/main-classes/actor/counter.md', 'manual/main-classes/actor/grid.md', 'manual/main-classes/actor/image-font.md', 'manual/main-classes/actor/image.md', 'manual/main-classes/actor/line.md', 'manual/main-classes/actor/polygon.md', 'manual/main-classes/actor/rectangle.md', 'manual/main-classes/actor/square.md', 'manual/main-classes/actor/star.md', 'manual/main-classes/actor/stateful-animation.md', 'manual/main-classes/actor/stop-watch.md', 'manual/main-classes/actor/text-block.md', 'manual/main-classes/actor/text.md', 'manual/main-classes/actor/tile-map.md', 'manual/main-classes/actor/triangle.md', 'manual/main-classes/actor/turtle.md']}]}, {'events (Ereignissteuerung)': ['manual/events/index.md', 'manual/events/key-event.md', 'manual/events/key-stroke.md', 'manual/events/mouse-click.md', 'manual/events/collision.md', 'manual/events/repeat.md', 'manual/events/shortcuts.md']}, {'physics (Physiksimulation)': ['manual/physics/index.md', 'manual/physics/body-type.md', 'manual/physics/gravity.md', 'manual/physics/density.md', 'manual/physics/restitution.md', 'manual/physics/impulse.md', 'manual/physics/joints.md']}, {'Ressourcenverwaltung': ['manual/resources/index.md', 'manual/resources/colors.md', 'manual/resources/fonts.md', 'manual/resources/images.md', 'manual/resources/sounds.md', 'manual/resources/config.md']}, {'Java': ['manual/java/index.md', 'manual/java/packages.md']}, {'Entwicklung': ['manual/dev/index.md', 'manual/dev/monorepo.md', 'manual/dev/design.md', 'manual/dev/coding-style.md', 'manual/dev/javadoc.md', 'manual/dev/mkdocs.md', 'manual/dev/setter-getter.md', 'manual/dev/versions.md', 'manual/dev/tests.md', 'manual/dev/go-to-file.md', 'manual/dev/screen-recording.md', 'manual/dev/logging.md', 'manual/dev/vibe-coding.md']}]}, {'API (javadocs)': 'https://engine-pi.github.io/javadocs/pi/package-summary.html'}, 'download.md']
pages NoneType None
exclude_docs NoneType None
draft_docs NoneType None
not_in_nav NoneType None
site_url str 'https://engine-pi.github.io/engine-pi/'
site_description NoneType None
site_author NoneType None
theme Theme Theme(name='material', dirs=['/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/site-packages/material/templates', '/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/site-packages/mkdocs/templates'], static_templates={'sitemap.xml', '404.html'}, name='material', locale=Locale('en'), language='en', direction=None, features=['navigation.indexes', 'navigation.footer', 'content.code.copy', 'content.code.select', 'content.action.edit'], font={'text': 'Cantarell', 'code': 'Ubuntu Mono'}, icon=None, favicon='assets/images/favicon.png', logo='_assets/logo.svg')
docs_dir str '/home/runner/work/engine-pi/engine-pi/docs'
site_dir str '/home/runner/work/engine-pi/engine-pi/site'
copyright str 'Copyright © 2024 - 2026 Josef Friedrich'
google_analytics NoneType None
dev_addr _IpAddressValue _IpAddressValue(host='127.0.0.1', port=8000)
use_directory_urls bool True
repo_url str 'https://github.com/engine-pi/engine-pi'
repo_name str 'Engine Pi'
edit_uri_template NoneType None
edit_uri str 'edit/main/docs/'
extra_css list ['_assets/extra.css']
extra_javascript list ['_assets/mathjax.js', 'https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js']
extra_templates list []
markdown_extensions list ['toc', 'tables', 'fenced_code', 'pymdownx.highlight', 'pymdownx.inlinehilite', 'pymdownx.snippets', 'pymdownx.superfences', 'footnotes', 'pymdownx.magiclink', 'attr_list', 'md_in_html', 'pymdownx.blocks.caption', 'admonition', 'pymdownx.details', 'pymdownx.emoji', 'pymdownx.arithmatex']
mdx_configs dict pymdownx.highlight [dict], pymdownx.emoji [dict], pymdownx.arithmatex [dict]
strict bool True
remote_branch str 'gh-pages'
remote_name str 'origin'
extra LegacyConfig {'version': '0.44.0', 'generator': False, 'social': [{'icon': 'fontawesome/brands/github', 'link': 'https://github.com/engine-pi/engine-pi'}, {'icon': 'simple/forgejo', 'link': 'https://inf.pirckheimer-gymnasium.de/engine-pi/engine-pi'}, {'icon': 'fontawesome/brands/java', 'link': 'https://engine-pi.github.io/javadocs/pi/package-summary.html'}, {'icon': 'fontawesome/solid/paper-plane', 'link': 'mailto:josef.friedrich@pirckheimer-gymnasium.de'}]}
plugins PluginCollection macros [MacrosPlugin], drawio [DrawioPlugin]
hooks dict
watch list ['/home/runner/work/engine-pi/engine-pi/docs']
validation Validation {'nav': {'omitted_files': 20, 'not_found': 30, 'absolute_links': 20}, 'links': {'not_found': 30, 'absolute_links': 20, 'unrecognized_links': 20, 'anchors': 20}}

Macros

These macros have been defined programmatically for this environment (module or pluglets).

Variable Type Content
{ context: ''' Function: (obj: dict = None) *Default Mkdocs-Macro*: List an object (by default the variables) ''' macros_info: ''' Function: () *Test/debug function*: list useful documentation on the mkdocs_macro environment. ''' now: ''' Function: () *Default Mkdocs-Macro*: Get the current time (at the moment of the project build). It returns a datetime object. Used alone, it provides a timestamp. To get the year use `now().year`, for the month number `now().month`, etc. ''' fix_url: ''' Function: (url) If url is relative, fix it so that it points to the docs directory. This is necessary because relative links in markdown must be adapted in html ('img/foo.png' => '../img/img.png'). ''' class: ''' Function: (class_path: str, link_title: str | None = None) -> str :param class_path: For example ``pi.actor.Actor`` ``{{ class('pi.actor.Actor') }}`` ''' java_class: Function: (class_path: str, link_title: str | None = None, module: str = 'java.base') -> str None package: Function: (package_path: str, link_title: str | None = None) -> str None method: ''' Function: (class_path: str, method: str, link_title: str | None = None) -> str :param class_path: For example ``pi.actor.Actor`` :param method: For example ``color(java.awt.Color)`` :return: ``https://engine-pi.github.io/javadocs/pi/actor/Actor.html#color(java.awt.Color)`` ''' methods: ''' Function: (class_path: str, methods: list[str]) -> str :param class_path: For example ``pi.actor.Actor`` :param methods: For example ``['color(java.awt.Color)', 'color(String)']`` ''' attribute: ''' Function: (class_path: str, attribute: str, link_title: str | None = None) -> str :param class_path: For example ``pi.Resources`` :param attribute: For example ``color`` :return: ``https://engine-pi.github.io/javadocs/pi/Resources.html#colors`` ''' demo: ''' Function: (relpath: str, blob: str = 'main', lines: str | None = None, start_line: int = 0, end_line: int = 0) -> str :param blob: The branch name or the commit id ''' image: Function: (relpath: str, caption: str | None = None) -> str None video: Function: (relpath: str, caption: str | None = None) -> str None contribute: Function: () -> str None repo_link: Function: (relpath: str, link_title: str | None = None) -> str None code: ''' Function: (path: str, start_line: int = 0, end_line: int = 0, line: int = 0, link: bool = True, from_import: bool = False) -> str Extract a substring of code lines based on specified line numbers. :param start_line: The starting line number (1-indexed). If 0, starts from the beginning. Defaults to 0. :param end_line: The ending line number (1-indexed, inclusive). If 0, goes to the end. Defaults to 0. :param line: A specific line number to extract (1-indexed). If greater than 0, overrides start_line and end_line to extract only that line. Defaults to 0. :return: A string containing the extracted code lines joined by newline characters. :raises Exception: If the end line is an empty string. :raises Exception: If the start line is an empty string. .. note:: If the `line` parameter is specified (> 0), it takes precedence over `start_line` and `end_line` parameters. https://github.com/mkdocs/mkdocs/issues/692 https://pypi.org/project/mkdocs-snippets/ ''' line: Function: (relpath: str, line: int) -> str None drawio: ''' Function: (basename: str) -> str :param basename: The filename without extension ''' } SuperDict {'context': .context at 0x7f5364a71380>, 'macros_info': .macros_info at 0x7f53639c2980>, 'now': .now at 0x7f53639c2a30>, 'fix_url': , 'class': .macro_class at 0x7f536320fd70>, 'java_class': .macro_java_class at 0x7f536320fed0>, 'package': .macro_package at 0x7f53632540f0>, 'method': .macro_method at 0x7f5363254250>, 'methods': .macro_methods at 0x7f53632543b0>, 'attribute': .macro_attribute at 0x7f5363254510>, 'demo': .macro_demo at 0x7f5363254670>, 'image': .macro_image at 0x7f53632547d0>, 'video': .macro_video at 0x7f5363254930>, 'contribute': .macro_contribute at 0x7f5363254a90>, 'repo_link': .macro_repo_link at 0x7f5363254bf0>, 'code': .macro_code at 0x7f5363254d50>, 'line': .macro_line at 0x7f5363254eb0>, 'drawio': .macro_drawio at 0x7f5363255010>}

Git Information

Information available on the last commit and the git repository containing the documentation project:

e.g. {{ git.message }}

Variable Type Content
status bool True
date datetime datetime.datetime(2026, 4, 2, 17, 2, 39, tzinfo=tzoffset(None, 7200))
short_commit str '8f6f1a9'
commit str '8f6f1a934dd509845705e6fd003a253fe6150799'
tag str ''
short_tag str ''
author str 'Josef Friedrich'
author_email str 'josef@friedrich.rocks'
committer str 'Josef Friedrich'
committer_email str 'josef@friedrich.rocks'
date_ISO str 'Thu Apr 2 17:02:39 2026 +0200'
message str 'Add center line and sound to the game pong'
raw str 'commit 8f6f1a934dd509845705e6fd003a253fe6150799\nAuthor: Josef Friedrich \nDate: Thu Apr 2 17:02:39 2026 +0200\n\n Add center line and sound to the game pong'
root_dir str '/home/runner/work/engine-pi/engine-pi'

Page Attributes

Provided by MkDocs. These attributes change for every page (the attributes shown are for this page).

e.g. {{ page.title }}

See also the MkDocs documentation on the page object.

Variable Type Content
file File src_uri = 'manual/dev/mkdocs.md', src_dir = '/home/runner/work/engine-pi/engine-pi/docs', dest_dir = '/home/runner/work/engine-pi/engine-pi/site', use_directory_urls = True, inclusion [InclusionLevel], name = 'mkdocs', dest_uri = 'manual/dev/mkdocs/index.html', page [Page], url = 'manual/dev/mkdocs/', abs_src_path = '/home/runner/work/engine-pi/engine-pi/docs/manual/dev/mkdocs.md'
children NoneType None
previous_page Page Page(title='javadoc (API-Dokumentation)', url='/engine-pi/manual/dev/javadoc/')
next_page Page Page(title=[blank], url='/engine-pi/manual/dev/setter-getter/')
_Page__active bool False
update_date str '2026-04-02'
canonical_url str 'https://engine-pi.github.io/engine-pi/manual/dev/mkdocs/'
abs_url str '/engine-pi/manual/dev/mkdocs/'
edit_url str 'https://github.com/engine-pi/engine-pi/edit/main/docs/manual/dev/mkdocs.md'
markdown str "# `mkdocs` (Dokumentationsseite)\n\nDie Dokumentation der [Engine Pi](https://github.com/engine-pi/engine-pi) ist\nmit [MkDocs](https://www.mkdocs.org) und dem Theme\n[Material](https://squidfunk.github.io/mkdocs-material) realisiert. Sie\nverwendet Tutorials und Bilder aus dem [Engine Alpha\nWiki](https://engine-alpha.org), die unter der [Creative Commons „Namensnennung,\nWeitergabe unter gleichen\nBedingungen“](https://creativecommons.org/licenses/by-sa/3.0/) Lizenz stehen.\n\n## Makros:\n\nDas MkDocs-Plugin\n[Mkdocs-Macros](https://github.com/fralau/mkdocs-macros-plugin) ermöglicht den\nEinsatz von Makros. Die Makros sind in der Datei {{ repo_link('docs/macros.py')\n}} definiert. Folgende Makros können verwendet werden:\n\n### Java spezifisch\n\n#### `package(package_path, link_title?)`\n\n```jinja\n{% raw %}\n{{ package('pi', 'Haupt-Paket') }}\n{% endraw %}\n```\n\n{{ package('pi', 'Haupt-Paket') }}\n\n---\n\n#### `class(class_path, link_title?)`\n\n```jinja\n{% raw %}\n{{ class('pi.Controller', 'Spiel') }}\n{% endraw %}\n```\n\n{{ class('pi.Controller', 'Spiel') }}\n\n#### `method(class_path, method, link_title?)`\n\n```jinja\n{% raw %}\n{{ method('pi.actor.Actor', 'color(java.awt.Color)', 'color()') }}\n{% endraw %}\n```\n\n{{ method('pi.actor.Actor', 'color(java.awt.Color)', 'color()') }}\n\n---\n\n#### `attribute(class_path, attribute, link_title?)`\n\n```jinja\n{% raw %}\n{{ attribute('pi.Controller', 'colors', 'statisches Attribute colors') }}\n{% endraw %}\n```\n\n{{ attribute('pi.Controller', 'colors', 'statisches Attribute colors') }}\n\n---\n\n#### `demo(relpath, hash?, lines?)`\n\n```jinja\n{% raw %}\n{{ demo('docs/dev/design/SimpleGeometricActorsDemo') }}\n{% endraw %}\n```\n\n{{ demo('docs/dev/design/SimpleGeometricActorsDemo') }}\n\n```jinja\n{% raw %}\n{{ demo('docs/dev/design/SimpleGeometricActorsDemo', 'd9e92a3759dce13923528f62a1afa8328be5126e', 'L38-L42') }}\n{% endraw %}\n```\n\n{{ demo('docs/dev/design/SimpleGeometricActorsDemo', 'd9e92a3759dce13923528f62a1afa8328be5126e', 'L38-L42') }}\n\n---\n\n#### `code(path, start_line?, end_line?, line?, link?, from_import?)`\n\n```jinja\n{% raw %}\n{{ code('docs/main_classes/actor/hello_world/HelloWorldVersion2.java', 25) }}\n{% endraw %}\n```\n\n##### Ohne Argumente\n\nOhne Argumente wird die komplette Java-Datei eingebunden.\n\n```jinja\n{% raw %}\n{{ code('docs/HelloWorldVersion.java') }}\n{% endraw %}\n```\n\n{{ code('docs/main_classes/actor/hello_world/HelloWorldVersion2.java') }}\n\n##### from_import=true\n\nIst das Argument `from_import` auf wahr gesetzt, so wird der Quelltext ab dem ersten import-Statement angezeigt.\n\n```jinja\n{% raw %}\n{{ code('docs/HelloWorldVersion.java', from_import=true) }}\n{% endraw %}\n```\n\n{{ code('docs/main_classes/actor/hello_world/HelloWorldVersion2.java', from_import=true) }}\n\n---\n\n##### link=false\n\nDas Argument `link` steuert, ob eine Link zum Github-Repository angehängt werden\nsoll.\n\n```jinja\n{% raw %}\n{{ code('docs/HelloWorldVersion.java', link=false) }}\n{% endraw %}\n```\n\n{{ code('docs/main_classes/actor/hello_world/HelloWorldVersion2.java', line=57, link=false) }}\n\n---\n\n#### `line(relpath, line)`\n\n```jinja\n{% raw %}\n{{ line('docs/main_classes/actor/hello_world/HelloWorldVersion1.java', 42) }}\n{% endraw %}\n```\n\n{{ line('docs/main_classes/actor/hello_world/HelloWorldVersion1.java', 44) }}\n\n### assets (Mediendaten)\n\n#### `image(relpath, caption?)`\n\n```jinja\n{% raw %}\n{{ image('logo/logo.svg', 'Das Logo der Engine Pi') }}\n{% endraw %}\n```\n\n{{ image('logo/logo.svg', 'Das Logo der Engine Pi') }}\n\n---\n\n#### `video(relpath, caption?)`\n\n```jinja\n{% raw %}\n{{ video('docs/MainAnimation.mp4', 'Die Hauptanimation der Engine Pi.
Sie erscheint, wenn Controller.start() ohne Szene ausgeführt wird.') }}\n{% endraw %}\n```\n\n{{ video('docs/MainAnimation.mp4', 'Die Hauptanimation der Engine Pi.
Sie erscheint, wenn Controller.start() ohne Szene ausgeführt wird.') }}\n\n---\n\n### Projekt spezifisch\n\n#### `contribute()`\n\n```jinja\n{% raw %}\n{{ contribute() }}\n{% endraw %}\n```\n\n{{ contribute() }}\n\n---\n\n### `repo_link(relpath, link_title)`\n\n```jinja\n{% raw %}\n{{ repo_link('docs/macros.py') }}\n{% endraw %}\n```\n\n{{ repo_link('docs/macros.py') }}\n\n### `drawio(basename)`\n\n```jinja\n{% raw %}\n{{ drawio('main-classes') }}\n{% endraw %}\n```\n\n{{ drawio('main-classes') }}\n\n---\n\n## Vom Macros-Plugin bereit gestellt.\n\n{{ macros_info() }}\n"
_title_from_render NoneType None
content NoneType None
toc list []
meta dict
parent Section title = 'Entwicklung', children = [Page(title='Entwicklung', url='/engine-pi/manual/dev/'), Page(title=[blank], url='/engine-pi/manual/dev/monorepo/'), Page(title='design (Optisches Erscheinungsbild)', url='/engine-pi/manual/dev/design/'), Page(title='coding style (Programmierstil)', url='/engine-pi/manual/dev/coding-style/'), Page(title='javadoc (API-Dokumentation)', url='/engine-pi/manual/dev/javadoc/'), Page(title='`mkdocs` (Dokumentationsseite)', url='/engine-pi/manual/dev/mkdocs/'), Page(title=[blank], url='/engine-pi/manual/dev/setter-getter/'), Page(title=[blank], url='/engine-pi/manual/dev/versions/'), Page(title=[blank], url='/engine-pi/manual/dev/tests/'), Page(title='Go to file:// (Links zwischen Textdateien)', url='/engine-pi/manual/dev/go-to-file/'), Page(title=[blank], url='/engine-pi/manual/dev/screen-recording/'), Page(title='Logging', url='/engine-pi/manual/dev/logging/'), Page(title=[blank], url='/engine-pi/manual/dev/vibe-coding/')], _Section__active = False, parent [Section]

To have all titles of all pages, use:

{% for page in navigation.pages %}
- {{ page.title }}
{% endfor %}

Plugin Filters

These filters are provided as a standard by the macros plugin.

Variable Type Content
pretty function (var_list, var, var_type, content, rows, header, e)

Default Mkdocs-Macro: Prettify a dictionary or object (used for environment documentation, or debugging).


relative_url function (path)

Default Mkdocs-Macro: convert the path of any page according to MkDoc's internal logic, into a URL relative to the current page (implements the normalize_url() function from mkdocs.util). Typically used to manage custom navigation: {{ page.url | relative_url }}.


Builtin Jinja2 Filters

These filters are provided by Jinja2 as a standard.

See also the Jinja2 documentation on builtin filters.

Variable Type Content
abs builtin_function_or_method

Return the absolute value of the argument.

attr function (environment, obj, name)

Get an attribute of an object. foo|attr("bar") works like foo.bar, but returns undefined instead of falling back to foo["bar"] if the attribute doesn't exist.


batch function (value, linecount, fill_with, tmp, item)

A filter that batches items. It works pretty much like slice just the other way round. It returns a list of lists with the given number of items. If you provide a second parameter this is used to fill up missing items. See this example.

capitalize function (s)

Capitalize a value. The first character will be uppercase, all others lowercase.

center function (value, width)

Centers the value in a field of a given width.

count builtin_function_or_method

Return the number of items in a container.

d function (value, default_value, boolean)

If the value is undefined it will return the passed default value, otherwise the value of the variable.

default function (value, default_value, boolean)

If the value is undefined it will return the passed default value, otherwise the value of the variable.

dictsort function (value, case_sensitive, by, reverse, sort_func)

Sort a dict and yield (key, value) pairs. Python dicts may not be in the order you want to display them in, so sort them first.

e function (s)

Replace the characters &, <, >, ', and " in the string with HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML.

escape function (s)

Replace the characters &, <, >, ', and " in the string with HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML.

filesizeformat function (value, binary, bytes, base, prefixes, i, prefix, unit)

Format the value like a 'human-readable' file size (i.e. 13 kB, 4.1 MB, 102 Bytes, etc). Per default decimal prefixes are used (Mega, Giga, etc.), if the second parameter is set to True the binary prefixes are used (Mebi, Gibi).

first function (args, kwargs, b)

Return the first item of a sequence.

float function (value, default)

Convert the value into a floating point number. If the conversion doesn't work it will return 0.0. You can override this default using the first parameter.

forceescape function (value)

Enforce HTML escaping. This will probably double escape variables.

format function (value, args, kwargs)

Apply the given values to a printf-style_ format string, like string % values.

groupby function (args, kwargs, b)

Group a sequence of objects by an attribute using Python's :func:itertools.groupby. The attribute can use dot notation for nested access, like "address.city". Unlike Python's groupby, the values are sorted first so only one group is returned for each unique value.

indent function (s, width, first, blank, newline, rv, lines)

Return a copy of the string with each line indented by 4 spaces. The first line and blank lines are not indented by default.

int function (value, default, base)

Convert the value into an integer. If the conversion doesn't work it will return 0. You can override this default using the first parameter. You can also override the default base (10) in the second parameter, which handles input with prefixes such as 0b, 0o and 0x for bases 2, 8 and 16 respectively. The base is ignored for decimal numbers and non-string values.

join function (args, kwargs, b)

Return a string which is the concatenation of the strings in the sequence. The separator between elements is an empty string per default, you can define it with the optional parameter.

last function (environment, seq)

Return the last item of a sequence.

length builtin_function_or_method

Return the number of items in a container.

list function (args, kwargs, b)

Convert the value into a list. If it was a string the returned list will be a list of characters.

lower function (s)

Convert a value to lowercase.

items function (value)

Return an iterator over the (key, value) items of a mapping.

map function (args, kwargs, b)

Applies a filter on a sequence of objects or looks up an attribute. This is useful when dealing with lists of objects but you are really only interested in a certain value of it.

min function (environment, value, case_sensitive, attribute)

Return the smallest item from the sequence.

max function (environment, value, case_sensitive, attribute)

Return the largest item from the sequence.

pprint function (value)

Pretty print a variable. Useful for debugging.

random function (context, seq)

Return a random item from the sequence.

reject function (args, kwargs, b)

Filters a sequence of objects by applying a test to each object, and rejecting the objects with the test succeeding.

rejectattr function (args, kwargs, b)

Filters a sequence of objects by applying a test to the specified attribute of each object, and rejecting the objects with the test succeeding.

replace function (eval_ctx, s, old, new, count)

Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument count is given, only the first count occurrences are replaced.

reverse function (value, rv, e)

Reverse the object or return an iterator that iterates over it the other way round.

round function (value, precision, method, func)

Round the number to a given precision. The first parameter specifies the precision (default is 0), the second the rounding method.

safe function (value)

Mark the value as safe which means that in an environment with automatic escaping enabled this variable will not be escaped.

select function (args, kwargs, b)

Filters a sequence of objects by applying a test to each object, and only selecting the objects with the test succeeding.

selectattr function (args, kwargs, b)

Filters a sequence of objects by applying a test to the specified attribute of each object, and only selecting the objects with the test succeeding.

slice function (args, kwargs, b)

Slice an iterator and return a list of lists containing those items. Useful if you want to create a div containing three ul tags that represent columns.

sort function (environment, value, reverse, case_sensitive, attribute, key_func)

Sort an iterable using Python's :func:sorted.

string function (s)

Convert an object to a string if it isn't already. This preserves a :class:Markup string rather than converting it back to a basic string, so it will still be marked as safe and won't be escaped again.

striptags function (value)

Strip SGML/XML tags and replace adjacent whitespace by one space.

sum function (args, kwargs, b)

Returns the sum of a sequence of numbers plus the value of parameter 'start' (which defaults to 0). When the sequence is empty it returns start.

title function (s, item)

Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase.

trim function (value, chars)

Strip leading and trailing characters, by default whitespace.

truncate function (env, s, length, killwords, end, leeway, result)

Return a truncated copy of the string. The length is specified with the first parameter which defaults to 255. If the second parameter is true the filter will cut the text at length. Otherwise it will discard the last word. If the text was in fact truncated it will append an ellipsis sign ("..."). If you want a different ellipsis sign than "..." you can specify it using the third parameter. Strings that only exceed the length by the tolerance margin given in the fourth parameter will not be truncated.

unique function (args, kwargs, b)

Returns a list of unique items from the given iterable.

upper function (s)

Convert a value to uppercase.

urlencode function (value, items)

Quote data for use in a URL path or query using UTF-8.

urlize function (eval_ctx, value, trim_url_limit, nofollow, target, rel, extra_schemes, policies, rel_parts, scheme, rv)

Convert URLs in text into clickable links.

wordcount function (s)

Count the words in that string.

wordwrap function (environment, s, width, break_long_words, wrapstring, break_on_hyphens, textwrap, line)

Wrap a string to the given width. Existing newlines are treated as paragraphs to be wrapped separately.

xmlattr function (eval_ctx, d, autospace, items, key, value, rv)

Create an SGML/XML attribute string based on the items in a dict.

tojson function (eval_ctx, value, indent, policies, dumps, kwargs)

Serialize an object to a string of JSON, and mark it safe to render in HTML. This filter is only for use in HTML documents.