Module

content_types.strategies

Concrete content type strategies.

Implements specific strategies for different content types like blog, docs, etc.

Classes

BlogStrategy
Strategy for blog/news content with chronological ordering.
3

Strategy for blog/news content with chronological ordering.

Inherits from ContentTypeStrategy

Methods 3

sort_pages
Sort by date (newest first).
1 list[Page]
def sort_pages(self, pages: list[Page]) -> list[Page]

Sort by date (newest first).

Parameters 1
pages list[Page]
Returns

list[Page]

detect_from_section
Detect blog sections by name or date-heavy content.
1 bool
def detect_from_section(self, section: Section) -> bool

Detect blog sections by name or date-heavy content.

Parameters 1
section Section
Returns

bool

get_template
Blog-specific template selection.
2 str
def get_template(self, page: Page | None = None, template_engine: Any | None = None) -> str

Blog-specific template selection.

Parameters 2
page Page | None
template_engine Any | None
Returns

str

ArchiveStrategy
Strategy for archive/chronological content. Similar to blog but uses simpler archive template.
0

Strategy for archive/chronological content.

Similar to blog but uses simpler archive template.

Inherits from BlogStrategy
DocsStrategy
Strategy for documentation with weight-based ordering.
3

Strategy for documentation with weight-based ordering.

Inherits from ContentTypeStrategy

Methods 3

sort_pages
Sort by weight, then title (keeps manual ordering).
1 list[Page]
def sort_pages(self, pages: list[Page]) -> list[Page]

Sort by weight, then title (keeps manual ordering).

Parameters 1
pages list[Page]
Returns

list[Page]

detect_from_section
Detect docs sections by name.
1 bool
def detect_from_section(self, section: Section) -> bool

Detect docs sections by name.

Parameters 1
section Section
Returns

bool

get_template
Docs-specific template selection.
2 str
def get_template(self, page: Page | None = None, template_engine: Any | None = None) -> str

Docs-specific template selection.

Parameters 2
page Page | None
template_engine Any | None
Returns

str

ApiReferenceStrategy
Strategy for API reference documentation.
3

Strategy for API reference documentation.

Inherits from ContentTypeStrategy

Methods 3

sort_pages
Keep original discovery order (alphabetical).
1 list[Page]
def sort_pages(self, pages: list[Page]) -> list[Page]

Keep original discovery order (alphabetical).

Parameters 1
pages list[Page]
Returns

list[Page]

detect_from_section
Detect API sections by name or content.
1 bool
def detect_from_section(self, section: Section) -> bool

Detect API sections by name or content.

Parameters 1
section Section
Returns

bool

get_template
API reference-specific template selection.
2 str
def get_template(self, page: Page | None = None, template_engine: Any | None = None) -> str

API reference-specific template selection.

Parameters 2
page Page | None
template_engine Any | None
Returns

str

CliReferenceStrategy
Strategy for CLI reference documentation.
3

Strategy for CLI reference documentation.

Inherits from ContentTypeStrategy

Methods 3

sort_pages
Keep original discovery order (alphabetical).
1 list[Page]
def sort_pages(self, pages: list[Page]) -> list[Page]

Keep original discovery order (alphabetical).

Parameters 1
pages list[Page]
Returns

list[Page]

detect_from_section
Detect CLI sections by name or content.
1 bool
def detect_from_section(self, section: Section) -> bool

Detect CLI sections by name or content.

Parameters 1
section Section
Returns

bool

get_template
CLI reference-specific template selection.
2 str
def get_template(self, page: Page | None = None, template_engine: Any | None = None) -> str

CLI reference-specific template selection.

Parameters 2
page Page | None
template_engine Any | None
Returns

str

TutorialStrategy
Strategy for tutorial content.
2

Strategy for tutorial content.

Inherits from ContentTypeStrategy

Methods 2

sort_pages
Sort by weight (for sequential tutorials).
1 list[Page]
def sort_pages(self, pages: list[Page]) -> list[Page]

Sort by weight (for sequential tutorials).

Parameters 1
pages list[Page]
Returns

list[Page]

detect_from_section
Detect tutorial sections by name.
1 bool
def detect_from_section(self, section: Section) -> bool

Detect tutorial sections by name.

Parameters 1
section Section
Returns

bool

ChangelogStrategy
Strategy for changelog/release notes with chronological timeline.
2

Strategy for changelog/release notes with chronological timeline.

Inherits from ContentTypeStrategy

Methods 2

sort_pages
Sort by date (newest first), then by title descending (for same-day releases).
1 list[Page]
def sort_pages(self, pages: list[Page]) -> list[Page]

Sort by date (newest first), then by title descending (for same-day releases).

Parameters 1
pages list[Page]
Returns

list[Page]

detect_from_section
Detect changelog sections by name.
1 bool
def detect_from_section(self, section: Section) -> bool

Detect changelog sections by name.

Parameters 1
section Section
Returns

bool

PageStrategy
Default strategy for generic pages.
1

Default strategy for generic pages.

Inherits from ContentTypeStrategy

Methods 1

sort_pages
Sort by weight, then title.
1 list[Page]
def sort_pages(self, pages: list[Page]) -> list[Page]

Sort by weight, then title.

Parameters 1
pages list[Page]
Returns

list[Page]