mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-02-12 09:19:01 +00:00
22 lines
528 B
Ruby
22 lines
528 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ChatBlock < Asciidoctor::Extensions::BlockProcessor
|
|
use_dsl
|
|
|
|
named :chat
|
|
on_context :example
|
|
name_positional_attributes 'avatar', 'state'
|
|
default_attributes 'state' => 'default', 'avatarstype' => 'webp'
|
|
|
|
# TODO: Create the output.
|
|
def process(parent, reader, attrs)
|
|
block = create_block parent, :pass, nil, attrs, content_model: :compound
|
|
block.add_role('dialogblock')
|
|
|
|
attrs['name'] ||= attrs['avatar']
|
|
attrs['avatarsdir'] ||= './avatars'
|
|
|
|
block
|
|
end
|
|
end
|