Giter Club home page Giter Club logo

Comments (11)

fmvilas avatar fmvilas commented on August 22, 2024

Thanks for opening the issue, @rv0. To clarify:

  • We're talking about the HTML template, right?
  • If we add a tags menu to the sidebar then the table of contents shouldn't be needed. Am I right?
  • When you say hierarchical collapsible structure you mean 2 collapsible items like, for instance, Operations and Tags? Or you mean hierarchical by looking at the common beginning of a channel name?

from generator.

rv0 avatar rv0 commented on August 22, 2024
  • yes, html template
  • yes, tags in sidebar seems like nicest solution
  • hierarchical with first level tags and 2nd level operations, like the small example above.. hierarchical with channel names would be very cool but seems outside of the scope of this FRQ

from generator.

fmvilas avatar fmvilas commented on August 22, 2024

I see. Just as a side note for the future implementer: the hierarchical organization on the sidebar could be driven by a special parameter for the HTML template. See #8.

For instance:

ag asyncapi.yaml html --params '{"sidebarOrganization":"hierarchical"}'

from generator.

GianniCoene avatar GianniCoene commented on August 22, 2024

I'm currently working on this issue. So far I have been able to implement the functionality of tags in the sidebar.
The user can click the tag which will reveal all topics associated with that particular tag.

However I ran into some trouble when trying to require the special parameter for the HTML template.
In the code I check if the parameter is present using:
{{#if params.sidebarOrganization}} as mentioned in the referenced issue.
But when I use the CLI to try and generate the docs using the command:
ag asyncapi.yaml html --params '{"sidebarOrganization":"hierarchical"}'
I will get a JSON parse error saying: Unexpected token ' in JSON at position 0.

I've tried the parameter in a couple of different notations but none of them seem to work. Any ideas?

from generator.

fmvilas avatar fmvilas commented on August 22, 2024

Hey @GianniCoene. I'm trying exactly the same command and it works perfectly. Can you make sure you're running the latest version of the package? If the problem persists, what operating system and terminal are you using?

from generator.

GianniCoene avatar GianniCoene commented on August 22, 2024

Hello @fmvilas.
I'm using the most recent package. I'm using Windows 10 and CMD (the standard terminal that comes with it).
Just to be clear, the files do generate but I'm getting the --params error message saying they will not be available in the templates because of a parsing error.

from generator.

fmvilas avatar fmvilas commented on August 22, 2024

My guess is that it's a Windows CMD issue with double-quotes. Can you try the following:

 ag asyncapi.yaml html --params '{\"sidebarOrganization\":\"hierarchical\"}'

from generator.

GianniCoene avatar GianniCoene commented on August 22, 2024

Turns out the problem was an issue with the double-quotes as you said. However I had to leave out the single-quotes as well. The following command works in the Windows CMD:
ag asyncapi.yaml html --params {\"sidebarOrganization\":\"hierarchical\"}

Thank you for the help!

from generator.

fmvilas avatar fmvilas commented on August 22, 2024

No problem. Windows keeps surprising me 😄

from generator.

marcortw avatar marcortw commented on August 22, 2024

Sorry for writing to a closed thread, but it seems like 'params' is not yet passed on when using the generator as a module with the .generateTemplateFile function. Shall I write a PR?

from generator.

fmvilas avatar fmvilas commented on August 22, 2024

You're right. Yeah, feel free to open a PR. Thanks!

from generator.

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.