You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from lamya.config import Config as DefaultConfig
from lamya.site_generator import SiteGenerator
class Config(DefaultConfig):
name = "dontpanic"
url = "https://dont.panic"
subtitle="we demand rigidly defined areas of doubt and uncertainty",
content_directory="content",
theme_options = {
"sidebar": True,
"sidebar_image": "/img/sidebar.png"
}
site_gen = SiteGenerator.run_from_config(Config(), render=False)```
Maybe consider less inheriting:
DEFAULT_CONFIG=Config(
name="dontpanic"url="https://dont.panic"subtitle="we demand rigidly defined areas of doubt and uncertainty",
content_directory="content",
theme_options= {
"sidebar": True,
"sidebar_image": "/img/sidebar.png"
}
site_gen=SiteGenerator.run_from_config(DEFAULT_CONFIG, render=False)
The text was updated successfully, but these errors were encountered:
Oh, thanks a lot for bringing this up, I haven't seen the dataclasses before, but they look great! They remind me a lot of Haskell's data structures, which I really like and they seem very appropriate for a config class.
I've had a quick go at converting the Config class to use them, is this - 35a65fb - what you had in mind?
One thing I really don't like about dataclasses, though, is that they require type hints, which I am not a fan of. If I am to merge this in I am considering using one of the cheats in Dataclasses without type annotations.
Maybe consider less inheriting:
The text was updated successfully, but these errors were encountered: