-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
5,310 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
.quarto/ | ||
docs/ | ||
|
||
*.bak | ||
.gitattributes | ||
|
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,355 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> | ||
|
||
<meta charset="utf-8"> | ||
<meta name="generator" content="quarto-0.9.518"> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> | ||
|
||
<meta name="description" content="Execute a jupyter notebook, fast, without needing jupyter"> | ||
|
||
<title>execnb</title> | ||
<style> | ||
code{white-space: pre-wrap;} | ||
span.smallcaps{font-variant: small-caps;} | ||
span.underline{text-decoration: underline;} | ||
div.column{display: inline-block; vertical-align: top; width: 50%;} | ||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} | ||
ul.task-list{list-style: none;} | ||
pre > code.sourceCode { white-space: pre; position: relative; } | ||
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } | ||
pre > code.sourceCode > span:empty { height: 1.2em; } | ||
.sourceCode { overflow: visible; } | ||
code.sourceCode > span { color: inherit; text-decoration: inherit; } | ||
div.sourceCode { margin: 1em 0; } | ||
pre.sourceCode { margin: 0; } | ||
@media screen { | ||
div.sourceCode { overflow: auto; } | ||
} | ||
@media print { | ||
pre > code.sourceCode { white-space: pre-wrap; } | ||
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } | ||
} | ||
pre.numberSource code | ||
{ counter-reset: source-line 0; } | ||
pre.numberSource code > span | ||
{ position: relative; left: -4em; counter-increment: source-line; } | ||
pre.numberSource code > span > a:first-child::before | ||
{ content: counter(source-line); | ||
position: relative; left: -1em; text-align: right; vertical-align: baseline; | ||
border: none; display: inline-block; | ||
-webkit-touch-callout: none; -webkit-user-select: none; | ||
-khtml-user-select: none; -moz-user-select: none; | ||
-ms-user-select: none; user-select: none; | ||
padding: 0 4px; width: 4em; | ||
color: #aaaaaa; | ||
} | ||
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } | ||
div.sourceCode | ||
{ } | ||
@media screen { | ||
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } | ||
} | ||
code span.al { color: #ff0000; font-weight: bold; } /* Alert */ | ||
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ | ||
code span.at { color: #7d9029; } /* Attribute */ | ||
code span.bn { color: #40a070; } /* BaseN */ | ||
code span.bu { } /* BuiltIn */ | ||
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ | ||
code span.ch { color: #4070a0; } /* Char */ | ||
code span.cn { color: #880000; } /* Constant */ | ||
code span.co { color: #60a0b0; font-style: italic; } /* Comment */ | ||
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ | ||
code span.do { color: #ba2121; font-style: italic; } /* Documentation */ | ||
code span.dt { color: #902000; } /* DataType */ | ||
code span.dv { color: #40a070; } /* DecVal */ | ||
code span.er { color: #ff0000; font-weight: bold; } /* Error */ | ||
code span.ex { } /* Extension */ | ||
code span.fl { color: #40a070; } /* Float */ | ||
code span.fu { color: #06287e; } /* Function */ | ||
code span.im { } /* Import */ | ||
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ | ||
code span.kw { color: #007020; font-weight: bold; } /* Keyword */ | ||
code span.op { color: #666666; } /* Operator */ | ||
code span.ot { color: #007020; } /* Other */ | ||
code span.pp { color: #bc7a00; } /* Preprocessor */ | ||
code span.sc { color: #4070a0; } /* SpecialChar */ | ||
code span.ss { color: #bb6688; } /* SpecialString */ | ||
code span.st { color: #4070a0; } /* String */ | ||
code span.va { color: #19177c; } /* Variable */ | ||
code span.vs { color: #4070a0; } /* VerbatimString */ | ||
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ | ||
</style> | ||
|
||
|
||
<script src="site_libs/quarto-nav/quarto-nav.js"></script> | ||
<script src="site_libs/quarto-nav/headroom.min.js"></script> | ||
<script src="site_libs/clipboard/clipboard.min.js"></script> | ||
<script src="site_libs/quarto-search/autocomplete.umd.js"></script> | ||
<script src="site_libs/quarto-search/fuse.min.js"></script> | ||
<script src="site_libs/quarto-search/quarto-search.js"></script> | ||
<meta name="quarto:offset" content="./"> | ||
<script src="site_libs/quarto-html/quarto.js"></script> | ||
<script src="site_libs/quarto-html/popper.min.js"></script> | ||
<script src="site_libs/quarto-html/tippy.umd.min.js"></script> | ||
<script src="site_libs/quarto-html/anchor.min.js"></script> | ||
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet"> | ||
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles"> | ||
<script src="site_libs/bootstrap/bootstrap.min.js"></script> | ||
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet"> | ||
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet"> | ||
<script id="quarto-search-options" type="application/json">{ | ||
"location": "navbar", | ||
"copy-button": false, | ||
"collapse-after": 3, | ||
"panel-placement": "end", | ||
"type": "overlay", | ||
"limit": 20, | ||
"language": { | ||
"search-no-results-text": "No results", | ||
"search-matching-documents-text": "matching documents", | ||
"search-copy-link-title": "Copy link to search", | ||
"search-hide-matches-text": "Hide additional matches", | ||
"search-more-match-text": "more match in this document", | ||
"search-more-matches-text": "more matches in this document", | ||
"search-clear-button-title": "Clear", | ||
"search-detached-cancel-button-title": "Cancel", | ||
"search-submit-button-title": "Submit" | ||
} | ||
}</script> | ||
|
||
|
||
<link rel="stylesheet" href="styles.css"> | ||
<meta property="og:title" content="execnb"> | ||
<meta property="og:description" content="Execute a jupyter notebook, fast, without needing jupyter"> | ||
<meta property="og:site-name" content="execnb"> | ||
<meta name="twitter:title" content="execnb"> | ||
<meta name="twitter:description" content="Execute a jupyter notebook, fast, without needing jupyter"> | ||
<meta name="twitter:card" content="summary"> | ||
</head> | ||
|
||
<body class="nav-sidebar floating nav-fixed"> | ||
|
||
<div id="quarto-search-results"></div> | ||
<header id="quarto-header" class="headroom fixed-top"> | ||
<nav class="navbar navbar-expand-lg navbar-dark "> | ||
<div class="navbar-container container-fluid"> | ||
<a class="navbar-brand" href="./index.html"> | ||
<span class="navbar-title">execnb</span> | ||
</a> | ||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarCollapse"> | ||
<ul class="navbar-nav navbar-nav-scroll me-auto"> | ||
<li class="nav-item"> | ||
<a class="nav-link active" href="./index.html" aria-current="page">Home</a> | ||
</li> | ||
</ul> | ||
<ul class="navbar-nav navbar-nav-scroll ms-auto"> | ||
<li class="nav-item compact"> | ||
<a class="nav-link" href="https://github.com/fastai/execnb/tree/master/"><i class="bi bi-github" role="img"> | ||
</i> | ||
</a> | ||
</li> | ||
</ul> | ||
<div class="quarto-toggle-container"> | ||
<a href="" class="quarto-reader-toggle nav-link" onclick="window.quartoToggleReader(); return false;" title="Toggle reader mode"> | ||
<div class="quarto-reader-toggle-btn"> | ||
<i class="bi"></i> | ||
</div> | ||
</a> | ||
</div> | ||
<div id="quarto-search" class="" title="Search"></div> | ||
</div> <!-- /navcollapse --> | ||
</div> <!-- /container-fluid --> | ||
</nav> | ||
<nav class="quarto-secondary-nav" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }"> | ||
<div class="container-fluid d-flex justify-content-between"> | ||
<h1 class="quarto-secondary-nav-title">execnb</h1> | ||
<button type="button" class="quarto-btn-toggle btn" aria-label="Show secondary navigation"> | ||
<i class="bi bi-chevron-right"></i> | ||
</button> | ||
</div> | ||
</nav> | ||
</header> | ||
<!-- content --> | ||
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article page-navbar"> | ||
<!-- sidebar --> | ||
<nav id="quarto-sidebar" class="sidebar collapse sidebar-navigation floating overflow-auto"> | ||
<div class="sidebar-menu-container"> | ||
<ul class="list-unstyled mt-1"> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./nbio.html" class="sidebar-item-text sidebar-link">nbio</a> | ||
</div> | ||
</li> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./shell.html" class="sidebar-item-text sidebar-link">shell</a> | ||
</div> | ||
</li> | ||
<li class="sidebar-item"> | ||
<div class="sidebar-item-container"> | ||
<a href="./index.html" class="sidebar-item-text sidebar-link active">execnb</a> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</nav> | ||
<!-- margin-sidebar --> | ||
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar"> | ||
<nav id="TOC" role="doc-toc"> | ||
<h2 id="toc-title">On this page</h2> | ||
|
||
<ul> | ||
<li><a href="#install" id="toc-install" class="nav-link active" data-scroll-target="#install">Install</a></li> | ||
<li><a href="#how-to-use" id="toc-how-to-use" class="nav-link" data-scroll-target="#how-to-use">How to use</a></li> | ||
</ul> | ||
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/fastai/execnb/tree/master/issues/new" class="toc-action">Report an issue</a></p></div></div></nav> | ||
</div> | ||
<!-- main --> | ||
<main class="content" id="quarto-document-content"> | ||
|
||
<header id="title-block-header" class="quarto-title-block default"> | ||
<div class="quarto-title"> | ||
<h1 class="title d-none d-lg-block">execnb</h1> | ||
</div> | ||
|
||
<div> | ||
<div class="description"> | ||
Execute a jupyter notebook, fast, without needing jupyter | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="quarto-title-meta"> | ||
|
||
|
||
|
||
</div> | ||
|
||
|
||
</header> | ||
|
||
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --> | ||
<section id="install" class="level2"> | ||
<h2 class="anchored" data-anchor-id="install">Install</h2> | ||
<p>Either:</p> | ||
<pre><code>pip install execnb</code></pre> | ||
<p>or if you use conda:</p> | ||
<pre><code>conda install -c fastai execnb</code></pre> | ||
<p>(You can replace <code>conda</code> with <code>mamba</code> in the line above if you have mamba installed.)</p> | ||
</section> | ||
<section id="how-to-use" class="level2"> | ||
<h2 class="anchored" data-anchor-id="how-to-use">How to use</h2> | ||
<p>Use <code>CaptureShell</code> to run Jupyter code and capture notebook outputs, without running a Jupyter server (or even having it installed):</p> | ||
<div class="cell"> | ||
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>s <span class="op">=</span> CaptureShell()</span> | ||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>s.run(<span class="st">'1+1'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div> | ||
<div class="cell-output cell-output-display"> | ||
<pre><code>[{'data': {'text/plain': ['2']}, | ||
'metadata': {}, | ||
'output_type': 'execute_result', | ||
'execution_count': 1}]</code></pre> | ||
</div> | ||
</div> | ||
<p>To execute a notebook and save it with outputs filled in, use <code>execute</code>:</p> | ||
<div class="cell"> | ||
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="cf">try</span>:</span> | ||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> s.execute(<span class="st">'../tests/clean.ipynb'</span>, <span class="st">'tmp.ipynb'</span>)</span> | ||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(read_nb(<span class="st">'tmp.ipynb'</span>).cells[<span class="dv">1</span>].outputs)</span> | ||
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="cf">finally</span>: Path(<span class="st">'tmp.ipynb'</span>).unlink()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div> | ||
<div class="cell-output cell-output-stdout"> | ||
<pre><code>[{'data': {'text/plain': ['2']}, 'execution_count': 6, 'metadata': {}, 'output_type': 'execute_result'}, {'name': 'stdout', 'output_type': 'stream', 'text': ['1']}]</code></pre> | ||
</div> | ||
</div> | ||
|
||
|
||
</section> | ||
|
||
</main> <!-- /main --> | ||
<script id="quarto-html-after-body" type="application/javascript"> | ||
window.document.addEventListener("DOMContentLoaded", function (event) { | ||
const icon = ""; | ||
const anchorJS = new window.AnchorJS(); | ||
anchorJS.options = { | ||
placement: 'right', | ||
icon: icon | ||
}; | ||
anchorJS.add('.anchored'); | ||
const clipboard = new window.ClipboardJS('.code-copy-button', { | ||
target: function(trigger) { | ||
return trigger.previousElementSibling; | ||
} | ||
}); | ||
clipboard.on('success', function(e) { | ||
// button target | ||
const button = e.trigger; | ||
// don't keep focus | ||
button.blur(); | ||
// flash "checked" | ||
button.classList.add('code-copy-button-checked'); | ||
var currentTitle = button.getAttribute("title"); | ||
button.setAttribute("title", "Copied!"); | ||
setTimeout(function() { | ||
button.setAttribute("title", currentTitle); | ||
button.classList.remove('code-copy-button-checked'); | ||
}, 1000); | ||
// clear code selection | ||
e.clearSelection(); | ||
}); | ||
function tippyHover(el, contentFn) { | ||
const config = { | ||
allowHTML: true, | ||
content: contentFn, | ||
maxWidth: 500, | ||
delay: 100, | ||
arrow: false, | ||
appendTo: function(el) { | ||
return el.parentElement; | ||
}, | ||
interactive: true, | ||
interactiveBorder: 10, | ||
theme: 'quarto', | ||
placement: 'bottom-start' | ||
}; | ||
window.tippy(el, config); | ||
} | ||
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]'); | ||
for (var i=0; i<noterefs.length; i++) { | ||
const ref = noterefs[i]; | ||
tippyHover(ref, function() { | ||
let href = ref.getAttribute('href'); | ||
try { href = new URL(href).hash; } catch {} | ||
const id = href.replace(/^#\/?/, ""); | ||
const note = window.document.getElementById(id); | ||
return note.innerHTML; | ||
}); | ||
} | ||
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]'); | ||
for (var i=0; i<bibliorefs.length; i++) { | ||
const ref = bibliorefs[i]; | ||
const cites = ref.parentNode.getAttribute('data-cites').split(' '); | ||
tippyHover(ref, function() { | ||
var popup = window.document.createElement('div'); | ||
cites.forEach(function(cite) { | ||
var citeDiv = window.document.createElement('div'); | ||
citeDiv.classList.add('hanging-indent'); | ||
citeDiv.classList.add('csl-entry'); | ||
var biblioDiv = window.document.getElementById('ref-' + cite); | ||
if (biblioDiv) { | ||
citeDiv.innerHTML = biblioDiv.innerHTML; | ||
} | ||
popup.appendChild(citeDiv); | ||
}); | ||
return popup.innerHTML; | ||
}); | ||
} | ||
}); | ||
</script> | ||
</div> <!-- /content --> | ||
|
||
|
||
|
||
</body></html> |
Oops, something went wrong.