mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-01-31 04:58:26 +00:00
chat-block-processor: create the initial HTML output
This commit is contained in:
parent
e3231fb0b2
commit
cbc759a544
@ -8,7 +8,6 @@ class ChatBlock < Asciidoctor::Extensions::BlockProcessor
|
||||
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')
|
||||
@ -16,6 +15,17 @@ class ChatBlock < Asciidoctor::Extensions::BlockProcessor
|
||||
attrs['name'] ||= attrs['avatar']
|
||||
attrs['avatarsdir'] ||= './avatars'
|
||||
|
||||
block << (create_block block, :pass, %(
|
||||
<div class="dialogblock dialogblock__box dialogblock__avatar--#{attrs['avatar']} #{attrs['role']}" title="#{attrs['avatar']}">
|
||||
<div class="dialogblock dialogblock__avatar">
|
||||
# Image
|
||||
</div>
|
||||
<div class="dialogblock dialogblock__text">
|
||||
# Content
|
||||
</div>
|
||||
</div>
|
||||
), nil)
|
||||
|
||||
block
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user