markdown document preview improvements#9240
markdown document preview improvements#9240haidubogdan wants to merge 2 commits intoapache:masterfrom
Conversation
|
only took a quick look at the output of some readme files and I think it looks better. Will need some tweaks for the dark theme since the background renders as white atm etc. |
Closes apache#6652 - hardcoded swing html renderer compatible css styling - custom <hr> tag renderer - strikethrough extension - uniform mime_type - update vscode regex for striketrhough detection
af46460 to
1982844
Compare
|
We already talked about "customization" and it is fine to make it hard coded, but can't we do it direclty inside a css file. it is still hard coded but I can change this, if i want in the settings. So my idea is to add the css to the css file and read it from there. |
I remember being a hustle to include a css resource file and after in runtime in the compiled state to read it. And this is my worry about this, in my personal opinion it doesn't seem to be efficient. |
|
Ok, no worries, I forgot that problem. So everything seems fine :) |
|
: )) thanks. |
|
Bundle could be also fine, yes. |
|
Bundle would be OK for allowing platform applications to override. Not sure if any are using this. But the config file system is probably a better choice if we want to allow IDE users to override? Also, in reference to what @mbien mentioned above, probably a light and a dark CSS file should be available, with the correct one loaded on the basis of checking for the dark theme flag? |
|
I think there is enough time to see where this goes :) . The problem with custom css upload is that Java Swing doesn't really render well css styling, so it's not really useful for users. Maybe combining Fonts & Colors and styling content with placeholders could work to give some level of customization. |
taking the editor background might be good enough or not setting it at all (-> transparent?) which would inherit it automatically from the theme / customized flatlaf properties. |
|
Better to use an Although given how use of this pattern is growing, we could probably do with providing an API for it, probably in the adjacent |
|
checking for dark theme would imply that it would switch between two sets of hardcoded colors or css. Which I believe would be good to avoid and simply inherit the color from somewhere else. I am somewhat skeptical that exposing the css to the user is needed and/or useful, given that it would clash with theming if not done carefully. This started as attempt to improve the defaults which is great (defaults are important!), but the customizable css is kept being added as feature creep distracting from the original goal. Looking through this changeset it appears that there are only a few colors needed atm - with a bit of luck they all can be derived from already existing colors in the IDE. |
|
Customization is secondary to the fact that this belongs on the system filesystem, like other similar configuration. |
This PR proposes some hard coded styling improvements for markdown preview renderer.
Swing html renderer has a lot of Css limitations, so future improvements could look at using other html java renderers
Before:
After:
Closes #6652
<hr>tag rendererKnow limitations
<code>don't apply padding^Add meaningful description above
Click to collapse/expand PR instructions
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)