Add Format-Specific Code Highlighting Stylesnew change#409
Open
LuHC409 wants to merge 1 commit intoyzane:masterfrom
Open
Add Format-Specific Code Highlighting Stylesnew change#409LuHC409 wants to merge 1 commit intoyzane:masterfrom
LuHC409 wants to merge 1 commit intoyzane:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Format-Specific Code Highlighting Styles
Description
Added the ability to specify different code highlighting styles for different output formats (pdf, html, png, jpeg). For example, users can now use light themes for PDF files (for printing) and dark themes for HTML files.
Changes
readStylesfunction inextension.jsto support format-specific code highlighting stylesmarkdown-pdf.highlightStyleconfiguration inpackage.jsonto support object-type configurationConfiguration Example
Users can now configure different highlighting styles for different formats:
{ "markdown-pdf.highlightStyle": { "pdf": "github.css", // Light theme for PDF files "html": "monokai.css", // Dark theme for HTML files "default": "github.css" // Default style for other formats } }Or continue using a single highlighting style:
{ "markdown-pdf.highlightStyle": "github.css" }Backward Compatibility
Testing
Related Issue
Closes #398
Additional Notes