Closed jammon closed 9 years ago
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,
Site.pages()
.tests/data/colon-in-the-first-line.html
) that fails in the old system and fixed that behaviour. Now I even found a specification for the metadata extension of Python Markdown that describes what I had in mind.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 Page
and into a plugin, and make it optional but enabled by default.
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
Site
andPage
in several subtle aspects.Site
builds the list of pages only whenSite._build_page_list
is called and not wheneverSite.pages()
is accessed.Page
reads the page file only once and not wheneverPage.data()
is accessed.Page
and is no more passed around as an argument.Page.parse_context
is 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.