In fact, it's possible to pass a custom template as a string in 1.5.0. One way to do it is to load the document, register a string-based template for a given context, then convert.
[source,ruby]
----
require 'asciidoctor'
require 'asciidoctor/extensions'
require 'tilt'
paragraph_template = Tilt.new 'paragraph.html.slim' do |t|
<<-EOS
p=content
EOS
end
doc = Asciidoctor.load 'paragraph', template_dirs: []
doc.converter.converters.first.register 'paragraph', paragraph_template
puts doc.convert
----
Another way is to use the converter factory directly to create a composite converter with the string-based template preregistered, then pass the converter as an option to the Asciidoctor API:
[source,ruby]
----
converter = Asciidoctor::Converter::Factory.default.create 'html5', template_dirs: []
converter.converters.first.register 'paragraph', paragraph_template
puts Asciidoctor.convert 'paragraph', converter: converter
----
I agree the register method should be easier to call. That's going to need to be filed as a request for enhancement. We might be able to use some Ruby metaprogramming to delegate methods intelligently from the composite to the underlying converter.
Btw, I still have plans to integrate the convert API into the extension APIs so that they can be registered globally like extensions.
Cheers,
-Dan