Git Product home page Git Product logo

Comments (3)

jechlin avatar jechlin commented on June 19, 2024

NB... had a crack at this myself:

com.sysgears.grain.markup.asciidoc.AsciiDoctorProcessor#process:

    public String process(String source) {
        def opts = config.asciidoc?.opts ?: [ "source-highlighter": "coderay" ]
        ruby.rpc.with {
            AsciidocBridge.convert(source, opts)
        }
    }

tools/asciidoc-bridge/asciidoc_bridge.rb:

  def convert(source, opts)
    begin
      return Asciidoctor.convert(source, :safe => 0, :attributes => opts)

but for some reason it's not working, even though I've added logging and it looks like the right things are being passed through.

When I say not working I mean it's not picking up icon:font, although when I hard-code in the .rb file it works. May be a conversion issue between LinkedHashMap and ruby hash? I know almost nothing about ruby.

from grain.

dmitriypdv avatar dmitriypdv commented on June 19, 2024

Grain was updated to read Acsiidoctor custom document processing attributes from the SiteConfig -- the features.asciidoc.opts setting -- and pass them to the Asciidoctor.convert method. The attributes can be defined in the following way:

/SiteConfig.groovy:

features {
     asciidoc {
         opts = ['source-highlighter': 'coderay',
                 'icons': 'font']
    }
 }

You can find the example configuration in the theme template.

As Victor had mentioned in the mailing list, the RPC executor had to be modified in order to pass a map of string key-value pairs to asciidoc bridge in AsciidocBridge.convert(source, opts).

from grain.

jechlin avatar jechlin commented on June 19, 2024

Awesome, thanks a lot.

On Mon, Aug 3, 2015 at 2:54 PM, Dmitriy Pavlenko [email protected]
wrote:

Grain was updated to read Acsiidoctor custom document processing
attributes from the SiteConfig -- the features.asciidoc.opts setting --
and pass them to the Asciidoctor.convert method. The attributes can be
defined in the following way:

/SiteConfig.groovy:

features {
asciidoc {
opts = ['source-highlighter': 'coderay',
'icons': 'font']
}
}

You can find the example configuration in the theme template
sysgears/grain-theme-template@7df608c
.

As Victor had mentioned in the mailing list
https://groups.google.com/forum/#!msg/grain-user/TT1YszsHLgg/frwURxNX0UUJ,
the RPC executor had to be modified in order to pass a map of string
key-value pairs to asciidoc bridge in AsciidocBridge.convert(source, opts)
.


Reply to this email directly or view it on GitHub
#8 (comment).

from grain.

Related Issues (19)

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.