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

3
.gitignore vendored
View file

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

View file

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

View file

@ -1,14 +1,5 @@
pre[class*="language-"],
code[class*="language-"] {
.chroma code {
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 {
@ -24,29 +15,30 @@ pre {
border: 0;
}
.chroma .lntable {
border-spacing: 0;
padding: 0;
margin: 0;
border: 0;
width: auto;
overflow: auto;
display: block;
}
.chroma .lntable tbody {
border: 0;
}
.chroma .lntable td:nth-child(2) {
width: 100%;
}
.chroma .lnt,
.chroma .line {
display: block;
line-height: 1.3;
}
/* LineNumbersTable */
.chroma .lnt {
color: #999;
display: block;
padding-left: .9em;
padding-right: 1em;
text-align: right;
line-height: 1.5;
font-size: 13px;
}
.chroma .hl .lnt {
display: inline;
}
/* Keyword */
@ -143,3 +135,8 @@ pre {
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
```go
```go {hl_lines=[3]}
type Registry interface {
Register(*Service, ...RegisterOption) error
Deregister(*Service, ...DeregisterOption) error