Conversation
There was a problem hiding this comment.
I'd rather you set _data to None (either in __init__ or in the class definition) and check for None. Functionally equivalent an plays much better with with refactoring tools.
|
Hi @jammon, and thanks for taking the time to contribute, I commented on the times themselves, but here are more generic comments:
Note that we might not want to risk breaking compatibility with existing sites. Cheers, |
|
|
Thanks, I'll look into those changes into more detail over the weekend (don't have more time right now unfortunately). Regarding the behavior change to the context system. Unfortunately there may be users relying on the old system, and I'm not big on just breaking backwards compatibility like this. I understand your expectations might differ (and I'd personally share your POV here), and that the Python Markdown extension processes metadata differently, but that doesn't mean Cactus has to do so as well (we don't really use Python Markdown for starters). I think the right approach here would be to break this system out of Thoughts? |
|
The specs of markdown2 metadata extra look even different. Putting the metadata / page context into a plugin is probably the right way. |
|
I'll close this PR since you're working on #141 instead. Thanks! |
This changes the behavior of
SiteandPagein several subtle aspects.Sitebuilds the list of pages only whenSite._build_page_listis called and not wheneverSite.pages()is accessed.Pagereads the page file only once and not wheneverPage.data()is accessed.Pageand is no more passed around as an argument.Page.parse_contextis changed to work more like I expected: The context data starts at the top of the file and the content starts after the first blank line or with the first line, that doesn't contain a colon.