Git Product home page Git Product logo

Comments (12)

lask79 avatar lask79 commented on June 24, 2024

Can you tell me more about your use case?
Are you using plain asciidoctorjs or antora?

Would it be enough to provide a way to override the path so that you can define where to look for the icons?

Something like this:

const default path =  `https://cdn.jsdelivr.net/npm/[email protected]/icons`
const url = (getPathFromConfiguration() || default_path) + `/${icon}`

Is that enough? I also was thinking about retrieving all used icons into a local folder and then to point to the local folder in a relative way.

from asciidoctor-treeview.

DryHumorInDC avatar DryHumorInDC commented on June 24, 2024

I'm using Antora.

Yes -- if I could configure a path, that would be great. Ideally, it would be something that could be set in any runtime, but my priority is Antora.

from asciidoctor-treeview.

DryHumorInDC avatar DryHumorInDC commented on June 24, 2024

I wonder if it's possible to also add these icons to the Antora UI Bundle? I'd be willing to throw these in there, but I'd still need a way to specify an alternate path.

from asciidoctor-treeview.

lask79 avatar lask79 commented on June 24, 2024

About Antora I was thinking about directly adding the icons into the UI catalog so that the build process is putting then into the right folders.
Putting them into UI bundle might not be effective because then you need to know upfront which icons you want to use and adding all icons would make the ui-bundle quite big. Doing this during the Antora build has the benefit that only the files will be copied that are used in the pages.

I will take a look into this how easy this could be implemented or if there could be also an intermediate solution. A dynamic and a configurable static approach.

from asciidoctor-treeview.

DryHumorInDC avatar DryHumorInDC commented on June 24, 2024

That would be terrific, thank you!

from asciidoctor-treeview.

lask79 avatar lask79 commented on June 24, 2024

So I implemented multiple improvements:

  • Antora copies now all used icons to img/treeview as default from the material-icons-theme module

  • Asciidoctor uses jsdelivr as default url

  • Additionally it is possible to

    • embed icons in css as data-uri (antora: icon_source: embedded | Asciidoctor: :treeview-icon-source: embedded)
    • custom url in Asciidoctor :treeview-icon-source:

    Please read the documentation for further information and try it out. Feedback is appreciated.

from asciidoctor-treeview.

lask79 avatar lask79 commented on June 24, 2024

@DryHumorInDC is this working for you?

from asciidoctor-treeview.

DryHumorInDC avatar DryHumorInDC commented on June 24, 2024

So sorry, I just saw this. Unfortunately, I am not only without Internet connectivity at runtime, but also at build-time. Therefore, I shall try moving the assets and utilizing the :treeview-icon-source property. I should have time to do this by Friday, and I'll let you know. The approach seems quite doable, so thank you in advance!

from asciidoctor-treeview.

lask79 avatar lask79 commented on June 24, 2024

from asciidoctor-treeview.

DryHumorInDC avatar DryHumorInDC commented on June 24, 2024

Ah, gotcha. I just need to wait a few more days on this. My administrators promise to have your npm module pulled in by Friday. Will tag up then. Thanks for your patience. And my have you been busy! I just looked at what you had to do to make this happen; I'm grateful. :-)

from asciidoctor-treeview.

DryHumorInDC avatar DryHumorInDC commented on June 24, 2024

Success!

Thank you so much. I'm very grateful to you. I'm using the antora method, but also tested embedded with equal success.

from asciidoctor-treeview.

lask79 avatar lask79 commented on June 24, 2024

That is great. Thx for using it and asking for new features to make it even better.

Have fun with the extension.

from asciidoctor-treeview.

Related Issues (6)

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.