mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
* Add Bootstrap Extension * Rename main.yml * Artifact Upload * Fix Bootstrap Reference Error * BootstrapTreeProcessor * getiterator removed * keys function * Style Images * Update docs_build.yml * Added Meta Files * Template Get * Fix Page Ref * Update BASE_URL * Sort Schemas * Add Sitemaps * Add favicons, open-graph, and setup guide * Update Setup.md * Update .gitignore * Update Setup.md * Use _blank on external links * Restructured Docs * Fix Links * Added XML Schemas * Name XML Schemas
25 lines
761 B
Python
25 lines
761 B
Python
from abc import ABC
|
|
from pathlib import Path
|
|
|
|
from jinja2 import Template, Environment
|
|
|
|
from lib.Content.AbstractTemplatedItem import AbstractTemplatedItem
|
|
|
|
|
|
class AbstractSchemaItem(AbstractTemplatedItem, ABC):
|
|
root_dir = Path('schemas/')
|
|
|
|
def __init__(self, in_path: Path):
|
|
super().__init__(in_path)
|
|
self.out_path = Path('out/schemas/', self.out_path.relative_to('out'))
|
|
|
|
@classmethod
|
|
def initialize(cls, env: Environment):
|
|
new_pages = super(AbstractSchemaItem, cls).initialize(env)
|
|
for page in new_pages:
|
|
page.out_path = page.out_path.with_stem(page.title.replace(" ", "_").lower())
|
|
return new_pages
|
|
|
|
def render(self, template: Template, **context):
|
|
raise NotImplementedError()
|