Browse Source
- Added highlight.js for improved syntax highlighting in markdown code blocks. - Updated markdown rendering configuration to support language-specific highlighting. - Introduced a new SCSS file for styling highlighted code blocks, enhancing visual presentation. - Implemented a copy button functionality for code blocks to improve usability. These changes significantly enhance the markdown rendering experience, making code snippets more readable and interactive.main
7 changed files with 242 additions and 163 deletions
@ -1,45 +1,3 @@ |
|||||
@use "./markdown/reset.scss"; |
@use "./markdown/reset.scss"; |
||||
@use "./markdown/green.scss"; |
@use "./markdown/green.scss"; |
||||
|
@use "./markdown/highlight.scss"; |
||||
// .code-block-wrapper { |
|
||||
// position: relative; |
|
||||
// margin: 16px 0; |
|
||||
// border-radius: 8px; |
|
||||
// background: #1e1e1e; |
|
||||
// overflow: hidden; |
|
||||
// } |
|
||||
// .code-header { |
|
||||
// display: flex; |
|
||||
// justify-content: space-between; |
|
||||
// align-items: center; |
|
||||
// padding: 8px 12px; |
|
||||
// background: #2d2d2d; |
|
||||
// color: #ccc; |
|
||||
// font-size: 14px; |
|
||||
// } |
|
||||
// .code-lang { |
|
||||
// font-weight: 600; |
|
||||
// text-transform: uppercase; |
|
||||
// } |
|
||||
// .copy-btn { |
|
||||
// padding: 4px 8px; |
|
||||
// border: none; |
|
||||
// border-radius: 4px; |
|
||||
// background: #444; |
|
||||
// color: #fff; |
|
||||
// cursor: pointer; |
|
||||
// font-size: 12px; |
|
||||
// transition: all 0.2s; |
|
||||
// } |
|
||||
// .copy-btn:hover { |
|
||||
// background: #555; |
|
||||
// } |
|
||||
// pre { |
|
||||
// margin: 0; |
|
||||
// padding: 12px; |
|
||||
// overflow-x: auto; |
|
||||
// } |
|
||||
// code { |
|
||||
// color: #d4d4d4; |
|
||||
// font-family: 'Consolas', 'Monaco', monospace; |
|
||||
// } |
|
||||
|
|||||
@ -0,0 +1,53 @@ |
|||||
|
.markdown-body { |
||||
|
.code-block-wrapper { |
||||
|
pre { |
||||
|
code.hljs { |
||||
|
color: #1f2937; |
||||
|
} |
||||
|
|
||||
|
.hljs-comment, |
||||
|
.hljs-quote { |
||||
|
color: #6b7280; |
||||
|
font-style: italic; |
||||
|
} |
||||
|
|
||||
|
.hljs-keyword, |
||||
|
.hljs-selector-tag, |
||||
|
.hljs-literal, |
||||
|
.hljs-section, |
||||
|
.hljs-link { |
||||
|
color: #9333ea; |
||||
|
} |
||||
|
|
||||
|
.hljs-string, |
||||
|
.hljs-title, |
||||
|
.hljs-name, |
||||
|
.hljs-type, |
||||
|
.hljs-attribute, |
||||
|
.hljs-symbol, |
||||
|
.hljs-bullet, |
||||
|
.hljs-addition { |
||||
|
color: #0f766e; |
||||
|
} |
||||
|
|
||||
|
.hljs-number, |
||||
|
.hljs-variable, |
||||
|
.hljs-template-variable, |
||||
|
.hljs-regexp, |
||||
|
.hljs-meta .hljs-string { |
||||
|
color: #d97706; |
||||
|
} |
||||
|
|
||||
|
.hljs-built_in, |
||||
|
.hljs-function, |
||||
|
.hljs-class .hljs-title { |
||||
|
color: #2563eb; |
||||
|
} |
||||
|
|
||||
|
.hljs-deletion, |
||||
|
.hljs-subst { |
||||
|
color: #dc2626; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Binary file not shown.
Loading…
Reference in new issue