Move markdown to a PageParser
abstract base class.
#80
kjaymiller
started this conversation in
Ideas
Replies: 1 comment
-
perhaps |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently
content
(when unmodified) will only parse markdown.Also markdown is being passed directly into the page and much of the logic is designed only for markdown conversion.
To make pages more extensible pages should be designed to work with a
PageParser
object that uses Abstract Base Class to ensure that the Page object interacts with each parser the same way.Initial Attributes
raw_content
- same aspage.markdown
content_path
- same aspage.content_path
parser
- this is the configurable tool that will be used to modify theraw_content
parse
- this is using theparser
to convert theraw_content
orcontent_path
content and will be used bycontent
How to access a custom
ContentParser
I haven't quite figured out the best way to make passing in custom parsers easy.
My initial thought is to use the
page.__init__()
to require a parser and to have themarkdown
parser be the default if no parser is passed.The other alternative more similar to the current
Page
workflow is to create a Page object with the Parser property set to thePageParser
Working with Collections
The way that this would work with collections is that there needs to be a PageParser that is passed into the pages.
This would also make creating custom collections as well and I can definitely see a
CollectionParser
with the same setup.Beta Was this translation helpful? Give feedback.
All reactions