Skip to content

Commit 52fc6a2

Browse files
committed
v3.3.2 latest documentation
1 parent aa07a2c commit 52fc6a2

37 files changed

+904
-218
lines changed

docs/Changelog.html

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838

39-
<h1 class="logo"><a href="index.html">cfunits 3.3.1</a></h1>
39+
<h1 class="logo"><a href="index.html">cfunits 3.3.2</a></h1>
4040

4141

4242

@@ -84,6 +84,26 @@ <h3>Related Topics</h3>
8484
</ul></li>
8585
</ul>
8686
</div>
87+
88+
<br>
89+
cfunits development has been supported by
90+
the <a href="https://erc.europa.eu/">ERC</a>
91+
through <a href="https://cordis.europa.eu/project/id/247220">Seachange</a>
92+
and
93+
<a href="https://cordis.europa.eu/project/id/786427">Couplet</a>; by
94+
the <a href="https://ec.europa.eu/programmes/horizon2020/">EC Horizon
95+
2020 programme</a> through
96+
<a href="https://cordis.europa.eu/project/id/824084">IS-ENES3</a>;
97+
by <a href="https://nerc.ukri.org/">NERC</a> through
98+
<a href="https://gtr.ukri.org/project/0D95A6DB-0B95-48F7-8A8B-7B9A47DEA117">UKFAFMIP</a>;
99+
and by <a href="https://ncas.ac.uk/">NCAS</a>.
100+
<br>
101+
<br>
102+
<img src="../_templates/logo_EC.png" height="40">
103+
<img src="../_templates/logo_ERC.png" height="40">
104+
<img src="../_templates/logo_NERC.png" height="40">
105+
<br>
106+
<img src="../_templates/logo_NCAS.png" height="40">
87107
</div>
88108
</div>
89109
<div class="documentwrapper">
@@ -95,6 +115,17 @@ <h3>Related Topics</h3>
95115
<div class="section" id="change-log">
96116
<h1><strong>Change log</strong><a class="headerlink" href="#change-log" title="Permalink to this headline"></a></h1>
97117
<hr class="docutils" />
118+
<div class="section" id="version-3-3-2">
119+
<h2>version 3.3.2<a class="headerlink" href="#version-3-3-2" title="Permalink to this headline"></a></h2>
120+
<hr class="docutils" />
121+
<p><strong>2021-05-21</strong></p>
122+
<ul class="simple">
123+
<li><p>Refactor to remove the dependency on <code class="xref py py-obj docutils literal notranslate"><span class="pre">cftime.utime</span></code>, that was removed
124+
at <a class="reference external" href="https://unidata.github.io/cftime/api.html#module-cftime" title="(in cftime)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cftime</span></code></a> version 1.5.0
125+
(<a class="reference external" href="https://github.com/NCAS-CMS/cfunits/issues/25">https://github.com/NCAS-CMS/cfunits/issues/25</a>)</p></li>
126+
<li><p>Changed dependency: <code class="docutils literal notranslate"><span class="pre">cftime&gt;=1.5.0</span></code></p></li>
127+
</ul>
128+
</div>
98129
<div class="section" id="version-3-3-1">
99130
<h2>version 3.3.1<a class="headerlink" href="#version-3-3-1" title="Permalink to this headline"></a></h2>
100131
<hr class="docutils" />
@@ -307,11 +338,11 @@ <h2>version 1.0<a class="headerlink" href="#version-1-0" title="Permalink to thi
307338
<div class="clearer"></div>
308339
</div>
309340
<div class="footer">
310-
&copy;2020, NCAS | Page built on 2020-11-27.
341+
&copy;2021, NCAS | Page built on 2021-05-21.
311342

312343
|
313344
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.3.1</a>
314-
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.11</a>
345+
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
315346

316347
</div>
317348

docs/_static/alabaster.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,19 @@ div.sphinxsidebar hr {
162162
width: 50%;
163163
}
164164

165+
div.sphinxsidebar .badge {
166+
border-bottom: none;
167+
}
168+
169+
div.sphinxsidebar .badge:hover {
170+
border-bottom: none;
171+
}
172+
173+
/* To address an issue with donation coming after search */
174+
div.sphinxsidebar h3.donation {
175+
margin-top: 10px;
176+
}
177+
165178
/* -- body styles ----------------------------------------------------------- */
166179

167180
a {
@@ -310,7 +323,7 @@ p.admonition-title:after {
310323
}
311324

312325
pre, tt, code {
313-
font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
326+
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
314327
font-size: 10pt;
315328
}
316329

docs/_static/copy-button.svg

Lines changed: 5 additions & 1 deletion
Loading

docs/_static/copybutton.js

Lines changed: 54 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -60,46 +60,6 @@ const temporarilyChangeTooltip = (el, newText) => {
6060
setTimeout(() => el.setAttribute('data-tooltip', oldText), 2000)
6161
}
6262

63-
// Callback when a copy button is clicked. Will be passed the node that was clicked
64-
// should then grab the text and replace pieces of text that shouldn't be used in output
65-
var copyTargetText = (trigger) => {
66-
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);
67-
var textContent = target.innerText.split('\n');
68-
var copybuttonPromptText = '$ '; // Inserted from config
69-
var onlyCopyPromptLines = true; // Inserted from config
70-
var removePrompts = true; // Inserted from config
71-
72-
// Text content line filtering based on prompts (if a prompt text is given)
73-
if (copybuttonPromptText.length > 0) {
74-
// If only copying prompt lines, remove all lines that don't start w/ prompt
75-
if (onlyCopyPromptLines) {
76-
linesWithPrompt = textContent.filter((line) => {
77-
return line.startsWith(copybuttonPromptText) || (line.length == 0); // Keep newlines
78-
});
79-
// Check to make sure we have at least one non-empty line
80-
var nonEmptyLines = linesWithPrompt.filter((line) => {return line.length > 0});
81-
// If we detected lines w/ prompt, then overwrite textContent w/ those lines
82-
if ((linesWithPrompt.length > 0) && (nonEmptyLines.length > 0)) {
83-
textContent = linesWithPrompt;
84-
}
85-
}
86-
// Remove the starting prompt from any remaining lines
87-
if (removePrompts) {
88-
textContent.forEach((line, index) => {
89-
if (line.startsWith(copybuttonPromptText)) {
90-
textContent[index] = line.slice(copybuttonPromptText.length);
91-
}
92-
});
93-
}
94-
}
95-
textContent = textContent.join('\n');
96-
// Remove a trailing newline to avoid auto-running when pasting
97-
if (textContent.endsWith("\n")) {
98-
textContent = textContent.slice(0, -1)
99-
}
100-
return textContent
101-
}
102-
10363
const addCopyButtonToCodeCells = () => {
10464
// If ClipboardJS hasn't loaded, wait a bit and try again. This
10565
// happens because we load ClipboardJS asynchronously.
@@ -122,6 +82,60 @@ const addCopyButtonToCodeCells = () => {
12282
codeCell.insertAdjacentHTML('afterend', clipboardButton(id))
12383
})
12484

85+
function escapeRegExp(string) {
86+
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
87+
}
88+
89+
// Callback when a copy button is clicked. Will be passed the node that was clicked
90+
// should then grab the text and replace pieces of text that shouldn't be used in output
91+
function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true) {
92+
93+
var regexp;
94+
var match;
95+
96+
// create regexp to capture prompt and remaining line
97+
if (isRegexp) {
98+
regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)')
99+
} else {
100+
regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)')
101+
}
102+
103+
const outputLines = [];
104+
var promptFound = false;
105+
for (const line of textContent.split('\n')) {
106+
match = line.match(regexp)
107+
if (match) {
108+
promptFound = true
109+
if (removePrompts) {
110+
outputLines.push(match[2])
111+
} else {
112+
outputLines.push(line)
113+
}
114+
} else {
115+
if (!onlyCopyPromptLines) {
116+
outputLines.push(line)
117+
}
118+
}
119+
}
120+
121+
// If no lines with the prompt were found then just use original lines
122+
if (promptFound) {
123+
textContent = outputLines.join('\n');
124+
}
125+
126+
// Remove a trailing newline to avoid auto-running when pasting
127+
if (textContent.endsWith("\n")) {
128+
textContent = textContent.slice(0, -1)
129+
}
130+
return textContent
131+
}
132+
133+
134+
var copyTargetText = (trigger) => {
135+
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);
136+
return formatCopyText(target.innerText, '$ ', false, true, true)
137+
}
138+
125139
// Initialize with a callback so we can modify the text before copy
126140
const clipboard = new ClipboardJS('.copybtn', {text: copyTargetText})
127141

docs/_static/copybutton_funcs.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
function escapeRegExp(string) {
2+
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
3+
}
4+
5+
// Callback when a copy button is clicked. Will be passed the node that was clicked
6+
// should then grab the text and replace pieces of text that shouldn't be used in output
7+
export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true) {
8+
9+
var regexp;
10+
var match;
11+
12+
// create regexp to capture prompt and remaining line
13+
if (isRegexp) {
14+
regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)')
15+
} else {
16+
regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)')
17+
}
18+
19+
const outputLines = [];
20+
var promptFound = false;
21+
for (const line of textContent.split('\n')) {
22+
match = line.match(regexp)
23+
if (match) {
24+
promptFound = true
25+
if (removePrompts) {
26+
outputLines.push(match[2])
27+
} else {
28+
outputLines.push(line)
29+
}
30+
} else {
31+
if (!onlyCopyPromptLines) {
32+
outputLines.push(line)
33+
}
34+
}
35+
}
36+
37+
// If no lines with the prompt were found then just use original lines
38+
if (promptFound) {
39+
textContent = outputLines.join('\n');
40+
}
41+
42+
// Remove a trailing newline to avoid auto-running when pasting
43+
if (textContent.endsWith("\n")) {
44+
textContent = textContent.slice(0, -1)
45+
}
46+
return textContent
47+
}

