Code Monkey home page Code Monkey logo

Comments (7)

ggrossetie avatar ggrossetie commented on August 20, 2024

@mojavelinux can you please assign me on this issue ?

from asciidoctor-extensions-lab.

ggrossetie avatar ggrossetie commented on August 20, 2024

I'm back on extension but I got an error:

/home/mogztter/.rvm/gems/ruby-1.9.3-p429/gems/asciidoctor-1.5.2/lib/asciidoctor/extensions.rb:66:in `use_dsl': undefined method `nil_or_empty?' for "ChartBlockMacro":String (NoMethodError)

I didn't change the code and I know this is supposed to be working because there's a test in Asciidoctor core: https://github.com/asciidoctor/asciidoctor/blob/master/test/extensions_test.rb#L88

Maybe related to asciidoctor/asciidoctor@9fdf6bd ?

I think we need to add tests to this project. When I come back on this project I always spend some time writing a dummy test.rb file to be able to test my extension. Maybe we can reuse the Asciidoctor test harness ?

from asciidoctor-extensions-lab.

ggrossetie avatar ggrossetie commented on August 20, 2024

This is working with CLI asciidoctor lib/chart-block-macro/sample.adoc -r 'chart-block-macro' --load-path lib

My test.rb:

require_relative 'lib/chart-block-macro'

Asciidoctor.render_file 'lib/chart-block-macro/sample.adoc', :safe => :safe, :in_place => true

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on August 20, 2024

Maybe we can reuse the Asciidoctor test harness?

That's a pretty bad foundation...which I plan to eventually overhaul. What we could do is reuse the cucumber tests here:

https://github.com/asciidoctor/asciidoctor/tree/master/features

We just need to pick one of the proposed approaches and stick with it. I find it the best way to express the inputs and outputs. Keep in mind, if it applies, we can also use the Asciidoctor doctest.

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on August 20, 2024

This is working with CLI asciidoctor lib/chart-block-macro/sample.adoc -r 'chart-block-macro' --load-path lib

The -r flag has to be a path relative to the load path. Thus, you can either modify the load path, as you have done, or you can specify a qualified relative path:

asciidoctor -r ./lib/chart-block-macro lib/chart-block-macro/sample.adoc

Of course, if we get to the point of installing it as a gem, then it will already be on the load path...so you can reduce it to -r chart-block-macro or whatever we call the gem.

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on August 20, 2024

This is truly excellent! Let's proceed!

from asciidoctor-extensions-lab.

mojavelinux avatar mojavelinux commented on August 20, 2024

Note that the chart extension now lives in it's own repository. See https://github.com/asciidoctor/asciidoctor-chart.

from asciidoctor-extensions-lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.