asciidoctor / asciidoctor-extensions-lab

A lab for testing and demonstrating Asciidoctor extensions. Please do not use this code in production. If you want to use one of these extensions in your application, create a new project, import the code, and distribute it as a RubyGem. You can then request to make it a top-level project under the Asciidoctor organization.
Other
104 stars 101 forks source link

Rendering dlists with multipage.rb #73

Closed arthur24b6 closed 2 years ago

arthur24b6 commented 7 years ago

I'm using the multipage converter to create chunked output. I ran into some issues trying to get the following markup to render properly:

##### Example title

pipeline.<name>.example::

Example text
+
*Required.*
+
.Example
----
# pipeline configuration
pipeline.example.quorum = \
----

I'd only get the title of this in the output. I think this can be addressed by the reparenting function here: https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/multipage-html5-converter.rb#L60. I think it maybe sufficient to add something like:

      if block.context == :dlist
        block.parent = parent
      end

after the recursive call to reparent. Adding that I started getting the output that I expected. Not sure if this is the right approach.

arthur24b6 commented 7 years ago

It also seems to be the case that any blocks on the dlist need to be reparented as well:

      if block.context == :dlist
        block.parent = parent
        block.items.each do |i|
          if i[1].respond_to? 'parent'
            reparent i[1], parent
          end
        end
      end
bsmith-n4 commented 6 years ago

Thanks @arthur24b6, this also works for me.

mojavelinux commented 2 years ago

The multipage converter has be relocated to https://github.com/owenh000/asciidoctor-multipage. Please test using that converter. If the problem still exists, open an issue in that project.