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
105 stars 101 forks source link

fix missing require in showcomments #83

Closed maxandersen closed 6 years ago

maxandersen commented 6 years ago

There was no proper requires in showcomments extension which made it fail.

Added proper requires and now it works when you run (note the -a showcomments):

asciidoctor -r ./lib/showcomments-preprocessor.rb -a showcomments lib/showcomments-preprocessor/sample.adoc

fixes #82

mojavelinux commented 6 years ago

Right you are!

Normally, you don't need to require the extensions since it gets autoloaded. But autoload only triggers if you use the qualified classname, Asciidoctor::Extensions. The technique used in this file to shorten classnames causes autoload to be bypassed. I was not aware of that.