9f0a216c5e
- Created index.html template for the homepage with service cards and partner logos. - Added page_from_md.html template for rendering pages from markdown. - Developed services.html template detailing various services offered. - Implemented tests for link handling in markdown, ensuring external links open in new tabs and internal links function correctly. - Enhanced markdown parser tests to validate heading extraction, content rendering, and link safety. - Introduced utility tests for template rendering, HTML minification, and JavaScript minification. Co-authored-by: Copilot <copilot@github.com>
55 lines
964 B
Python
55 lines
964 B
Python
from typing import TypedDict, List, Dict, Optional
|
|
|
|
|
|
class Detail(TypedDict):
|
|
title: str
|
|
content: str
|
|
|
|
|
|
class Card(TypedDict, total=False):
|
|
title: str
|
|
content: str
|
|
details: List[Detail]
|
|
|
|
|
|
class Section(TypedDict):
|
|
title: str
|
|
content: str
|
|
cards: List[Card]
|
|
|
|
|
|
class PageData(TypedDict):
|
|
title: Optional[str]
|
|
sections: List[Section]
|
|
|
|
|
|
class PageMeta(TypedDict, total=False):
|
|
title: str
|
|
description: str
|
|
keywords: str
|
|
og_description: str
|
|
favicon: str
|
|
twitter_image: str
|
|
og_image: str
|
|
|
|
|
|
class PageEntry(TypedDict, total=False):
|
|
page_title: str
|
|
page_subtitle: str
|
|
page_cta: str
|
|
page_cta_url: str
|
|
meta: PageMeta
|
|
active: bool
|
|
|
|
|
|
PagesDict = Dict[str, PageEntry]
|
|
|
|
|
|
class ParserState(TypedDict):
|
|
page: PageData
|
|
current_section: Optional[Section]
|
|
current_card: Optional[Card]
|
|
current_detail: Optional[Detail]
|
|
content_buffer: List[str]
|
|
detail_buffer: List[str]
|