module

Markdown

Class methods

files_from(all_sources : Hash(Path, Hash(String, String)), &block : Hash(String, String), Path -> File | Nil) : Array(File)

Build one Markdown::File per entry of all_sources in parallel.

The block receives (sources, base) and returns a file or nil to skip it; it handles its own per-file error semantics (log-and-skip or raise). An exception escaping a worker is captured and re-raised after all entries were processed, so no error is lost.

Source
new_page(path)

Create a new "page" file

Source
new_post(path)

Create a new "post" file

Source
posts
Source
read_all(path)

Parse all markdown posts in a path and build Markdown::File objects out of them

Source
register(base : String, file : File)

Register a file in the global posts registry (thread-safe)

Source
render(posts, require_date = true, require_title = false)

Render given posts using given template

posts is an Array of Markdown::File if require_date is true, posts must have a date if require_title is true, posts must have a title ameba:disable Metrics/CyclomaticComplexity

Source
render_index(posts, output, title = nil, extra_inputs = [] of String, extra_feed = nil, main_feed = nil, lang = nil, feature_name = "posts", lang_style : Symbol = :file_suffix)

Create an index page out of a list of posts, save in output

Source
validate(posts, require_date = true)

Similar to self.render but it only validates correctness of posts without actually generating output

Source

Nested types