Closed WriteCodeEveryday closed 4 years ago
Docassemble templates "trigger" the questions needed to define them--it works backwards to figure out what questions it needs based on any mandatory questions, including the final output document.
Unlike platforms like HotDocs, "templates" are kind of incidental to how docassemble works, too. There's no higher level concept for the docassemble engine to know that you are generating 1, 2, or zero templates. You need to implement that logic in the interview YAML.
That means a "preview" feature means working around that part of docassemble or adding in new awareness of the final goal of the document. It's doable, but requires changing how you generate the output. If you are generating a PDF, you can use the skip undefined
option so that the document can be displayed at any level of completeness. There is an option that is rarely used to fill in Docx files with a list of fields, too, and you can use skip undefined
there (but it really makes using a docx more tedious). There's no similar built-in way to handle generating a markdown template without filling in every field.
If you want to do this, I think it would end up being possible with a framework you built around your workflow, but not in the docassemble core.
If i understand your question correctly, this might help: https://docassemble.org/docs/recipes.html#preview
This is exactly what I was looking for... you guys are awesome.
I would like to allow a user to see a preview as they fill out the interview.
It would be amazing if this just a PDF preview below the question (or one PDF per document the interview can fill out).
I checked the documentation but didn't find anything like this.
Edit: Realtime is subjective, it can actually just be a preview of all questions before the current one.