Skip to content

Commit

Permalink
v1.9.0.1 archive documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhassell committed Oct 12, 2021
1 parent 2cf3cff commit 8e6ac54
Show file tree
Hide file tree
Showing 1,980 changed files with 411,919 additions and 0 deletions.
609 changes: 609 additions & 0 deletions docs/1.9.0.1/Changelog.html

Large diffs are not rendered by default.

Binary file added docs/1.9.0.1/_downloads/cfdm_tutorial_files.zip
Binary file not shown.
803 changes: 803 additions & 0 deletions docs/1.9.0.1/_downloads/tutorial.py

Large diffs are not rendered by default.

317 changes: 317 additions & 0 deletions docs/1.9.0.1/_images/cfdm_field.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
703 changes: 703 additions & 0 deletions docs/1.9.0.1/_static/alabaster.css

Large diffs are not rendered by default.

768 changes: 768 additions & 0 deletions docs/1.9.0.1/_static/basic.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/1.9.0.1/_static/clipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions docs/1.9.0.1/_static/copy-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions docs/1.9.0.1/_static/copybutton.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/* Copy buttons */
a.copybtn {
position: absolute;
top: .2em;
right: .2em;
width: 1em;
height: 1em;
opacity: .3;
transition: opacity 0.5s;
border: none;
user-select: none;
}

div.highlight {
position: relative;
}

a.copybtn > img {
vertical-align: top;
margin: 0;
top: 0;
left: 0;
position: absolute;
}

.highlight:hover .copybtn {
opacity: 1;
}

/**
* A minimal CSS-only tooltip copied from:
* https://codepen.io/mildrenben/pen/rVBrpK
*
* To use, write HTML like the following:
*
* <p class="o-tooltip--left" data-tooltip="Hey">Short</p>
*/
.o-tooltip--left {
position: relative;
}

.o-tooltip--left:after {
opacity: 0;
visibility: hidden;
position: absolute;
content: attr(data-tooltip);
padding: 2px;
top: 0;
left: -.2em;
background: grey;
font-size: 1rem;
color: white;
white-space: nowrap;
z-index: 2;
border-radius: 2px;
transform: translateX(-102%) translateY(0);
transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
}

.o-tooltip--left:hover:after {
display: block;
opacity: 1;
visibility: visible;
transform: translateX(-100%) translateY(0);
transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
transition-delay: .5s;
}
153 changes: 153 additions & 0 deletions docs/1.9.0.1/_static/copybutton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
// Localization support
const messages = {
'en': {
'copy': 'Copy',
'copy_to_clipboard': 'Copy to clipboard',
'copy_success': 'Copied!',
'copy_failure': 'Failed to copy',
},
'es' : {
'copy': 'Copiar',
'copy_to_clipboard': 'Copiar al portapapeles',
'copy_success': '¡Copiado!',
'copy_failure': 'Error al copiar',
},
'de' : {
'copy': 'Kopieren',
'copy_to_clipboard': 'In die Zwischenablage kopieren',
'copy_success': 'Kopiert!',
'copy_failure': 'Fehler beim Kopieren',
}
}

let locale = 'en'
if( document.documentElement.lang !== undefined
&& messages[document.documentElement.lang] !== undefined ) {
locale = document.documentElement.lang
}

/**
* Set up copy/paste for code blocks
*/

const runWhenDOMLoaded = cb => {
if (document.readyState != 'loading') {
cb()
} else if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', cb)
} else {
document.attachEvent('onreadystatechange', function() {
if (document.readyState == 'complete') cb()
})
}
}

const codeCellId = index => `codecell${index}`

// Clears selected text since ClipboardJS will select the text when copying
const clearSelection = () => {
if (window.getSelection) {
window.getSelection().removeAllRanges()
} else if (document.selection) {
document.selection.empty()
}
}

// Changes tooltip text for two seconds, then changes it back
const temporarilyChangeTooltip = (el, newText) => {
const oldText = el.getAttribute('data-tooltip')
el.setAttribute('data-tooltip', newText)
setTimeout(() => el.setAttribute('data-tooltip', oldText), 2000)
}

