add highlighting support for lines

This commit is contained in:
Babibubebon 2022-09-07 03:28:35 +09:00
parent 09a2f01afc
commit 1a08f7c829
2 changed files with 5 additions and 3 deletions

View file

@ -6,7 +6,7 @@
/* CodeLine */ .chroma .cl { }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc }
/* LineHighlight */ .chroma .hl { background-color: #4d4f5a }
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* LineNumbers */ .chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* Line */ .chroma .line { display: flex; }

View file

@ -1,6 +1,8 @@
{{ $q := trim .Inner "\n" }}
{{- $q := trim .Inner "\n" -}}
{{- $hlLines := (default "" (.Get "hl_lines")) | printf "hl_Lines=%s" -}}
{{ highlight $q "sparql" $hlLines }}
{{ highlight $q "sparql" }}
<a class="book-btn"
onclick="setYasguiQuery('{{ .Get "yasgui-id" }}', '{{ .Get "title" }}', '{{ $q }}', '{{ .Get "endpoint" }}'); location.href='#yasgui-{{ .Get "yasgui-id" }}'">
▶ 実行する