Skip to content

Commit

Permalink
Merge pull request #42 from amitgaru2/develop
Browse files Browse the repository at this point in the history
v1.0.8 release
  • Loading branch information
amitgaru2 authored Sep 2, 2023
2 parents 04d3359 + 50c32c3 commit 95909e4
Show file tree
Hide file tree
Showing 28 changed files with 2,006 additions and 1,556 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ operates on top of Bikram Sambat (B.S) Date & Nepal Time (NPT) `+05:45`.
>>> nepali_datetime.datetime(1990, 5, 10, 5, 10, 20) + datetime.timedelta(hours=3, minutes=15)
# nepali_datetime.date(1990, 5, 10, 8, 25, 20)

# convert B.S to A.D date and vice-versa
>>> nepali_datetime.date(1999, 7, 25).to_datetime_date()
# datetime.date(1942, 11, 10)
>>> nepali_datetime.date.from_datetime_date(datetime.date(1942, 11, 10))
# nepali_datetime.date(1999, 7, 25)

# Bikram Sambat monthly calendar
>>> nepali_datetime.date(2078, 1, 1).calendar()

Expand Down
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/html/.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: ed0882741d6ebfe77624f9316dc42315
config: 44920cdf20da09e863663628b65a8886
tags: 645f666f9bcd5a90fca523b33c5a78b7
79 changes: 50 additions & 29 deletions docs/html/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -222,7 +222,7 @@ table.modindextable td {
/* -- general body styles --------------------------------------------------- */

div.body {
min-width: 450px;
min-width: 360px;
max-width: 800px;
}

Expand All @@ -237,14 +237,8 @@ a.headerlink {
visibility: hidden;
}

a.brackets:before,
span.brackets > a:before{
content: "[";
}

a.brackets:after,
span.brackets > a:after {
content: "]";
a:visited {
color: #551A8B;
}

h1:hover > a.headerlink,
Expand Down Expand Up @@ -335,12 +329,16 @@ p.sidebar-title {
font-weight: bold;
}

nav.contents,
aside.topic,
div.admonition, div.topic, blockquote {
clear: left;
}

/* -- topics ---------------------------------------------------------------- */

nav.contents,
aside.topic,
div.topic {
border: 1px solid #ccc;
padding: 7px;
Expand Down Expand Up @@ -379,13 +377,17 @@ div.body p.centered {

div.sidebar > :last-child,
aside.sidebar > :last-child,
nav.contents > :last-child,
aside.topic > :last-child,
div.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
}

div.sidebar::after,
aside.sidebar::after,
nav.contents::after,
aside.topic::after,
div.topic::after,
div.admonition::after,
blockquote::after {
Expand Down Expand Up @@ -428,10 +430,6 @@ table.docutils td, table.docutils th {
border-bottom: 1px solid #aaa;
}

table.footnote td, table.footnote th {
border: 0 !important;
}

th {
text-align: left;
padding-right: 5px;
Expand Down Expand Up @@ -615,19 +613,26 @@ ul.simple p {
margin-bottom: 0;
}

dl.footnote > dt,
dl.citation > dt {
aside.footnote > span,
div.citation > span {
float: left;
margin-right: 0.5em;
}

dl.footnote > dd,
dl.citation > dd {
aside.footnote > span:last-of-type,
div.citation > span:last-of-type {
padding-right: 0.5em;
}
aside.footnote > p {
margin-left: 2em;
}
div.citation > p {
margin-left: 4em;
}
aside.footnote > p:last-of-type,
div.citation > p:last-of-type {
margin-bottom: 0em;
}

dl.footnote > dd:after,
dl.citation > dd:after {
aside.footnote > p:last-of-type:after,
div.citation > p:last-of-type:after {
content: "";
clear: both;
}
Expand All @@ -644,10 +649,6 @@ dl.field-list > dt {
padding-right: 5px;
}

dl.field-list > dt:after {
content: ":";
}

dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
Expand All @@ -673,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 @@ -731,15 +742,24 @@ dl.glossary dt {

.classifier:before {
font-style: normal;
margin: 0.5em;
margin: 0 0.5em;
content: ":";
display: inline-block;
}

abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
}

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

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

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

pre {
Expand All @@ -756,6 +776,7 @@ span.pre {
-ms-hyphens: none;
-webkit-hyphens: none;
hyphens: none;
white-space: nowrap;
}

div[class*="highlight-"] {
Expand Down Expand Up @@ -819,7 +840,7 @@ div.code-block-caption code {

table.highlighttable td.linenos,
span.linenos,
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none;
-webkit-user-select: text; /* Safari fallback only */
-webkit-user-select: none; /* Chrome/Safari */
Expand Down
5 changes: 4 additions & 1 deletion docs/html/_static/classic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- classic theme.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand All @@ -28,6 +28,7 @@ body {
}

div.document {
display: flex;
background-color: white;
}

Expand Down Expand Up @@ -205,6 +206,8 @@ div.seealso {
border: 1px solid #ff6;
}

nav.contents,
aside.topic,
div.topic {
background-color: #eee;
}
Expand Down
140 changes: 84 additions & 56 deletions docs/html/_static/copybutton.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,92 @@
$(document).ready(function() {
/* Add a [>>>] button on the top-right corner of code samples to hide
// ``function*`` denotes a generator in JavaScript, see
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*
function* getHideableCopyButtonElements(rootElement) {
// yield all elements with the "go" (Generic.Output),
// "gp" (Generic.Prompt), or "gt" (Generic.Traceback) CSS class
for (const el of rootElement.querySelectorAll('.go, .gp, .gt')) {
yield el
}
// tracebacks (.gt) contain bare text elements that need to be
// wrapped in a span to hide or show the element
for (let el of rootElement.querySelectorAll('.gt')) {
while ((el = el.nextSibling) && el.nodeType !== Node.DOCUMENT_NODE) {
// stop wrapping text nodes when we hit the next output or
// prompt element
if (el.nodeType === Node.ELEMENT_NODE && el.matches(".gp, .go")) {
break
}
// if the node is a text node with content, wrap it in a
// span element so that we can control visibility
if (el.nodeType === Node.TEXT_NODE && el.textContent.trim()) {
const wrapper = document.createElement("span")
el.after(wrapper)
wrapper.appendChild(el)
el = wrapper
}
yield el
}
}
}


const loadCopyButton = () => {
/* Add a [>>>] button in the top-right corner of code samples to hide
* the >>> and ... prompts and the output and thus make the code
* copyable. */
var div = $('.highlight-python .highlight,' +
'.highlight-python3 .highlight,' +
'.highlight-pycon .highlight,' +
'.highlight-pycon3 .highlight,' +
'.highlight-default .highlight');
var pre = div.find('pre');
const hide_text = "Hide the prompts and output"
const show_text = "Show the prompts and output"

// get the styles from the current theme
pre.parent().parent().css('position', 'relative');
var hide_text = 'Hide the prompts and output';
var show_text = 'Show the prompts and output';
var border_width = pre.css('border-top-width');
var border_style = pre.css('border-top-style');
var border_color = pre.css('border-top-color');
var button_styles = {
'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0',
'border-color': border_color, 'border-style': border_style,
'border-width': border_width, 'color': border_color, 'text-size': '75%',
'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em',
'border-radius': '0 3px 0 0'
const button = document.createElement("span")
button.classList.add("copybutton")
button.innerText = ">>>"
button.title = hide_text
button.dataset.hidden = "false"
const buttonClick = event => {
// define the behavior of the button when it's clicked
event.preventDefault()
const buttonEl = event.currentTarget
const codeEl = buttonEl.nextElementSibling
if (buttonEl.dataset.hidden === "false") {
// hide the code output
for (const el of getHideableCopyButtonElements(codeEl)) {
el.hidden = true
}
buttonEl.title = show_text
buttonEl.dataset.hidden = "true"
} else {
// show the code output
for (const el of getHideableCopyButtonElements(codeEl)) {
el.hidden = false
}
buttonEl.title = hide_text
buttonEl.dataset.hidden = "false"
}
}

const highlightedElements = document.querySelectorAll(
".highlight-python .highlight,"
+ ".highlight-python3 .highlight,"
+ ".highlight-pycon .highlight,"
+ ".highlight-pycon3 .highlight,"
+ ".highlight-default .highlight"
)

// create and add the button to all the code blocks that contain >>>
div.each(function(index) {
var jthis = $(this);
if (jthis.find('.gp').length > 0) {
var button = $('<span class="copybutton">&gt;&gt;&gt;</span>');
button.css(button_styles)
button.attr('title', hide_text);
button.data('hidden', 'false');
jthis.prepend(button);
}
// tracebacks (.gt) contain bare text elements that need to be
// wrapped in a span to work with .nextUntil() (see later)
jthis.find('pre:has(.gt)').contents().filter(function() {
return ((this.nodeType == 3) && (this.data.trim().length > 0));
}).wrap('<span>');
});
highlightedElements.forEach(el => {
el.style.position = "relative"

// define the behavior of the button when it's clicked
$('.copybutton').click(function(e){
e.preventDefault();
var button = $(this);
if (button.data('hidden') === 'false') {
// hide the code output
button.parent().find('.go, .gp, .gt').hide();
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
button.css('text-decoration', 'line-through');
button.attr('title', show_text);
button.data('hidden', 'true');
} else {
// show the code output
button.parent().find('.go, .gp, .gt').show();
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
button.css('text-decoration', 'none');
button.attr('title', hide_text);
button.data('hidden', 'false');
// if we find a console prompt (.gp), prepend the (deeply cloned) button
const clonedButton = button.cloneNode(true)
// the onclick attribute is not cloned, set it on the new element
clonedButton.onclick = buttonClick
if (el.querySelector(".gp") !== null) {
el.prepend(clonedButton)
}
});
});
})
}

if (document.readyState !== "loading") {
loadCopyButton()
} else {
document.addEventListener("DOMContentLoaded", loadCopyButton)
}
Loading

0 comments on commit 95909e4

Please sign in to comment.