-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into GH-76_core_functionality_tests
- Loading branch information
Showing
18 changed files
with
248 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
--- | ||
template: base.jinja.html | ||
footnote: Generated with Anchovy! | ||
--- | ||
|
||
# Welcome to Example Site 1! | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
template: base.jinja.html | ||
footnote: Generated with Anchovy! | ||
--- | ||
template = "base.jinja.html" | ||
footnote = "Generated with Anchovy!" | ||
--- | ||
|
||
# Photo Gallery | ||
|
||
<div class="gallery"> | ||
<a href="static/images/home-sweet-home-cdk.webp"><img src="static/images/home-sweet-home-cdk.thumb.png" alt="A Vintage Automobile"></a> | ||
<a href="static/images/nice-wheels-cdk.webp"><img src="static/images/nice-wheels-cdk.thumb.png" alt="A Old Wood-Sided House"></a> | ||
<a href="static/images/stormy-cdk.webp"><img src="static/images/stormy-cdk.thumb.png" alt="A Boardwalk and Damaged Pines During a Storm"></a> | ||
<a href="static/images/quayside-newcastle.webp"><img src="static/images/quayside-newcastle.thumb.png" alt="A Quay in Newcastle, England"></a> | ||
<a href="static/images/home-sweet-home-cdk.webp"><img src="static/images/home-sweet-home-cdk.thumb.webp" alt="A Vintage Automobile"></a> | ||
<a href="static/images/nice-wheels-cdk.webp"><img src="static/images/nice-wheels-cdk.thumb.webp" alt="A Old Wood-Sided House"></a> | ||
<a href="static/images/stormy-cdk.webp"><img src="static/images/stormy-cdk.thumb.webp" alt="A Boardwalk and Damaged Pines During a Storm"></a> | ||
<a href="static/images/quayside-newcastle.webp"><img src="static/images/quayside-newcastle.thumb.webp" alt="A Quay in Newcastle, England"></a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import sys | ||
import typing as t | ||
|
||
|
||
def simple_frontmatter_parser(content: str) -> dict: | ||
""" | ||
Read metadata from the front of a markdown-formatted text in a very simple | ||
YAML-like format, without value parsing. | ||
""" | ||
meta = {} | ||
lines = content.splitlines() | ||
|
||
for line in lines: | ||
if ':' not in line: | ||
break | ||
key, value = line.split(':', 1) | ||
if not key.isidentifier(): | ||
break | ||
meta[key.strip()] = value.strip() | ||
|
||
print(meta, '...') | ||
return meta | ||
|
||
|
||
def get_toml_frontmatter_parser(): | ||
if sys.version_info < (3, 11): | ||
import tomli as tomllib | ||
else: | ||
import tomllib | ||
return tomllib.loads | ||
|
||
|
||
def get_yaml_frontmatter_parser(): | ||
from ruamel.yaml import YAML | ||
return YAML(typ='safe').load | ||
|
||
|
||
FrontMatterParser = t.Callable[[str], dict] | ||
FrontMatterParserName = t.Literal['simple', 'toml', 'yaml'] | ||
|
||
FRONTMATTER_PARSER_FACTORIES: dict[FrontMatterParserName, t.Callable[[], FrontMatterParser]] = { | ||
'simple': lambda: simple_frontmatter_parser, | ||
'toml': get_toml_frontmatter_parser, | ||
'yaml': get_yaml_frontmatter_parser, | ||
} | ||
|
||
|
||
def get_frontmatter_parser(parser) -> FrontMatterParser: | ||
if callable(parser): | ||
return parser | ||
return FRONTMATTER_PARSER_FACTORIES[parser]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.