asciidoctor / asciidoctor.org

:globe_with_meridians: Asciidoctor project site. Composed in AsciiDoc. Baked with Awestruct.
https://asciidoctor.org
Other
322 stars 805 forks source link

Emend demo code for registering treeprocessor #785

Closed andrewcarver closed 6 years ago

andrewcarver commented 6 years ago

I don't think having a |document| parameter is correct here, for the code-block passed to Asciidoctor::Extensions.register ...?? (It didn't work when I tried it, anyway--but I'm not sure why! :)

mojavelinux commented 6 years ago

You are correct. This is a remnant of an earlier design. The document is accessible via the registry, which is the optional first argument of the block.

Asciidoctor::Extensions.register do |registry|
  puts registry.document
end
mojavelinux commented 6 years ago

Thanks!