add line highlighting #20

This commit is contained in:
Mivinci 2022-04-12 21:43:46 +08:00
parent 62bb791808
commit 5a2a7cc35a
4 changed files with 26 additions and 26 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.DS_Store .DS_Store
public public
resources resources
.hugo_build.lock

View file

@ -51,7 +51,7 @@ h5 {
} }
p { p {
line-height: 1.8; line-height: 1.6;
text-align: justify; text-align: justify;
} }
@ -62,8 +62,10 @@ hr {
pre, pre,
code { code {
overflow: auto hidden;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
font-size: 13px; font-size: 13px;
line-height: 1.3;
} }
.minima-tag, .minima-tag,

View file

@ -1,14 +1,5 @@
pre[class*="language-"], .chroma code {
code[class*="language-"] {
color: #d4d4d4; color: #d4d4d4;
font-size: 13px;
text-shadow: none;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
line-height: 1.5;
}
pre {
line-height: 1.5;
} }
.chroma { .chroma {
@ -24,29 +15,30 @@ pre {
border: 0; border: 0;
} }
.chroma .lntable {
border-spacing: 0;
padding: 0;
margin: 0;
border: 0;
width: auto;
overflow: auto;
display: block;
}
.chroma .lntable tbody { .chroma .lntable tbody {
border: 0; border: 0;
} }
.chroma .lntable td:nth-child(2) {
width: 100%;
}
.chroma .lnt,
.chroma .line {
display: block;
line-height: 1.3;
}
/* LineNumbersTable */ /* LineNumbersTable */
.chroma .lnt { .chroma .lnt {
color: #999; color: #999;
display: block;
padding-left: .9em; padding-left: .9em;
padding-right: 1em; padding-right: 1em;
text-align: right; text-align: right;
line-height: 1.5; }
font-size: 13px;
.chroma .hl .lnt {
display: inline;
} }
/* Keyword */ /* Keyword */
@ -143,3 +135,8 @@ pre {
color: #c586c0; color: #c586c0;
} }
.chroma .hl {
display: block;
background-color: #585858;
}

View file

@ -96,7 +96,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
#### Code block with Golang #### Code block with Golang
```go ```go {hl_lines=[3]}
type Registry interface { type Registry interface {
Register(*Service, ...RegisterOption) error Register(*Service, ...RegisterOption) error
Deregister(*Service, ...DeregisterOption) error Deregister(*Service, ...DeregisterOption) error