Soju is an extension mechanism that lets you create your own user-defined Python functions, and reference them in substitution parameters when your web site is built.
This is a powerful tool that lets you add most of the benefits of dynamic code to a static web site.
The lib/soju.py file is a Python module within a Uriel project where you can create your own user-defined functions.
Once you have a user-defined function in lib/soju.py, you can reference it in the rvalue portion of a {{soju:hello_world(node)}} parameter.
For example, the lib/soju.py file for this documentation site contains the following function:
# {{soju:hello_world(node)}}
def hello_world(node):
"""
Hello world function.
Accepts a Node.
Returns an HTML escaped hello world message.
"""
return "Hello from lib/soju.py, called from " + escape(node.get_path())
And when we use the {{soju:hello_world(node)}} parameter on this node, it evaluates to:
Hello from lib/soju.py, called from parameters/soju-hello-world
See the Soju section for more information on writing your own user-defined functions.
Tags: parameters, soju, user-defined-python-code
This page was generated by Uriel with the following settings:
Page Details
| Resource | Path | Project File |
|---|---|---|
| Node | parameters/soju-hello-world | nodes/parameters/soju-hello-world |
| Template | default.html | templates/default.html |
| URL | /parameters/soju-hello-world/ | public/parameters/soju-hello-world/index.html |
Node Headers
| Header (Lowercase) | Value |
|---|---|
| tags | parameters, soju, user-defined-python-code |
| title | {{soju:hello_world(node)}} |
| +-tags | * |
| breadcrumb-separator | » |
| canonical-url | https://documentation.uriel.foo |
| rss-description | Uriel Documentation |
| rss-image-height | 32 |
| rss-image-url | /favicon-32x32.png |
| rss-image-width | 32 |
| rss-max-entries | 50 |
| rss-title | Uriel Documentation |
| rss-url | /rss.xml |
| sitemap-max-entries | 10000 |
| sitemap-url | /sitemap.xml |
| tag-node | tag |
| template | default.html |
Node Timestamps
| Type | Value |
|---|---|
| Created | |
| Modified | 2026-06-10T21:58:52-04:00 |
Node Methods
| Method | Value |
|---|---|
| get_parent_node() | parameters/index |
| get_path() | parameters/soju-hello-world |
| get_node_type() | file |
| get_url() | /parameters/soju-hello-world/ |
| get_canonical_url() | https://documentation.uriel.foo/parameters/soju-hello-world/ |
| get_name() | soju-hello-world |
| get_display_name() | Soju Hello World |
| get_title() | {{soju:hello_world(node)}} |
| get_escaped_title() | {{soju:hello_world(node)}} |
| get_link() | <a href="/parameters/soju-hello-world/">{{soju:hello_world(node)}}</a> |
| get_canonical_link() | <a href="https://documentation.uriel.foo/parameters/soju-hello-world/">{{soju:hello_world(node)}}</a> |
| get_link_prefix() | <p> |
| get_link_suffix() | </p> |
| get_tags() | ['parameters', 'soju', 'user-defined-python-code'] |
| get_dest_dir() | ./public/parameters/soju-hello-world |
| get_dest_file() | ./public/parameters/soju-hello-world/index.html |
| get_breadcrumb_separator() | » |