Login  Register

Re: [asciidoctor-java-integration] Add POJO resolution in AsciiDoc

Posted by LightGuardjp on May 11, 2013; 9:28pm
URL: https://discuss.asciidoctor.org/Re-asciidoctor-java-integration-Add-POJO-resolution-in-AsciiDoc-tp195.html

A more complete solution would be for Asciidoctor core (the ruby code) to support a context which it would use to resolve interpolation. We could then plugin all sorts of things: pojos, hashes, json, etc. 

Sent from Mailbox for iPhone


On Sat, May 11, 2013 at 11:30 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:

I was thinking if it don't be  a nice new feature for asciidoctor-java-integration project to add a module to resolve POJO variables to Asciidoctor attributes. I am thinking for example in next use case:

A school wants to prepare typical filling the gap exams, they could prepare the exam in AsciiDoc, the exam is presented to students online, they fill the gaps, these information is stored into a POJO, and then when teaches wants to correct the exams, the same AsciiDoc file can be used and filled with the POJO values.

So for example (an yes it is at high level don't want to go too deep) we can have something like:

class Exam {
  Student student;
  String answer1;
}


and our AsciiDoc:

= Exam

Student Name: {student.name}

== Questions

What year did man first land on the moon ?
Ansswer: {answer1}


Then using an special render module on asciidoctor-java-integration project with a given instance and document, an output is produced.

Of course when Asciidoctor supports checkboxes (https://github.com/asciidoctor/asciidoctor/issues/200) more kind of questions could be done.

Also this works with for example typical forms that should be filled by users.

What you think, has it sense this feature?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/asciidoctor-java-integration-Add-POJO-resolution-in-AsciiDoc-tp194.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML