Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlKCarlK committed Feb 6, 2024
1 parent df7e307 commit 5b6e8ec
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 101 deletions.
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 0ffcf54393a856012dadc0b1563f2c43
config: bf1d0a21c26d9c55c442915740521680
tags: 645f666f9bcd5a90fca523b33c5a78b7
36 changes: 21 additions & 15 deletions docs/_modules/bed_reader/_open_bed.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; Bed Reader 1.0.1-beta.2 documentation</title>
<title>Overview: module code &mdash; Bed Reader 1.0.1-beta.5 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/documentation_options.js?v=8c107f28"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
Expand All @@ -30,7 +30,7 @@
Bed Reader
</a>
<div class="version">
1.0.1-beta.2
1.0.1-beta.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
Expand Down
1 change: 1 addition & 0 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
################################

.. currentmodule:: bed_reader

Read and write the PLINK BED format, simply and efficiently.

Features:
Expand Down
22 changes: 22 additions & 0 deletions docs/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ a.headerlink {
visibility: hidden;
}

a:visited {
color: #551A8B;
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -670,6 +674,16 @@ dd {
margin-left: 30px;
}

.sig dd {
margin-top: 0px;
margin-bottom: 0px;
}

.sig dl {
margin-top: 0px;
margin-bottom: 0px;
}

dl > dd:last-child,
dl > dd:last-child > :last-child {
margin-bottom: 0;
Expand Down Expand Up @@ -738,6 +752,14 @@ abbr, acronym {
cursor: help;
}

.translated {
background-color: rgba(207, 255, 207, 0.2)
}

.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}

/* -- code displays --------------------------------------------------------- */

pre {
Expand Down
5 changes: 2 additions & 3 deletions docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.0.1-beta.2',
const DOCUMENTATION_OPTIONS = {
VERSION: '1.0.1-beta.5',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
26 changes: 17 additions & 9 deletions docs/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ const _removeChildren = (element) => {
const _escapeRegExp = (string) =>
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string

const _displayItem = (item, searchTerms) => {
const _displayItem = (item, searchTerms, highlightTerms) => {
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
const contentRoot = document.documentElement.dataset.content_root;

const [docName, title, anchor, descr, score, _filename] = item;

Expand All @@ -75,20 +75,24 @@ const _displayItem = (item, searchTerms) => {
if (dirname.match(/\/index\/$/))
dirname = dirname.substring(0, dirname.length - 6);
else if (dirname === "index/") dirname = "";
requestUrl = docUrlRoot + dirname;
requestUrl = contentRoot + dirname;
linkUrl = requestUrl;
} else {
// normal html builders
requestUrl = docUrlRoot + docName + docFileSuffix;
requestUrl = contentRoot + docName + docFileSuffix;
linkUrl = docName + docLinkSuffix;
}
let linkEl = listItem.appendChild(document.createElement("a"));
linkEl.href = linkUrl + anchor;
linkEl.dataset.score = score;
linkEl.innerHTML = title;
if (descr)
if (descr) {
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
// highlight search terms in the description
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
}
else if (showSearchSummary)
fetch(requestUrl)
.then((responseData) => responseData.text())
Expand All @@ -97,6 +101,9 @@ const _displayItem = (item, searchTerms) => {
listItem.appendChild(
Search.makeSearchSummary(data, searchTerms)
);
// highlight search terms in the summary
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
});
Search.output.appendChild(listItem);
};
Expand All @@ -115,14 +122,15 @@ const _finishSearch = (resultCount) => {
const _displayNextItem = (
results,
resultCount,
searchTerms
searchTerms,
highlightTerms,
) => {
// results left, load the summary and display it
// this is intended to be dynamic (don't sub resultsCount)
if (results.length) {
_displayItem(results.pop(), searchTerms);
_displayItem(results.pop(), searchTerms, highlightTerms);
setTimeout(
() => _displayNextItem(results, resultCount, searchTerms),
() => _displayNextItem(results, resultCount, searchTerms, highlightTerms),
5
);
}
Expand Down Expand Up @@ -360,7 +368,7 @@ const Search = {
// console.info("search results:", Search.lastresults);

// print the results
_displayNextItem(results, results.length, searchTerms);
_displayNextItem(results, results.length, searchTerms, highlightTerms);
},

/**
Expand Down
16 changes: 13 additions & 3 deletions docs/_static/sphinx_highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ const _highlight = (node, addItems, text, className) => {
}

span.appendChild(document.createTextNode(val.substr(pos, text.length)));
const rest = document.createTextNode(val.substr(pos + text.length));
parent.insertBefore(
span,
parent.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
rest,
node.nextSibling
)
);
node.nodeValue = val.substr(0, pos);
/* There may be more occurrences of search term in this node. So call this
* function recursively on the remaining fragment.
*/
_highlight(rest, addItems, text, className);

if (isInSVG) {
const rect = document.createElementNS(
Expand Down Expand Up @@ -140,5 +145,10 @@ const SphinxHighlight = {
},
};

_ready(SphinxHighlight.highlightSearchWords);
_ready(SphinxHighlight.initEscapeListener);
_ready(() => {
/* Do not call highlightSearchWords() when we are on the search page.
* It will highlight words from the *previous* search query.
*/
if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords();
SphinxHighlight.initEscapeListener();
});
20 changes: 10 additions & 10 deletions docs/cloud_urls.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cloud URL Examples &mdash; Bed Reader 1.0.1-beta.2 documentation</title>
<title>Cloud URL Examples &mdash; Bed Reader 1.0.1-beta.5 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/documentation_options.js?v=8c107f28"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
Expand All @@ -32,7 +32,7 @@
Bed Reader
</a>
<div class="version">
1.0.1-beta.2
1.0.1-beta.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down Expand Up @@ -79,7 +79,7 @@
<div itemprop="articleBody">

<section id="cloud-url-examples">
<h1>Cloud URL Examples<a class="headerlink" href="#cloud-url-examples" title="Permalink to this heading"></a></h1>
<h1>Cloud URL Examples<a class="headerlink" href="#cloud-url-examples" title="Link to this heading"></a></h1>
<p><em>Table of Contents</em>:</p>
<ul class="simple">
<li><p><a class="reference external" href="#http-section">Http</a></p></li>
Expand All @@ -93,7 +93,7 @@ <h1>Cloud URL Examples<a class="headerlink" href="#cloud-url-examples" title="Pe
<p>To specify a file in the cloud, you must specify URL string plus optional cloud options.</p>
<p>The exact details depend on the cloud service. We’ll look at <cite>http</cite>, at <cite>local files</cite>, and at <cite>AWS S3</cite>.</p>
<section id="http-section">
<span id="id1"></span><h2>Http<a class="headerlink" href="#http-section" title="Permalink to this heading"></a></h2>
<span id="id1"></span><h2>Http<a class="headerlink" href="#http-section" title="Link to this heading"></a></h2>
<p>You can read *.bed files from web sites directly. For small files, access will be fast. For medium-sized files,
you may need to extend the default <cite>timeout</cite>.</p>
<p>Reading from large files can also be practical and even fast under these conditions:</p>
Expand Down Expand Up @@ -199,11 +199,11 @@ <h1>Cloud URL Examples<a class="headerlink" href="#cloud-url-examples" title="Pe
</div>
</section>
<section id="local-file-section">
<span id="id2"></span><h2>Local File<a class="headerlink" href="#local-file-section" title="Permalink to this heading"></a></h2>
<span id="id2"></span><h2>Local File<a class="headerlink" href="#local-file-section" title="Link to this heading"></a></h2>
<p>We can specify a local file as if it is in the cloud. This is a great way to test cloud functions. For real work and better efficiency, however,
use the file’s path rather than its URL.</p>
<section id="local-file-url">
<h3>Local File URL<a class="headerlink" href="#local-file-url" title="Permalink to this heading"></a></h3>
<h3>Local File URL<a class="headerlink" href="#local-file-url" title="Link to this heading"></a></h3>
<p>The URL for a local file takes the form <cite>file:///{encoded_file_name}</cite>. No cloud options are needed.</p>
<p><em>Example:</em></p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
Expand All @@ -227,7 +227,7 @@ <h3>Local File URL<a class="headerlink" href="#local-file-url" title="Permalink
</section>
</section>
<section id="aws-section">
<span id="id3"></span><h2>AWS S3<a class="headerlink" href="#aws-section" title="Permalink to this heading"></a></h2>
<span id="id3"></span><h2>AWS S3<a class="headerlink" href="#aws-section" title="Link to this heading"></a></h2>
<p>Let’s look next at reading a file (or part of a file) from AWS S3.</p>
<p>The URL for an AWS S3 file takes the form <cite>s3://{bucket_name}/{s3_path}</cite>.</p>
<p>AWS forbids putting some needed information in the URL. Instead, that information must go into a string-to-string
Expand Down
10 changes: 5 additions & 5 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; Bed Reader 1.0.1-beta.2 documentation</title>
<title>Index &mdash; Bed Reader 1.0.1-beta.5 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/documentation_options.js?v=8c107f28"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="#" />
<link rel="search" title="Search" href="search.html" />
Expand All @@ -30,7 +30,7 @@
Bed Reader
</a>
<div class="version">
1.0.1-beta.2
1.0.1-beta.5
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
Expand Down
Loading

0 comments on commit 5b6e8ec

Please sign in to comment.