TechnoteJinjaContext#

class technote.config.TechnoteJinjaContext(toml)#

Bases: object

A class available to the Jinja context in HTML templates and provides access to technote.toml-based metadata.

Parameters:

toml (TechnoteToml) – The metadata from technote.toml.

Attributes Summary

abstract

The technote's unformatted abstract.

canonical_url

The canonical URL of the technote, if available.

date_created_iso

The date of initial publication, as an ISO 8601 string normalized to UTC.

date_updated_iso

The date updated, as an ISO 8601 string normalized to UTC.

datetime_created_iso

The datetime of initial publication, as an ISO 8601 string normalized to UTC.

datetime_updated_iso

The datetime updated, as an ISO 8601 string normalized to UTC.

generator_tag

A meta name=generator tag to identify the version of technote.

github_edit_url

The URL for editing content on GitHub, from its default branch.

github_ref_name

The branch or tag name.

github_ref_type

branch or tag.

github_repo_slug

The GitHub repository slug, owner/name.

github_url

The GitHub repository URL.

highwire_metadata_tags

The Highwire metadata tags for the technote.

opengraph_metadata_tags

The OpenGraph metadata tags for the technote.

title

The technote's title.

toml

The technote.toml root object.

version

The version, as a string if available.

Methods Summary

set_abstract(abstract)

Set the abstract metadata from the content.

set_content_title(title)

Set the title from the content nodes.

Attributes Documentation

abstract#

The technote’s unformatted abstract.

This content is extracted from the abstract directive, and all markup is removed as part of that process. This attribute can be used for populating summary tags in the HTML header.

canonical_url#

The canonical URL of the technote, if available.

date_created_iso#

The date of initial publication, as an ISO 8601 string normalized to UTC.

date_updated_iso#

The date updated, as an ISO 8601 string normalized to UTC.

datetime_created_iso#

The datetime of initial publication, as an ISO 8601 string normalized to UTC.

datetime_updated_iso#

The datetime updated, as an ISO 8601 string normalized to UTC.

generator_tag#

A meta name=generator tag to identify the version of technote.

github_edit_url#

The URL for editing content on GitHub, from its default branch.

github_ref_name#

The branch or tag name.

github_ref_type#

branch or tag.

Type:

The ref type

github_repo_slug#

The GitHub repository slug, owner/name.

github_url#

The GitHub repository URL.

highwire_metadata_tags#

The Highwire metadata tags for the technote.

opengraph_metadata_tags#

The OpenGraph metadata tags for the technote.

title#

The technote’s title.

The title is the h1 heading from the document if technote.title isn’t set in technote.toml.

toml#

The technote.toml root object.

version#

The version, as a string if available.

Methods Documentation

set_abstract(abstract)#

Set the abstract metadata from the content.

Parameters:

abstract (str) –

Return type:

None

set_content_title(title)#

Set the title from the content nodes.

Parameters:

title (str) –

Return type:

None