Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Exporters / Sources #597
See #597 (comment) for latest plan.
Would it be useful to have a 'generic export hook / command' that allows you to loop all documents as they exist just before they would be written to
I imagine this to be a separate
particularly: I wanted a way to quickly generate the accurate set of meta-data properties of all documents. Since these meta-data properties may be enriched by all kinds of hooks there needs to be a reliable way to process the documents as they normally would. I.e: all hooks capable of changing the meta-data when doing a
I've quickly hacked the following (a separate node project which includes docpad) which seems to run most (?) of the needed hooks before it loops the documents. It seems to run okay and obviously is blistering fast since if skips all the actual writes:
I think it wouldn't require that much work to make this into something more robust. Would there be any interest for such a feature?
Yes. There should be a way to dump the queryEngine in memory database to a persistent database.
In many of my use cases I just want to perform queries on the generated database. Parsing the documents files and writing them in /out are loooong steps that could be avoided.
The way we have planned to get this working is in a few parts:
The first was getting importers done, that's now completed.
The second is turning the file system interactions into just another importer/exporter. This was reveleaved a bit in the architeture vision here - #543 - but not covered in detail.
Essentially, what we need to do is move away from the current class & code based structure of the models, and turn them more into data stores and event mediators that plugins can then subscribe to.
Support for additional importers/exporters - perhaps we should just call them datastores instead! - would make this a lot easier.
One thing that needs to happen for this to be the case is we also need to allow better support for background rendering, or rather just in time rendering, or rather as you need it rendering. Right now rendering everything in one go is good for static site generation, but not good if you are running a dynamic server which is becoming an increasing use case.
This approach no longer makes sense. See here for the latest thoughts: https://discuss.bevry.me/t/docpad-architecture-vision-2015/569?u=balupton