-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for rendering iPython notebooks.
- Loading branch information
1 parent
e1e00d3
commit 637de57
Showing
25 changed files
with
465 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ _site/ | |
assets/fonts | ||
posts_backup/ | ||
.jekyll-cache/ | ||
.ipynb_checkpoints | ||
|
||
!assets/fonts/fontawesome/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<meta charset="utf-8"> | ||
<title>{{ page.title }}</title> | ||
<link rel="stylesheet" href="/assets/css/styles.css"> | ||
<link rel="stylesheet" href="/assets/fonts/fontawesome/css/all.css"> | ||
|
||
<!--Icons--> | ||
<link rel="shortcut icon" type="image/svg" href={{ "assets/images/logov3.svg" | absolute_url }}> | ||
<link rel="apple-touch-icon" sizes="180x180" href={{ "assets/images/apple-touch-icon.png" | absolute_url }}> | ||
<link rel="manifest" href={{ "assets/images/site.webmanifest" | absolute_url }}> | ||
<link rel="mask-icon" href={{ "assets/images/safari-pinned-tab.svg" | absolute_url }} color="#5bbad5"> | ||
<meta name="msapplication-TileColor" content="#da532c"> | ||
<meta name="theme-color" content="#ffffff"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: iPython Notebook Rendering | ||
layout: blog | ||
image: ../assets/images/2021-12-29.png | ||
description: How to render iPython notebooks on github-pages using Jekyll. | ||
author: Marlin Benedikt Schäfer | ||
excerpt: Since I'm a theoretical physicist that mainly works as a data analyst, I wanted a way to convey information both in text/formulas as well as in code. Usually the ideal way to do something like this are iPython notebooks. However, there was no direct way of rendering them. | ||
--- | ||
|
||
<div class="notebook" data-nb-path= {{ "assets/notebooks/2021-12-29.ipynb" | relative_url }}></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.notebook { | ||
color: var(--darkgrey); | ||
} | ||
.notebook h1 { | ||
font-size: 2em; | ||
padding-bottom: 10px; | ||
} | ||
.notebook h2 { | ||
font-size: 1.6em; | ||
padding-bottom: 6px; | ||
} | ||
.notebook p { | ||
padding-left: 15px; | ||
line-height: 1.6; | ||
margin-top: 0.5em; | ||
margin-bottom: 0.5em; | ||
} | ||
.notebook code { | ||
/*background: #f5f2f0;*/ | ||
background: var(--lightgrey); | ||
border-radius: 6px; | ||
padding: .2em .4em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
.nb-notebook { | ||
line-height: 1.5; | ||
} | ||
|
||
.nb-stdout, .nb-stderr { | ||
white-space: pre-wrap; | ||
margin: 1em 0; | ||
padding: 0.1em 0.5em; | ||
} | ||
|
||
.nb-stderr { | ||
background-color: #FAA; | ||
} | ||
|
||
.nb-cell + .nb-cell { | ||
margin-top: 0.5em; | ||
} | ||
|
||
.nb-output table { | ||
border: 1px solid #000; | ||
border-collapse: collapse; | ||
} | ||
|
||
.nb-output th { | ||
font-weight: bold; | ||
} | ||
|
||
.nb-output th, .nb-output td { | ||
border: 1px solid #000; | ||
padding: 0.25em; | ||
text-align: left; | ||
vertical-align: middle; | ||
border-collapse: collapse; | ||
} | ||
|
||
.nb-notebook blockquote { | ||
border-left: 5px solid #CCC; | ||
margin-left: 0; | ||
padding-left: 1em; | ||
} | ||
|
||
.nb-cell { | ||
position: relative; | ||
} | ||
|
||
.nb-raw-cell { | ||
white-space: pre-wrap; | ||
background-color: #f5f2f0; | ||
font-family: Consolas, Monaco, 'Andale Mono', monospace; | ||
padding: 1em; | ||
margin: .5em 0; | ||
} | ||
|
||
.nb-output { | ||
min-height: 1em; | ||
width: 100%; | ||
overflow-x: scroll; | ||
border-right: 1px dotted #CCC; | ||
} | ||
|
||
.nb-output img { | ||
max-width: 100%; | ||
} | ||
|
||
.nb-output:before, .nb-input:before { | ||
position: absolute; | ||
font-family: monospace; | ||
color: #999; | ||
left: -7.5em; | ||
width: 7em; | ||
text-align: right; | ||
} | ||
|
||
.nb-input:before { | ||
content: "In [" attr(data-prompt-number) "]:"; | ||
} | ||
.nb-output:before { | ||
content: "Out [" attr(data-prompt-number) "]:"; | ||
} | ||
|
||
// Fix pandas dataframe formatting | ||
div[style="max-height:1000px;max-width:1500px;overflow:auto;"] { | ||
max-height: none !important; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
/* PrismJS 1.21.0 | ||
https://prismjs.com/download.html#themes=prism&languages=markup+clike+javascript+julia+python+r */ | ||
/** | ||
* prism.js default theme for JavaScript, CSS and HTML | ||
* Based on dabblet (http://dabblet.com) | ||
* @author Lea Verou | ||
*/ | ||
|
||
code[class*="language-"], | ||
pre[class*="language-"] { | ||
color: black; | ||
background: none; | ||
text-shadow: 0 1px white; | ||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; | ||
font-size: 1em; | ||
text-align: left; | ||
white-space: pre; | ||
word-spacing: normal; | ||
word-break: normal; | ||
word-wrap: normal; | ||
line-height: 1.5; | ||
|
||
-moz-tab-size: 4; | ||
-o-tab-size: 4; | ||
tab-size: 4; | ||
|
||
-webkit-hyphens: none; | ||
-moz-hyphens: none; | ||
-ms-hyphens: none; | ||
hyphens: none; | ||
} | ||
|
||
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, | ||
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { | ||
text-shadow: none; | ||
background: #b3d4fc; | ||
} | ||
|
||
pre[class*="language-"]::selection, pre[class*="language-"] ::selection, | ||
code[class*="language-"]::selection, code[class*="language-"] ::selection { | ||
text-shadow: none; | ||
background: #b3d4fc; | ||
} | ||
|
||
@media print { | ||
code[class*="language-"], | ||
pre[class*="language-"] { | ||
text-shadow: none; | ||
} | ||
} | ||
|
||
/* Code blocks */ | ||
pre[class*="language-"] { | ||
padding: 1em; | ||
margin: .5em 0; | ||
overflow: auto; | ||
} | ||
|
||
:not(pre) > code[class*="language-"], | ||
pre[class*="language-"] { | ||
background: #f5f2f0; | ||
} | ||
|
||
/* Inline code */ | ||
:not(pre) > code[class*="language-"] { | ||
padding: .1em; | ||
border-radius: .3em; | ||
white-space: normal; | ||
} | ||
|
||
.token.comment, | ||
.token.prolog, | ||
.token.doctype, | ||
.token.cdata { | ||
color: slategray; | ||
} | ||
|
||
.token.punctuation { | ||
color: #999; | ||
} | ||
|
||
.token.namespace { | ||
opacity: .7; | ||
} | ||
|
||
.token.property, | ||
.token.tag, | ||
.token.boolean, | ||
.token.number, | ||
.token.constant, | ||
.token.symbol, | ||
.token.deleted { | ||
color: #905; | ||
} | ||
|
||
.token.selector, | ||
.token.attr-name, | ||
.token.string, | ||
.token.char, | ||
.token.builtin, | ||
.token.inserted { | ||
color: #690; | ||
} | ||
|
||
.token.operator, | ||
.token.entity, | ||
.token.url, | ||
.language-css .token.string, | ||
.style .token.string { | ||
color: #9a6e3a; | ||
/* This background color was intended by the author of this theme. */ | ||
background: hsla(0, 0%, 100%, .5); | ||
} | ||
|
||
.token.atrule, | ||
.token.attr-value, | ||
.token.keyword { | ||
color: #07a; | ||
} | ||
|
||
.token.function, | ||
.token.class-name { | ||
color: #DD4A68; | ||
} | ||
|
||
.token.regex, | ||
.token.important, | ||
.token.variable { | ||
color: #e90; | ||
} | ||
|
||
.token.important, | ||
.token.bold { | ||
font-weight: bold; | ||
} | ||
.token.italic { | ||
font-style: italic; | ||
} | ||
|
||
.token.entity { | ||
cursor: help; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.