taika.ext.excerpt – Documents excerpts

This extensions creates a excerpt for the documents based on it’s content.

Event

This extension is subscribed to the “doc-post-read” event.

Frontmatter

excerpt_separator(str)

Use this separator instead of the global separator defined in the configuration.

Configuration

excerpt_separator: <!-- read-more -->
excerpt_separator(str)

Default: None

A string that will be used as excerpt separator. Default to None so no excerpt will be generated.

Process

  1. Check for the frontmatter option, otherwise use the global or the default separator.
  2. If separator is None, the first <p> tag is retrieved if existent.
  3. If the first <p> tag is not found, \n\n (double line separator) is used as separator.
  4. If separator is something, the text before that separator is retrieved if existent.
  5. The excerpt is inserted into the document so it will be accessible.

Classes and Functions

get_excerpt(site, document)[source]
setup(site)[source]