const addCopyButtonToCodeCells = () => {
// If ClipboardJS hasn't loaded, wait a bit and try again. This
// happens because we load ClipboardJS asynchronously.
if (window.ClipboardJS === undefined) {
setTimeout(addCopyButtonToCodeCells, 250)
return
}

// Add copybuttons to all of our code cells
const codeCells = document.querySelectorAll('div.highlight pre')
codeCells.forEach((codeCell, index) => {
const id = codeCellId(index)
codeCell.setAttribute('id', id)
const pre_bg = getComputedStyle(codeCell).backgroundColor;

const clipboardButton = id =>
`<a class="copybtn o-tooltip--left" style="background-color: ${pre_bg}" data-tooltip="${messages[locale]['copy']}" data-clipboard-target="#${id}">
<img src="${DOCUMENTATION_OPTIONS.URL_ROOT}_static/copy-button.svg" alt="${messages[locale]['copy_to_clipboard']}">
</a>`
codeCell.insertAdjacentHTML('afterend', clipboardButton(id))
})

function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}

// Callback when a copy button is clicked. Will be passed the node that was clicked
// should then grab the text and replace pieces of text that shouldn't be used in output
function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true) {

var regexp;
var match;

// create regexp to capture prompt and remaining line
if (isRegexp) {
regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)')
} else {
regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)')
}

const outputLines = [];
var promptFound = false;
for (const line of textContent.split('\n')) {
match = line.match(regexp)
if (match) {
promptFound = true
if (removePrompts) {
outputLines.push(match[2])
} else {
outputLines.push(line)
}
} else {
if (!onlyCopyPromptLines) {
outputLines.push(line)
}
}
}

// If no lines with the prompt were found then just use original lines
if (promptFound) {
textContent = outputLines.join('\n');
}

// Remove a trailing newline to avoid auto-running when pasting
if (textContent.endsWith("\n")) {
textContent = textContent.slice(0, -1)
}
return textContent
}


var copyTargetText = (trigger) => {
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);
return formatCopyText(target.innerText, '$ ', false, true, true)
}

// Initialize with a callback so we can modify the text before copy
const clipboard = new ClipboardJS('.copybtn', {text: copyTargetText})

// Update UI with error/success messages
clipboard.on('success', event => {
clearSelection()
temporarilyChangeTooltip(event.trigger, messages[locale]['copy_success'])
})

clipboard.on('error', event => {
temporarilyChangeTooltip(event.trigger, messages[locale]['copy_failure'])
})
}

runWhenDOMLoaded(addCopyButtonToCodeCells)
47 changes: 47 additions & 0 deletions docs/1.9.0.1/_static/copybutton_funcs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}

// Callback when a copy button is clicked. Will be passed the node that was clicked
// should then grab the text and replace pieces of text that shouldn't be used in output
export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true) {

var regexp;
var match;

// create regexp to capture prompt and remaining line
if (isRegexp) {
regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)')
} else {
regexp = new RegExp('^(' + escapeRegExp(copybuttonPromptText) + ')(.*)')
}

const outputLines = [];
var promptFound = false;
for (const line of textContent.split('\n')) {
match = line.match(regexp)
if (match) {
promptFound = true
if (removePrompts) {
outputLines.push(match[2])
} else {
outputLines.push(line)
}
} else {
if (!onlyCopyPromptLines) {
outputLines.push(line)
}
}
}

// If no lines with the prompt were found then just use original lines
if (promptFound) {
textContent = outputLines.join('\n');
}

// Remove a trailing newline to avoid auto-running when pasting
if (textContent.endsWith("\n")) {
textContent = textContent.slice(0, -1)
}
return textContent
}
1 change: 1 addition & 0 deletions docs/1.9.0.1/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This file intentionally left blank. */
Loading

0 comments on commit 8e6ac54

Please sign in to comment.