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

Add Extension point for plugins to be able to contribute theming requirements (e.g. source code highlighting) #88

Closed
timja opened this issue Mar 18, 2022 · 4 comments · May be fixed by #105
Labels
enhancement New feature or request

Comments

@timja
Copy link
Member

timja commented Mar 18, 2022

What feature do you want to see added?

Discussed this a bit with @uhafner in a couple of places.

The https://github.com/jenkinsci/prism-api-plugin has added it's own theming component to choose the prism theme.

This isn't ideal as:

  1. The users code highlighting theme isn't adapted when their main theme is
  2. The code highlighting theme is in a completely different place

It would be ideal if there was an extension point that plugins could implement adding to the UI of this plugin.
It would also be ideal if the Theme extension point added a Map<String,String> properties method where themes could contribute information to these extensions.

e.g.

Dark theme could set a property "prismTheme" = "dark"

Prism API could then default to that.

Then Prism API would add an optional property Override source code highlighting theme which would allow the user to select a different one.

Any thoughts @uhafner or others (@janfaracik fyi)?

This would be useful for jenkinsci/design-library-plugin#12

Upstream changes

probably should implement #81 first

@timja timja added the enhancement New feature or request label Mar 18, 2022
@timja
Copy link
Member Author

timja commented Mar 21, 2022

This could also be used to overwrite codemirror theme so that theme plugins don't need to supply their own

@uhafner
Copy link
Member

uhafner commented Mar 21, 2022

I think we have two different variants to implement that.

  1. Each theme defines a boolean property DARK or LIGHT. The prism plugin reads that value and selects the theme accordingly.
  2. We add an extension point (key value pairs?) and the prism plugin implements that extension point for "io.jenkins.prism.theme" and uses the value of that key to select the theme. This allows creating additional themes that use a totally different prism theme as well.

While the former one is simpler to implement, the latter one seems to be more flexible. However, that means each theme author then needs to know, which other plugins exist that provide theming options.

@timja
Copy link
Member Author

timja commented Mar 21, 2022

While the former one is simpler to implement, the latter one seems to be more flexible. However, that means each theme author then needs to know, which other plugins exist that provide theming options.

Should probably be a section in the README that plugins that implement the extension point should add a reference in.

@timja
Copy link
Member Author

timja commented Mar 6, 2024

This was done

@timja timja closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants