mkdocs-simple-blog icon indicating copy to clipboard operation
mkdocs-simple-blog copied to clipboard

[Feature Request]Simple code syntax highlighting

Open IcyFeather233 opened this issue 1 year ago • 2 comments

Describe the feature

Simple code syntax highlighting, just as most of technical blogs.

Use Case

Currently, all code blocks are in black and white. As a minimalist blog, it seems necessary to have a simple syntax highlighting setting. I hope it can be made into an option, so that those who need it can enable syntax highlighting, while those who don't need it can continue to keep their code blocks in black and white.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

SDK version used

Any

Environment details (OS name and version, etc.)

Any

IcyFeather233 avatar Mar 27 '24 10:03 IcyFeather233

@IcyFeather233 Cool, this feature is really good. I started a brief analysis to implement this improvement, if you want to help you can also open a pull request. I will use a library called highlightjs.

  • Branch: https://github.com/FernandoCelmer/mkdocs-simple-blog/tree/35-feature

FernandoCelmer avatar Apr 09 '24 02:04 FernandoCelmer

Hi @FernandoCelmer the highlight isn't working properly, I think it should call hljs.highlightAll() instead of hljs.initHighlightingOnLoad() according to the highlightjs README

saulmmendoza avatar Oct 03 '24 01:10 saulmmendoza

@IcyFeather233, @saulmmendoza Basic initial implementation in version 0.1.0, more improvements with other styles in the next versions. Link to documentation.

FernandoCelmer avatar Feb 07 '25 19:02 FernandoCelmer