-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Preset with react lowlight #3396
Conversation
initial commit
The default color is `#555` , and later set as `#fff !important` . This commit removes that `!important` so other plugins can change the text color.
so that everything with syntax highlight is "lowlight".
So syntax highlighting is available through changing presets to `SwaggerUIBundle.presets.lowlight`
Lowlight now works as an additional preset works along with the api preset.
…tes/swagger-ui into preset-with-react-lowlight
I'm going back and forth on the best way to implement this (core vs coreplugin vs outside plugin). Before moving forward, I'd like to hear what @webron thinks of the functionality. Specifically, should this replace whats there currently, or be an opt-in change? It also comes to mind that I and others on the team have been musing about creating an boilerplate plugin that lives in its own npm repository, that can be imported cleanly... This PR has enough meat in it to be a good candidate for that. |
Thanks for the contribution, @biggates - I appreciate your attention to detail with the documentation, and wiring everything through. Please bear with us while we look at our side of things 😄 |
Yeah I agree with @shockey this is a perfect candidate for a standalone plugin ( ie: outside this repo ).
@biggates, thanks again for the contribution! |
I'm going to go ahead and close this out. @biggates - thanks a lot for this. I'm not against the change in itself, but since this is structured as a new preset, I think it'd do best as a preset/plugin that lives outside of the core codebase. For an example on how to build such a thing, see https://github.com/shockey/swagger-ui-cornify. Feel free to ping me over there if you have any questions. That being said... we aren't married to our current code highlighter. If you'd like to take another swing at this, I'd be happy to consider a PR that replaces the current code highlighter with a superior one - the deal with this one is that it lives in a weird space between plugins and core. But that's not your fault, we need to push out more guidance on how to build plugins! Thanks again 👍 |
so where does this live now? |
@flying-sheep AFAIK, the code was never repackaged in any of the ways noted above. Feel free to pick it up yourself if you have the time 😄 |
too bad, such a good PR and nothing coming out of it… maybe I will. where would i start? is there a plugin that does sth. similar (i guess overriding the rendering of some component…?) |
Syntax highlighting (#3189) using react-lowlight