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

Preset with react lowlight #3396

Closed
wants to merge 11 commits into from
Closed

Preset with react lowlight #3396

wants to merge 11 commits into from

Conversation

biggates
Copy link

Syntax highlighting (#3189) using react-lowlight

biggates added 9 commits July 12, 2017 17:27
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.
@shockey shockey requested review from shockey and webron July 17, 2017 16:10
@shockey
Copy link
Contributor

shockey commented Jul 19, 2017

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.

@shockey
Copy link
Contributor

shockey commented Jul 19, 2017

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 😄

@ponelat
Copy link
Member

ponelat commented Jul 19, 2017

Yeah I agree with @shockey this is a perfect candidate for a standalone plugin ( ie: outside this repo ).
Any thoughts on how to make that possible?

  • on npm withswagger-ui-plugin-lowlight?
  • What about <script/> tags? Would we support those? ( which means plugins would need to follow a building guidelines ).
  • you mentioned a boiler plate, should we make a create-react-app-like creator? That handles webpack? Too much?

@biggates, thanks again for the contribution!

@shockey shockey removed the request for review from webron August 16, 2017 19:05
@shockey
Copy link
Contributor

shockey commented Nov 29, 2017

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 👍

@flying-sheep
Copy link

so where does this live now?

@shockey
Copy link
Contributor

shockey commented May 16, 2018

@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 😄

@flying-sheep
Copy link

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…?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants