The Markdown editor in the Nuggets community was praised by many, and many users turned to the Nuggets community for this reason; However, some of the problems with the editor have long been teased by diggs, such as the lack of support for code highlighting and a single theme.

In order to solve this problem, rong Jian, our front-end leader, came up with a more playable way for digging friends — Markdown theme customization, which can meet everyone’s personalized creation needs. The specific effects are as follows:

Theme preview: github.com/xitu/juejin…

Method of use

Add meta information in front Matter format to the content of the article:

---
theme: juejin
highlight: juejin
---
Copy the code

Markdown theme

Use theme to specify a theme

Built-in themes

  • juejin
  • github

Community author Theme

The theme The author
smartblue The Denver nuggets GitHub
cyanosis The Denver nuggets GitHub
channing-cyan The Denver nuggets GitHub

Code highlighting

Using highlight to specify the theme, you can use all the styles in highlight.js:

  • The style list
  • Style preview

How can I contribute to the Markdown theme

  1. Create a public repository using the Github default template (click the green Use This Template button)
  2. Will be one of thejuejin.scssReplace with your own style, currently supports Sass, Less and CSS
  3. Fork this repository and clone it locally, inthemes.jsFile specifies the path to the style file,refTo commit hash
  4. inREADME.mdAdd your topic and author information to the Community Topics section of the
  5. Submit a pull request

At present, enthusiastic digger friends have contributed several themes, successful contributors and successful PR partners can add your theme in the topic list!! Come and experience it!

References:

Dig friends small handsome contribution tutorial: hand touch hand teach you to develop nuggets article topic

Preview of his theme: