Global Markdown StylesStarting around version 1.22, the VS Code team decided to restrict the application of global styles to Markdown file previews, primarily due to security reasons. While this might seem inconvenient, it is a sensible precaution. The team suggests creating your own extension with the necessary styles as a workaround. Alternatively, you can manually copy the styles from one workspace to another or create a symbolic link between them. Admittedly, these solutions not be the most convenient. Hence, this extension was developed, despite potential risks, to bring back a user-friendly experience.
How It WorksVS Code includes an extension that features a file with default styles for previewing markdown files. Global Markdown Styles extension enhances this file by adding custom styles to the existing default ones. The extension keeps a backup of the default styles, which can be handy when you need to uninstall the extension or "heal" it. It is important to mention that since the addition of custom styles involves modifying VS Code's internal files, these changes will be lost with each update. Consequently, you will need to execute the installation command after every update. Since the extension enhances the default styles, it is compatible with all other extensions that introduce their own styles, like the Markdown Preview Github Styling. The extension lacks a logger. Instead, it utilizes notifications to relay information regarding the command status or errors. Therefore, it recommends enabling notifications before executing any command.
RequirementsThe For the extension to function properly, VS Code needs self-modification permissions. This implies that the user launching the editor should have the necessary permissions to edit the VS Code source code. MacOSClaim ownership of the command:
... and the application:
LinuxClaim ownership of the command:
... and the application:
The application path may vary depending on your distribution or package manager. WindowsJust run the application as an administrator before executing the extension commands. InstallationThe extension is available on the VSCode Marketplace and Open VSX Registry. Additionally, you can manually download it from the GitHub Releases. Configuration
Commands
ContributionAre welcome! See How to Contribute to Open Source. AcknowledgmentsI would like to thank Renzhi Li for his Custom CSS and JS extension. It has been a source of inspiration and has led me to experiment. LicenseMIT (c) Ivan Uhalin
|