Git Product home page Git Product logo

Comments (7)

mojavelinux avatar mojavelinux commented on July 1, 2024

👍 I love this feature in the Chrome extension. I use it all the time.

from docgist.

nawroth avatar nawroth commented on July 1, 2024

I think you pointed me to the code over there already. It's such a low hanging fruit, I should just get it done.

from docgist.

nawroth avatar nawroth commented on July 1, 2024

@mojavelinux This reminds me ... should source-language affect plain literalblocks, which are not really source blocks?

from docgist.

nawroth avatar nawroth commented on July 1, 2024

@mojavelinux See http://gist.asciidoctor.org/?github-asciidoc%2Fasciidoc%2F%2Fdoc%2Fsource-highlight-filter.txt&source-language=python&source-highlighter=pygments#_source_code_paragraphs

I'm actually not sure why the language attribute in the document isn't picked up when the page is rendered without overrides: http://gist.asciidoctor.org/?github-asciidoc%2Fasciidoc%2F%2Fdoc%2Fsource-highlight-filter.txt#_source_code_paragraphs
But anyhow, locking source-language from the URL works fine.
If language is set as well, it will win. (expected?)

I added pygments as highlighter to see if the sanity check still worked.
(see the output in the console)

from docgist.

mojavelinux avatar mojavelinux commented on July 1, 2024

But anyhow, locking source-language from the URL works fine.
If language is set as well, it will win. (expected?)

I suppose so. language is the deprecated attribute and source-language is now preferred. We're missing a test in core to validate what happens if both are specified. I guess we could say it's a bit undefined atm.

from docgist.

mojavelinux avatar mojavelinux commented on July 1, 2024

should source-language affect plain literalblocks, which are not really source blocks?

It shouldn't, though we are planning a change in this area. See asciidoctor/asciidoctor#1117. Even then, if a block is marked as listing or literal it should not get source highlighting.

from docgist.

nawroth avatar nawroth commented on July 1, 2024

Ok, I'll leave the literal blocks out for now, as the HTML generated for the different variants is identical.
I tried to collect some variations of this here: http://gist.asciidoctor.org/?b60dad2c320ecbea4694

from docgist.

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.