Implement Fieldmanager_Content, Plaintext, HTML, and Markdown#781
Implement Fieldmanager_Content, Plaintext, HTML, and Markdown#781
Conversation
|
Some drive-by comments...
|
|
@dlh01, thanks David, I've split out I like your point about loading files, but I think new Fieldmanager_Markdown(
[
'content' => file_get_contents( __DIR__ . '/readme.md' ),
]
); |
|
@jameswburke I like this new direction. I think it would be beneficial for the three classes to share an abstract class. An abstract class would DRY up the code a bit and make it easier for a third party to add their own variant, e.g. if someone wanted to add their own |
|
|
…leyinteractive/wordpress-fieldmanager into feature/FLAME-113/content-field
|
Updated autoload approach to support a |
mboynes
left a comment
There was a problem hiding this comment.
A few more changes then it looks good to me to ship!
Co-authored-by: Matthew Boynes <mboynes+git@alley.co>
Co-authored-by: Matthew Boynes <mboynes+git@alley.co>
Co-authored-by: Matthew Boynes <mboynes+git@alley.co>
Co-authored-by: Matthew Boynes <mboynes+git@alley.co>
…leyinteractive/wordpress-fieldmanager into feature/FLAME-113/content-field
dlh01
left a comment
There was a problem hiding this comment.
This looks good to me, too. I've noted a few documentation issues to tidy up, along with a couple of other suggestions.
I'm still a little hesitant about some of the class naming, although I think we can still merge this and revisit before release.
Fieldmanager_Markup is ambiguous to me; Matt gave the example of a child class that renders Textile, and Textile is also a markup language.
Also, leaving out the _Content_ prefix from the child class names is potentially cutting us off from the obvious name of a future field that is designed to actually save Markdown, or whatever. The context classes are Fieldmanager_Context_*; the datasource classes are Fieldmanager_Datasource_*; maybe these should be Fieldmanager_Content_*.
Summary
Implements an abstract
Fieldmanager_Contentclass, and 3 implementations that supports rendering static text (Fieldmanager_Content_Plaintext), html (Fieldmanager_Content_Markup), and markdown (Fieldmanager_Content_Markdown).Notes for reviewers
Questions for reviewer,
Parsedown()be included differently? Perhaps composer, or a different directory?Changelog entries
Fieldmanager_Contentabstract class.Fieldmanager_Content_Plaintext,Fieldmanager_Content_Markup, andFieldmanager_Content_Markdownclasses and unit tests.Ticket
https://alleyinteractive.atlassian.net/browse/FLAME-113