Sign in

    himeno/mopress/summary does not have a README file

    ArticleIndex

    pub(all) struct ArticleIndex {
    title : String
    location : String
    content : String
    } derive(Eq, ToJson,
    Debug
    )

    A single article's indexed content, e.g. for building a client-side search index over the site's pages.

    Summary

    pub(all) struct Summary {
    title : String
    prefix_chapters : Array[SummaryItem]
    numbered_chapters : Array[SummaryItem]
    suffix_chapters : Array[SummaryItem]
    } derive(Eq,
    Debug
    )

    The parsed structure of a book's table of contents (SUMMARY.md), split into an optional prefix section, the main numbered chapters, and an optional suffix section — mirroring the conventional structure of an mdBook-style summary file.

    Summary::breadcrumb

    fn Summary::breadcrumb(self : Summary, current : String) -> String

    Returns a breadcrumb string describing the path from the root of the table of contents down to the chapter located at location.

    Summary::flatten

    fn Summary::flatten(self : Summary, current : String, base_url : String) -> Json

    Returns a JSON representation of this summary, rooted at location, e.g. for use as a template variable describing the current section's navigation structure.

    Summary::index_articles

    fn Summary::index_articles(self : Summary, src : String) -> Array[ArticleIndex] raise

    Builds a search/content index over all articles reachable from this summary, reading each article's source file from src.

    Raises if any referenced article's source file cannot be read.

    Summary::prev_next

    fn Summary::prev_next(self : Summary, current : String) -> ((String, String)?, (String, String)?)

    Returns the previous and next chapter (as (title, location) pairs), relative to the chapter located at location, according to this summary's chapter ordering. Either value is None if there is no previous/next chapter (e.g. at the start or end of the book).

    SummaryItem

    pub(all) enum SummaryItem {
    Link(SummaryLink)
    PartTitle(String)
    Separator
    } derive(Eq,
    Debug
    )

    A single entry in a table of contents.
    pub(all) struct SummaryLink {
    title : String
    location : String
    source : String
    nested_items : Array[SummaryItem]
    } derive(Eq,
    Debug
    )

    A single chapter link in a table of contents.

    md_to_plain

    fn md_to_plain(input : String) -> String

    Renders a Markdown string to its plain-text representation (stripping all Markdown/HTML markup), e.g. for use in generating search indexes or previews from summary/article content.

    parse_summary

    Parses a book's SUMMARY.md (already parsed into a Markdown AST) into its structured Summary representation.

    Source Files