[−][src]Module bloguen::ops
Functions composable to generate blogues
The following steps will yield something akin to
the bloguen
executable:
BlogueDescriptor::read()
to read a blogue descriptor from the filesystemBloguePost::list()
and pipe the results intoBloguePost::new()
to discover and load posts from the filesystem- Read in the post header and footer, and, if applicable, index header, footer, and center
{Script,Style}Element::load()
the blogue and index descriptorsBlogueDescriptor::create_feed_output()
, yielding feed filesBlogueDescriptor::generate_feed_head()
s- 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 inBlogueDescriptor::machine_data
:BloguePost::create_machine_output()
, yielding the machine data fileBloguePost::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, withfeed_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
BlogueDescriptor::generate_feed_foot()
s- 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()
:
Name | Description | Example |
---|---|---|
language | passed-in language in BCP47 format | en-GB |
number | default-formatted passed-in number | 14 |
title | passed-in title, unformatted | release-front - a generic release front-end, like Patchwork's |
author | passed-in author, unformatted | nabijaczleweli |
raw_post_name | passed-in post name as it appeared on the filesystem, unformatted | 004. 2018-03-30 Stir plate |
normalised_post_name | passed-in normalised post name, unformatted | 004. 2018-03-30 06-00-51 Stir plate |
blog_name | passed-in blog name, unformatted | Блогг |
bloguen-version | current version of bloguen | v0.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> … |
styles | all the passed-in styles with their headers and footers | <style type="text/css">* {color: magenta;}</style> … |
scripts | all the passed-in scripts with their headers and footers | <script type="text/javascript">alert("hewwo")</script> … |
data-name | passed-in data under the name key, unformatted | hewwo |
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 |
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. |