[][src]Module bloguen::ops

Functions composable to generate blogues

The following steps will yield something akin to the bloguen executable:

  1. BlogueDescriptor::read() to read a blogue descriptor from the filesystem
  2. BloguePost::list() and pipe the results into BloguePost::new() to discover and load posts from the filesystem
  3. Read in the post header and footer, and, if applicable, index header, footer, and center
  4. {Script,Style}Element::load() the blogue and index descriptors
  5. BlogueDescriptor::create_feed_output(), yielding feed files
  6. BlogueDescriptor::generate_feed_head()s
  7. For each discovered post: 1. PostMetadata::read_or_default() to discover and load any metadata that might be present from the filesystem 2. {Script,Style}Element::load()s 3. TagName::load_additional_post_tags()s to discover and load any additional tags that might be present from the filesystem 4. For each pair in BlogueDescriptor::machine_data:
    1. BloguePost::create_machine_output(), yielding the machine data file
    2. BloguePost::generate_machine() into the file from above 5. If index file requested, BloguePost::generate_machine(MachineDataKind::Json) into the script file 6. BloguePost::generate_feed_head() into the feed files 7. BloguePost::generate() to create the post HTML, with feed_type_post_body()s connected to the alt stream and, if requested, the index center buffer, and get the asset list 8. BloguePost::copy_asset() the returned percent-decoded links if they're assets 9. BloguePost::generate_feed_foot() into the feed files
  8. BlogueDescriptor::generate_feed_foot()s
  9. If index requested: 1. Concatenate the JSON machine data into an additional script 2. Create an index.html file 3. format_output() the index header with the above script 4. Write out the previously saved centers 5. format_output() the index header with the above script

Variables available in format_output():

NameDescriptionExample
languagepassed-in language in BCP47 formaten-GB
numberdefault-formatted passed-in number14
titlepassed-in title, unformattedrelease-front - a generic release front-end, like Patchwork's
authorpassed-in author, unformattednabijaczleweli
raw_post_namepassed-in post name as it appeared on the filesystem, unformatted004. 2018-03-30 Stir plate
normalised_post_namepassed-in normalised post name, unformatted004. 2018-03-30 06-00-51 Stir plate
blog_namepassed-in blog name, unformattedБлогг
bloguen-versioncurrent version of bloguenv0.1.1
tags<span class="post-tag">maths</span>
tags()all passed-in tags with the default class (post-tag)<span class="post-tag">maths</span>
tags(class)all passed-in tags with the specified class, headers and footers<span class="пост-таг">maths</span>
stylesall the passed-in styles with their headers and footers<style type="text/css">* {color: magenta;}</style>
scriptsall the passed-in scripts with their headers and footers<script type="text/javascript">alert("hewwo")</script>
data-namepassed-in data under the name key, unformattedhewwo
date(post, format)post date formatted with parse_date_format_specifier(format)Thu, 6 Sep 2018 18:32:22 +0200
date(now_utc, format)current date in UTC formatted with parse_date_format_specifier(format)Thu, 6 Sep 2018 18:32:22 +0200
date(now_local, format)current date in local timezone formatted with parse_date_format_specifier(format)Thu, 6 Sep 2018 18:32:22 +0200
machine_data(kind)machine data of the specified kind{"number": 3, "language": "en-GB", …}
pass_paragraphs(n, var)parse var and write its contents formatted through ParagraphPasser<p>Paragraph 1</p> <p>Paragraph 2</p>

Structs

BlogueDescriptor

Generic blogue metadata.

BlogueDescriptorIndex

Metadata pertaining specifically to generating an index file.

BloguePost

Information about a blogue post.

LanguageTag

A verified-valid BCP47 language tag.

ParagraphPasser

Output sink which will allow through the specified amount of HTML paragraphs, then void all remaining data.

PostMetadata

Generic post metadata.

TagName

A verified-valid post tag.

WrappedElementImpl

A semi-generic wrapped data specifier, backing ScriptElement and StyleElement.

Enums

CenterOrder

A specifier of index centerpiece ordering.

FeedType

A feed type specifier.

MachineDataKind

A specifier of machine data format.

Traits

WrappedElement

An element with a preface, a content, and a postface.

Functions

feed_atom_footer

Output the footer for an Atom feed,

feed_atom_header

Output the header for an Atom feed,

feed_atom_post_body

Get the post body writer for an Atom feed.

feed_atom_post_footer

Output the post footer for an Atom feed,

feed_atom_post_header

Output the post header for an Atom feed,

feed_rss_footer

Output the footer for an RSS feed,

feed_rss_header

Output the header for an RSS feed,

feed_rss_post_body

Get the post body writer for an RSS feed.

feed_rss_post_footer

Output the post footer for an RSS feed,

feed_rss_post_header

Output the post header for an RSS feed,

feed_type_footer

Get the correct feed output funxion for the specified feed kind.

feed_type_header

Get the correct feed output funxion for the specified feed kind.

feed_type_post_body

Get the correct feed output writer for the specified feed kind.

feed_type_post_footer

Get the correct feed output funxion for the specified feed kind.

feed_type_post_header

Get the correct feed output funxion for the specified feed kind.

format_output

Fill out an HTML template.

machine_output_json

Output a JSON blob of post metadata.

machine_output_kind

Get the correct machine output funxion for the specified output kind.

Type Definitions

ScriptElement

A script specifier.

StyleElement

A style specifier.