Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I would like to add a templateParam to inject custom css. #253

Closed
btimby opened this issue Aug 20, 2021 · 11 comments
Closed

I would like to add a templateParam to inject custom css. #253

btimby opened this issue Aug 20, 2021 · 11 comments
Labels
enhancement New feature or request stale

Comments

@btimby
Copy link

btimby commented Aug 20, 2021

Reason/Context

Please try answering few of those questions

  • Why we need this improvement?
  • How will this change help?
  • What is the motivation?

This improvement will allow customization of the generated HTML styles. I want this feature to hide the sidebar. In my project, the sidebar is useless as I have but a single channel (thus navigation makes no sense) and the sidebar takes up space. I can use this change for my ends, others could use it for myriad other purposes.

Description

Please try answering few of those questions

  • What changes have to be introduced?
  • Will this be a breaking change?
  • How could it be implemented/designed?

I will add a templateParam to the package.json file as well as handling for said parameter in the HTML template. When defined, this option will inject a new <style> tag with the given css. I will add documentation for this new parameter.

This will not be a breaking change. No real design is necessary.

@btimby btimby added the enhancement New feature or request label Aug 20, 2021
@btimby
Copy link
Author

btimby commented Aug 20, 2021

This proposal would function much like a similar feature in swagger-ui-express:

https://github.com/scottie1984/swagger-ui-express#custom-css-styles

@magicmatatjahu
Copy link
Member

@btimby Hello! Thanks for the issue. The custom css for html-template will be added when we will resolve these issues in the react-component, which renders the html under the hood:

For your case with hiding the sidebar, we already support it in the react-component, but currently we have hardcoded config for it in the template - https://github.com/asyncapi/html-template/blob/master/filters/all.js#L12. Hide/show appropriate section should be done by config, because then template won't render appropriate section and template will less weight. Using css, you only "hide" elements, but they are still in the DOM

...so what about config param which will be the stringified config for react-component:

ag ./schema.yaml @asyncapi/html-template -p config='{ "showSidebar": false }'

What do you think?

@btimby
Copy link
Author

btimby commented Aug 24, 2021

@magicmatatjahu That sounds like a much better idea. Not knowing how the HTML is generated or what libraries were used, I was happy with simply hiding the sidebar. However, if there are mechanisms for disabling the rendering of it, so much the better.

I will investigate how to do this instead of custom css.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Dec 23, 2021
@derberg derberg removed the stale label Dec 27, 2021
@derberg
Copy link
Member

derberg commented Dec 27, 2021

@magicmatatjahu where are we with this one?

@magicmatatjahu
Copy link
Member

@derberg @btimby Created PR but I didn't have any info from August. I will wait max two weeks for response and then I'll decide what to do with that.

@btimby
Copy link
Author

btimby commented Jan 5, 2022

@magicmatatjahu I should have a chance to address your review tomorrow. I am sorry but I missed the notifications (until today).

@github-actions
Copy link

github-actions bot commented May 6, 2022

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label May 6, 2022
@derberg
Copy link
Member

derberg commented May 10, 2022

ping pong anybody out there 😄

@github-actions github-actions bot removed the stale label May 11, 2022
@github-actions
Copy link

github-actions bot commented Sep 8, 2022

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added stale and removed stale labels Sep 8, 2022
@github-actions
Copy link

github-actions bot commented Jan 8, 2023

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Jan 8, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants