Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update water.css and fix code output #185

Merged
merged 6 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nimib/renders.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ proc useHtmlBackend*(doc: var NbDoc) =
{{>nbCodeSource}}
{{>nbCodeOutput}}"""
doc.partials["nbCodeSource"] = "<pre><code class=\"nohighlight hljs nim\">{{&codeHighlighted}}</code></pre>"
doc.partials["nbCodeOutput"] = """{{#output}}<pre class="nb-output"><samp>{{output}}</samp></pre>{{/output}}"""
doc.partials["nbCodeOutput"] = """{{#output}}<pre class="nb-output">{{output}}</pre>{{/output}}"""
doc.partials["nimibCode"] = doc.partials["nbCode"]
doc.partials["nbImage"] = """<figure>
<img src="{{url}}" alt="{{caption}}">
Expand Down
10 changes: 5 additions & 5 deletions src/nimib/themes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const head* = """
{{{favicon}}}
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta content="width=device-width, initial-scale=1" name="viewport">
{{^no_normalize}}<link rel='stylesheet' href='https://unpkg.com/normalize.css'>{{/no_normalize}}
{{{stylesheet}}}
{{{highlight}}}
{{^disableHighlightJs}}
Expand All @@ -42,8 +41,8 @@ const main* = """

# https://css-tricks.com/emojis-as-favicons/ changed font-size to 80 to fit whale
const faviconWhale* = """<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2280%22>🐳</text></svg>">"""
const waterLight* = """<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/light.min.css">"""
const waterDark* = """<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kognise/water.css@latest/dist/dark.min.css">"""
const waterLight* = """<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/light.min.css">"""
const waterDark* = """<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/dark.min.css">"""
const atomOneLight* = """<link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/pietroppeter/nimib/assets/atom-one-light.css'>"""
const androidStudio* = """<link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/pietroppeter/nimib/assets/androidstudio.css'>"""
const highlightJsTags* = """
Expand Down Expand Up @@ -71,7 +70,9 @@ button.nb-small {
section#source {
display:none
}

pre > code {
font-size: 1.2em;
}
.nb-output {
line-height: 1.15;
}
Expand All @@ -95,7 +96,6 @@ const githubLogoDark* = """<svg aria-hidden="true" width="1.2em" height="1.2em"

const footer* = """
<footer>
<hr>
<div class="nb-box">
<span>{{> footer_left }}</span>
<span>{{> footer_center }}</span>
Expand Down
2 changes: 1 addition & 1 deletion tests/trenders.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ suite "render (block), html default backend":
test "nbCode with output":
nbCode: echo "hi"
check nb.render(nb.blk).strip == """
<pre><code class="nohighlight hljs nim"><span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;hi&quot;</span></code></pre><pre class="nb-output"><samp>hi</samp></pre>"""
<pre><code class="nohighlight hljs nim"><span class="hljs-keyword">echo</span> <span class="hljs-string">&quot;hi&quot;</span></code></pre><pre class="nb-output">hi</pre>"""