Orion API - Build
This document covers the Build System APIs.
- Build System
- SunStarSys::View
- SunStarSys::Util
- read_text_file($file, $out, $content_lines)
- copy_if_newer($src, $dest)
- get_lock($lockfile)
- shuffle(\@deck)
- sort_tables($content)
- fixup_code($prefix, $type, @_)
- unload_package($pkg)
- purge_from_inc(@paths)
- touch(@_)
- normalize_svn_path(@_)
- sanitize_relative_path(@_)
- parse_filename($path)
- walk_content_tree($code)
- Load
- Dump
Build System
SunStarSys::View
single_narrative(%args)
Mandatory Arguments:
Optional Argmuents:
news_page(%args)
sitemap(%args)
Locale-specific, sorted index of dependencies.
Mandatory Arguments:
Optional Arguments:
asymptote(%args)
Builds and Caches asymptote
triple-backquoted-code blocks.
Mandatory Arguments:
skip(%args)
Don’t build these at all. Instead, build the associated generated source files (e.g. .bib\$lang
\$base.page/bibliography.yml\$lang
) to be built on a secondary build system run.
yml2ext(%args)
Convert YAML files.
Optional Arguments:
fetch_deps($path, $data, $quick)
Mandatory Arguments:
breadcrumbs($path)
Returns HTML breadcrumbs list for $path.
memoize(%args)
Caches the build; mainly used with fetch_deps and quick_deps > 2.
compress(%args)
Deprecated.
next_view(%args)
Utility for processing $args{view}.
ssi(%args)
Recursively evaluates ssi tags.
offline(%args)
Runs the next_view in offline mode.
snippet(%args)
Processes snippet lines.
reconstruct(%args)
Reprocesses Template directives in built content from next_view.
trim_local_links(%args)
Trims file extensions from local links.
normalize_links(%args)
Normalizes local links (./ and ../).
SunStarSys::Util
read_text_file($file, $out, $content_lines)
Parses headers+content of UTF-8 encoded file $file
and stores results in $out
. $content_lines
is the (optional) maximum number of content lines to read.
Returns actual number of lines read (including headers).
$file
may be a reference to a raw string, representing the full contents of a file. The results in $out
will still be UTF-8 encoded.
copy_if_newer($src, $dest)
Copies $src
to $dest
if the former’s modification timestamp is newer than the latter’s. On copy, additionally gzip-compresses the $dest
file if it’s a text file, and adds “.gz” extension to the name.
get_lock($lockfile)
Takes an exclusive (f)lock (for the current UNIX process) on $lockfile
.
shuffle(\@deck)
In-place random (Fisher-Yates) shuffle of @deck
.
sort_tables($content)
Sorts Markdown Tables in $content according to each table’s column spec. Exactly one column may be sorted per table, optionally numerically n
, in either descending v
or ascending ^
order.
fixup_code($prefix, $type, @_)
Strips $prefix from every arg in @_. The function of the $type argument is implementation specific, but is mainly used to seed the editor.md “mode” for processing this content in @_.
unload_package($pkg)
Aggressively unloads Perl package $pkg
from the Symbol Table (STASH).
purge_from_inc(@paths)
touch(@_)
Touches all files in @_
. If no args are passed, uses $_
.
normalize_svn_path(@_)
Normalizes all paths in @_
for safe use as raw arguments to SVN::Client
commands.
sanitize_relative_path(@_)
Secures paths in @_
for use as pure relative paths in Dotiac::DTL
(Django Template) path-specific commands.
parse_filename($path)
Wrapper around File::Basename::fileparse
. Without arguments, uses $_
as the filename to parse.
walk_content_tree($code)
Conditionally walks the ./content
tree of the build system checkout, first normalizing $_
as the formal subpath and then invoking $code
, on each item in the the treewalk.
archived($path)
Flags each Status: archive
$path
. Uses $_
if no args are passed.
seed_file_deps($path)
Updates %path::dependencies
for this $path
, based on its Dependencies
header glob(s). Defaults to using $_
as the path if no args are passed.
seed_file_acl($path)
Updates @path::acl
for this $path
, based on its ACL
header spec. Defaults to using $_
as the path if no args are passed.
Load
Same as YAML::XS::Load
.
Dump
Same as YAML::XS::Dump
.