docs/_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var DOCUMENTATION_OPTIONS = {
22
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
3-
VERSION: '3.3.1',
3+
VERSION: '3.3.2',
44
LANGUAGE: 'None',
55
COLLAPSE_INDEX: false,
66
BUILDER: 'html',

docs/_static/pygments.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
pre { line-height: 125%; }
2+
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
3+
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
4+
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
5+
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
16
.highlight .hll { background-color: #ffffcc }
2-
.highlight { background: #f8f8f8; }
7+
.highlight { background: #f8f8f8; }
38
.highlight .c { color: #8f5902; font-style: italic } /* Comment */
49
.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */
510
.highlight .g { color: #000000 } /* Generic */

docs/_static/toggleprompt.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ $(document).ready(function() {
99
var div = $('.highlight-python .highlight,' +
1010
'.highlight-python3 .highlight,' +
1111
'.highlight-pycon .highlight,' +
12+
'.highlight-pycon3 .highlight,' +
13+
'.highlight-ipython .highlight,' +
1214
'.highlight-default .highlight');
1315
var pre = div.find('pre');
1416

@@ -24,7 +26,8 @@ $(document).ready(function() {
2426
'border-color': border_color, 'border-style': border_style,
2527
'border-width': border_width, 'color': border_color, 'text-size': '75%',
2628
'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em',
27-
'border-radius': '0 3px 0 0'
29+
'border-radius': '0 3px 0 0',
30+
'user-select': 'none'
2831
}
2932

3033
// create and add the button to all the code blocks that contain >>>
@@ -50,15 +53,19 @@ $(document).ready(function() {
5053
var button = $(this);
5154
if (button.data('hidden') === 'false') {
5255
// hide the code output
53-
button.parent().find('.go, .gp, .gt').hide();
54-
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
56+
// `.go` for comments
57+
// `.gp` for ">>>", "...", "In [x]:"
58+
// `.gt` for tracebacks
59+
// `.gh` for "Out[x]:"
60+
button.parent().find('.go, .gp, .gh, .gt').hide();
61+
button.next('pre').find('.gt').nextUntil('.gp, .gh, .go').css('visibility', 'hidden');
5562
button.css('text-decoration', 'line-through');
5663
button.attr('title', show_text);
5764
button.data('hidden', 'true');
5865
} else {
5966
// show the code output
60-
button.parent().find('.go, .gp, .gt').show();
61-
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
67+
button.parent().find('.go, .gp, .gh, .gt').show();
68+
button.next('pre').find('.gt').nextUntil('.gp, .gh, .go').css('visibility', 'visible');
6269
button.css('text-decoration', 'none');
6370
button.attr('title', hide_text);
6471
button.data('hidden', 'false');

0 commit comments

Comments
 (0)