-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering modularization #68
Conversation
Actually the case where you need to flush the cache is more complex than just a template change. Take the index, for example. It depends on the list of posts, so if you add a post, you need to re-render the index. The caching strategy should ideally handle that, even if you can force rendering with |
@melix I'll have a look at that when I finally get round to merging this in. |
Regarding the caching issue, I'm wondering if adding a Otherwise, I don't see any solution apart from removing caching. |
Sounds like a reasonable option to me. Oh and thanks for removing the license headers! |
Ok, I made the change, plus custom document types are now directly available from templates. For example, if you have a custom document type named |
What's the status of this PR? |
I'm aiming to get the v2.2.1 release out this weekend then this PR along with #67 will be included in the next release which is scheduled to be v2.3.0, ideally as soon as possible. |
I am wondering how I should proceed, because Maybe a branch for 2.3 would be a good idea, that would avoid PRs to stay open for too long and get outdated. You could then backport (cherry pick) changes that you want in master back in 2.3. |
@melix maybe it would be possible to split this up into several PRs, prioritise them and rework them on top of HEAD in priority order? That might not be less work, but it might make it easier for @jonbullock to merge in? I see at least 3 different features:
Personally, I'm most interested in incremental rendering, which would go great with watching for changes, so maybe I could help extract it, if you decide to do that? |
Well, the problem is at the very beginning. For example, the switch to pegdown broke parsing modularization, because it doesn't use the rework, of course. I don't want to redo the job multiple times, so I'd prefer doing a merge at some point. |
* if a JBake supported engine is not found on classpath, we must skip it too
* if a JBake supported engine is not found on classpath, we must skip it too * added an ErrorEngine so that the user gets nice error message on rendered page
…t needs to be rendered
* make use of OrientDB to store documents converted by parsers * support for incremental rendering if source file changed * prepare work for multiple document types * prepare work for multiple template engines
* Introduced abstract renderer * Freemarker is an implementation of a renderer * Renderer delegates to FreemarkerRenderer
* Renamed renderers to template engines (closer to the concept) * introduced a delegating template engine * separated Freemarker from core and made it optional * tags do not require the full list of docs in RAM anymore * renamed org.jbake.parser.Engines.properties to MarkupEngines.properties * "index", "archive" and "feed" are normal document types (config options are now optional)
* added GroovyTemplateEngine * GroovyRendererTest test case uses .gsp files equivalent to .ftl
* read from configuration file (template.[doctype].file)
* template change <=> force rendering of all documents * use SHA1 based hashing to compute a checksum of the templates directory * use the directory granularity because templates may include other templates
* Writer is more modular * allows the Groovy template engine to gain access to the other rendering engines * so you can do "include 'freemarker-template.ftl' from a Groovy template
* :jbake-cached: false inside Asciidoctor files * forces rendering of a page even if contents or template hasn't change * fix rendering of index * make all document types (including custom types) available from templates
Rebased onto master |
Thanks again. |
Hi!
This is a pretty big pull request that refreshes the rendering architecture. With this patch:
Comments welcome!