There are two options to install Asciidoctor Question. The first is to use gem install
on the command line:
$ gem install asciidoctor-question
The second is to add the following entry to your project’s Gemfile.
gem 'asciidoctor-question', '~> 0.5'
and execute bundle
in the command line.
$ bundle
To update asciidoctor-question
type
$ gem update asciidoctor-question
A question is written inside a literal block, which needs two attributes.
[question, question-type] // (1) (2)
.... // (3)
Question in appropriate syntax
....
-
The first positional attribute in the attribute list specifies that this block is a question.
-
The second positional attribute defines the type of this question (mc or gap)
-
Place the attribute list directly on top of the delimited literal block (....). You can also use an example (====) or open block (
--
) as an alternative.
The following question types are available:
Question Type | input | output |
---|---|---|
mc |
[question, mc]
....
Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua.
- [X] ipsum
- [ ] eltir
- [X] ut
.... |
|
gap |
[question, gap]
....
At vero eos et __accusam__ et justo
duo dolores et ea rebum. Stet clita
kasd gubergren, no sea __takimata
sanctus est Lorem__ ipsum dolor sit
amet. Lorem __ipsum dolor sit amet__,
consetetur sadipscing elitr, sed diam
nonumy __eirmod tempor invidunt__ ut
labore et dolore magna aliquyam erat,
sed diam voluptua.
.... |
You can load Asciidoctor question in a terminal using the -r
flag.
$ asciidoctor -r asciidoctor-question sample.adoc
You can also use Asciidoctor question with other converters, such as Asciidoctor PDF.
Asciidoctor-pdf is also loaded with the -r
flag.
$ asciidoctor -r asciidoctor-question -r asciidoctor-pdf -b pdf sample.adoc
Or, you can invoke Asciidoctor and the PDF converter with the asciidoctor-pdf
command.
The command implicitly sets the -r
and -b
flags for PDF output.
$ asciidoctor-pdf -r asciidoctor-question sample.adoc