fix code snippet styling

This commit is contained in:
Aravinth Manivannan 2021-12-09 11:36:26 +05:30
parent 5d46ef3a58
commit 6424c85b98
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
2 changed files with 20 additions and 3 deletions

View File

@ -1,8 +1,10 @@
<. let gist_id = data.get_gist_id(src); .>
<. let (_, gist)= gists.as_ref().unwrap().iter().find(|(id, _)| id == gist_id).as_ref().unwrap(); .>
<div class="gist_container">
<. for file in &gist.files {.>
<code> <.= file.get_html_content() .> </code>
<code class="code-block"> <.= file.get_html_content() .> </code>
<.}.>
<a href="<.= &gist.html_url .>" target="_blank"
<a class="gist_link" href="<.= &gist.html_url .>" target="_blank"
>See gist on GitHub</a
>
</div>

View File

@ -63,9 +63,15 @@ code {
font-family: monospace;
font-size: 15px;
white-space: pre-wrap;
display: block;
font-weight: 600;
line-height: 1rem;
padding: 5px;
border-radius: 6px;
background-color: rgba(175, 184, 193, 0.2);
}
.code-block {
display: block;
}
iframe {
@ -118,3 +124,12 @@ iframe {
.meta {
display: inline-flex;
}
.gist_contianer {
border-radius: 6px;
border: 1px solid rgb(211, 211, 211);
}
.gist_link {
margin-left: 5px;
}