- The objective is to add an efficient way for the author to include question and answer capabilities in articles.
- The association between the question and the answer should be clear to the author, the reader, and the computer.
- The reader should have the answer hidden by default with the possibility to make it visible.
- For a given article, there should be a way to make all answers visible or hidden.
An author may add a question/answer element just like any other HTML element using this markup:
The UUIDs
are generated: the author does not have to care about them. Rendered into the page, we have:
Arbitrary markup for the question.
Arbitrary markup for the answer.
The association between question and answer is clear to:
- the author since there is
x-qa
markup that explicitly defines the associations; - the reader since one appears just after the other and reacts to the
show
andhide
buttons; - the computer since the
x-qa
markup is parsed where the first leaf is the question and others are answers. The association is made independent of human interpretations thanks to the UUIDs.