From 05d64c2003805735f1a42363796f321efaa902cf Mon Sep 17 00:00:00 2001 From: blueswen Date: Wed, 10 Aug 2022 21:35:37 +0800 Subject: [PATCH] update docs --- demo-mkdocs/docs/disable/image.md | 26 ++ demo-mkdocs/docs/disable/page.md | 34 +++ demo-mkdocs/docs/index.md | 8 +- demo-mkdocs/mkdocs.yml | 5 + docs/404.html | 91 +++++- .../assets/javascripts/bundle.15234abc.min.js | 3 + .../assets/javascripts/bundle.5e3df397.min.js | 3 - docs/assets/stylesheets/main.19db47b7.min.css | 1 - docs/assets/stylesheets/main.846d444e.min.css | 1 + docs/disable/image/index.html | 284 ++++++++++++++++++ docs/disable/page/index.html | 275 +++++++++++++++++ docs/gallery/index.html | 50 ++- docs/index.html | 46 ++- docs/sitemap.xml | 18 +- docs/sitemap.xml.gz | Bin 249 -> 262 bytes docs/taiwan/mountain/index.html | 37 ++- docs/taiwan/sea/index.html | 37 ++- 17 files changed, 890 insertions(+), 29 deletions(-) create mode 100644 demo-mkdocs/docs/disable/image.md create mode 100644 demo-mkdocs/docs/disable/page.md create mode 100644 docs/assets/javascripts/bundle.15234abc.min.js delete mode 100644 docs/assets/javascripts/bundle.5e3df397.min.js delete mode 100644 docs/assets/stylesheets/main.19db47b7.min.css create mode 100644 docs/assets/stylesheets/main.846d444e.min.css create mode 100644 docs/disable/image/index.html create mode 100644 docs/disable/page/index.html diff --git a/demo-mkdocs/docs/disable/image.md b/demo-mkdocs/docs/disable/image.md new file mode 100644 index 0000000..6d49a68 --- /dev/null +++ b/demo-mkdocs/docs/disable/image.md @@ -0,0 +1,26 @@ +You can disable lightbox of images separately by adding ```off-glb``` class through markdown_extensions ```attr_list```. Enable ```attr_list``` via ```mkdocs.yml```: + +```yaml +markdown_extensions: + - attr_list +``` + +Check more detail about ```attr_list``` on the [official document](https://python-markdown.github.io/extensions/attr_list/). + +## Demo + +The first image's lightbox is disabled. + +```markdown +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .off-glb } +Lanyu, Taiwan. Credit: Blueswen + +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) +Obertraun, Austria. Credit: Blueswen +``` + +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .off-glb } +Lanyu, Taiwan. Credit: Blueswen + +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) +Obertraun, Austria. Credit: Blueswen diff --git a/demo-mkdocs/docs/disable/page.md b/demo-mkdocs/docs/disable/page.md new file mode 100644 index 0000000..67a5a76 --- /dev/null +++ b/demo-mkdocs/docs/disable/page.md @@ -0,0 +1,34 @@ +--- +glightbox: false +--- + +You can disable lightbox of all images on a specific page by adding page metadata ```glightbox: false``` through markdown_extensions ```meta```. Enable ```meta``` via ```mkdocs.yml```: + +```yaml +markdown_extensions: + - meta +``` + +Check more detail about ```meta``` on the [official document](https://python-markdown.github.io/extensions/meta_data/). + +## Demo + +All images' lightbox are disabled on this page. + +```markdown +--- +glightbox: false +--- + +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg) +Lanyu, Taiwan. Credit: Blueswen + +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) +Obertraun, Austria. Credit: Blueswen +``` + +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg) +Lanyu, Taiwan. Credit: Blueswen + +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) +Obertraun, Austria. Credit: Blueswen diff --git a/demo-mkdocs/docs/index.md b/demo-mkdocs/docs/index.md index 6958480..1d47f31 100644 --- a/demo-mkdocs/docs/index.md +++ b/demo-mkdocs/docs/index.md @@ -7,7 +7,7 @@ GLightbox is a pure javascript lightbox library with mobile support. ## Dependency 1. Python Package - 1. beautifulsoup4==4.11.1 + 1. beautifulsoup4>=4.11.1 2. GLightbox javascript file and css file 1. GLightbox==3.2.0 @@ -19,7 +19,7 @@ GLightbox is a pure javascript lightbox library with mobile support. pip install mkdocs-glightbox ``` -2. Add ```glightbox``` plugin in to your mkdocs.yml plugins sections: +2. Add ```glightbox``` plugin to your mkdocs.yml plugins sections: ```yaml plugins: @@ -52,9 +52,11 @@ GLightbox is a pure javascript lightbox library with mobile support. Check more options information on [GLightbox Docs](https://github.com/biati-digital/glightbox#lightbox-options). +4. For more flexibility, you can disable lightbox by a [specific image](./disable/image.md) or a [specific page](./disable/page.md). + ## Demo -Click image to try lightbox and enjoy the view of Taiwan. +Click the image to try lightbox and enjoy the view of Taiwan. ![Sunset over Taipei City](./images/thomas-tucker-sunset-over-taipei-city.jpg) Sunset over Taipei City. Credit: [Thomas Tucker](https://unsplash.com/photos/au3CYbd7vCU) diff --git a/demo-mkdocs/mkdocs.yml b/demo-mkdocs/mkdocs.yml index 1ac4c5e..c13196d 100644 --- a/demo-mkdocs/mkdocs.yml +++ b/demo-mkdocs/mkdocs.yml @@ -44,6 +44,8 @@ markdown_extensions: - pymdownx.inlinehilite - pymdownx.snippets - pymdownx.superfences + - attr_list + - meta plugins: - glightbox @@ -54,3 +56,6 @@ nav: - Sea: taiwan/sea.md - Mountain: taiwan/mountain.md - Gallery: gallery.md + - More Flexibility: + - Disable by image: disable/image.md + - Disable by page: disable/page.md diff --git a/docs/404.html b/docs/404.html index 09c7d2d..ed287c7 100644 --- a/docs/404.html +++ b/docs/404.html @@ -12,7 +12,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -82,6 +82,10 @@ + + + + @@ -346,6 +350,87 @@ + + + + + + + + + + + + +
  • + + + + + + + + + + +
  • + + + @@ -393,7 +478,7 @@

    404 - Not found

    - + diff --git a/docs/assets/javascripts/bundle.15234abc.min.js b/docs/assets/javascripts/bundle.15234abc.min.js new file mode 100644 index 0000000..aa6c804 --- /dev/null +++ b/docs/assets/javascripts/bundle.15234abc.min.js @@ -0,0 +1,3 @@ +"use strict";(()=>{var la=Object.create;var Mr=Object.defineProperty;var ua=Object.getOwnPropertyDescriptor;var ma=Object.getOwnPropertyNames,Ut=Object.getOwnPropertySymbols,da=Object.getPrototypeOf,Lr=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable;var ln=(e,t,r)=>t in e?Mr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H=(e,t)=>{for(var r in t||(t={}))Lr.call(t,r)&&ln(e,r,t[r]);if(Ut)for(var r of Ut(t))un.call(t,r)&&ln(e,r,t[r]);return e};var mn=(e,t)=>{var r={};for(var n in e)Lr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ut)for(var n of Ut(e))t.indexOf(n)<0&&un.call(e,n)&&(r[n]=e[n]);return r};var Ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ha=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ma(t))!Lr.call(e,o)&&o!==r&&Mr(e,o,{get:()=>t[o],enumerable:!(n=ua(t,o))||n.enumerable});return e};var ot=(e,t,r)=>(r=e!=null?la(da(e)):{},ha(t||!e||!e.__esModule?Mr(r,"default",{value:e,enumerable:!0}):r,e));var hn=Ot((Ar,dn)=>{(function(e,t){typeof Ar=="object"&&typeof dn!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(Ar,function(){"use strict";function e(r){var n=!0,o=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(M){return!!(M&&M!==document&&M.nodeName!=="HTML"&&M.nodeName!=="BODY"&&"classList"in M&&"contains"in M.classList)}function c(M){var ze=M.type,Ue=M.tagName;return!!(Ue==="INPUT"&&a[ze]&&!M.readOnly||Ue==="TEXTAREA"&&!M.readOnly||M.isContentEditable)}function p(M){M.classList.contains("focus-visible")||(M.classList.add("focus-visible"),M.setAttribute("data-focus-visible-added",""))}function f(M){!M.hasAttribute("data-focus-visible-added")||(M.classList.remove("focus-visible"),M.removeAttribute("data-focus-visible-added"))}function l(M){M.metaKey||M.altKey||M.ctrlKey||(s(r.activeElement)&&p(r.activeElement),n=!0)}function m(M){n=!1}function d(M){!s(M.target)||(n||c(M.target))&&p(M.target)}function h(M){!s(M.target)||(M.target.classList.contains("focus-visible")||M.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),f(M.target))}function b(M){document.visibilityState==="hidden"&&(o&&(n=!0),U())}function U(){document.addEventListener("mousemove",V),document.addEventListener("mousedown",V),document.addEventListener("mouseup",V),document.addEventListener("pointermove",V),document.addEventListener("pointerdown",V),document.addEventListener("pointerup",V),document.addEventListener("touchmove",V),document.addEventListener("touchstart",V),document.addEventListener("touchend",V)}function X(){document.removeEventListener("mousemove",V),document.removeEventListener("mousedown",V),document.removeEventListener("mouseup",V),document.removeEventListener("pointermove",V),document.removeEventListener("pointerdown",V),document.removeEventListener("pointerup",V),document.removeEventListener("touchmove",V),document.removeEventListener("touchstart",V),document.removeEventListener("touchend",V)}function V(M){M.target.nodeName&&M.target.nodeName.toLowerCase()==="html"||(n=!1,X())}document.addEventListener("keydown",l,!0),document.addEventListener("mousedown",m,!0),document.addEventListener("pointerdown",m,!0),document.addEventListener("touchstart",m,!0),document.addEventListener("visibilitychange",b,!0),U(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var bn=Ot(Cr=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(p){return!1}},r=t(),n=function(p){var f={next:function(){var l=p.shift();return{done:l===void 0,value:l}}};return r&&(f[Symbol.iterator]=function(){return f}),f},o=function(p){return encodeURIComponent(p).replace(/%20/g,"+")},i=function(p){return decodeURIComponent(String(p).replace(/\+/g," "))},a=function(){var p=function(l){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var m=typeof l;if(m!=="undefined")if(m==="string")l!==""&&this._fromString(l);else if(l instanceof p){var d=this;l.forEach(function(X,V){d.append(V,X)})}else if(l!==null&&m==="object")if(Object.prototype.toString.call(l)==="[object Array]")for(var h=0;hd[0]?1:0}),p._entries&&(p._entries={});for(var l=0;l1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Cr);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(c,p){typeof c!="string"&&(c=String(c)),p&&typeof p!="string"&&(p=String(p));var f=document,l;if(p&&(e.location===void 0||p!==e.location.href)){p=p.toLowerCase(),f=document.implementation.createHTMLDocument(""),l=f.createElement("base"),l.href=p,f.head.appendChild(l);try{if(l.href.indexOf(p)!==0)throw new Error(l.href)}catch(M){throw new Error("URL unable to set base "+p+" due to "+M)}}var m=f.createElement("a");m.href=c,l&&(f.body.appendChild(m),m.href=m.href);var d=f.createElement("input");if(d.type="url",d.value=c,m.protocol===":"||!/:/.test(m.href)||!d.checkValidity()&&!p)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:m});var h=new e.URLSearchParams(this.search),b=!0,U=!0,X=this;["append","delete","set"].forEach(function(M){var ze=h[M];h[M]=function(){ze.apply(h,arguments),b&&(U=!1,X.search=h.toString(),U=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var V=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==V&&(V=this.search,U&&(b=!1,this.searchParams._fromString(this.search),b=!0))}})},a=i.prototype,s=function(c){Object.defineProperty(a,c,{get:function(){return this._anchorElement[c]},set:function(p){this._anchorElement[c]=p},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(c){s(c)}),Object.defineProperty(a,"search",{get:function(){return this._anchorElement.search},set:function(c){this._anchorElement.search=c,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(a,{toString:{get:function(){var c=this;return function(){return c.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(c){this._anchorElement.href=c,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(c){this._anchorElement.pathname=c},enumerable:!0},origin:{get:function(){var c={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],p=this._anchorElement.port!=c&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(p?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(c){},enumerable:!0},username:{get:function(){return""},set:function(c){},enumerable:!0}}),i.createObjectURL=function(c){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(c){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Cr)});var jn=Ot((rc,Vt)=>{var vn,gn,yn,xn,En,wn,Sn,On,Tn,Wt,kr,_n,Mn,Ln,it,An,Cn,kn,Rn,Hn,Pn,In,$n,Dt;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Vt=="object"&&typeof Vt.exports=="object"?e(r(t,r(Vt.exports))):e(r(t));function r(n,o){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,a){return n[i]=o?o(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};vn=function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(n,o);function i(){this.constructor=n}n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},gn=Object.assign||function(n){for(var o,i=1,a=arguments.length;i=0;f--)(p=n[f])&&(c=(s<3?p(c):s>3?p(o,i,c):p(o,i))||c);return s>3&&c&&Object.defineProperty(o,i,c),c},En=function(n,o){return function(i,a){o(i,a,n)}},wn=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},Sn=function(n,o,i,a){function s(c){return c instanceof i?c:new i(function(p){p(c)})}return new(i||(i=Promise))(function(c,p){function f(d){try{m(a.next(d))}catch(h){p(h)}}function l(d){try{m(a.throw(d))}catch(h){p(h)}}function m(d){d.done?c(d.value):s(d.value).then(f,l)}m((a=a.apply(n,o||[])).next())})},On=function(n,o){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},a,s,c,p;return p={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function f(m){return function(d){return l([m,d])}}function l(m){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(c=m[0]&2?s.return:m[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,m[1])).done)return c;switch(s=0,c&&(m=[m[0]&2,c.value]),m[0]){case 0:case 1:c=m;break;case 4:return i.label++,{value:m[1],done:!1};case 5:i.label++,s=m[1],m=[0];continue;case 7:m=i.ops.pop(),i.trys.pop();continue;default:if(c=i.trys,!(c=c.length>0&&c[c.length-1])&&(m[0]===6||m[0]===2)){i=0;continue}if(m[0]===3&&(!c||m[1]>c[0]&&m[1]=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},kr=function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var a=i.call(n),s,c=[],p;try{for(;(o===void 0||o-- >0)&&!(s=a.next()).done;)c.push(s.value)}catch(f){p={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(p)throw p.error}}return c},_n=function(){for(var n=[],o=0;o1||f(b,U)})})}function f(b,U){try{l(a[b](U))}catch(X){h(c[0][3],X)}}function l(b){b.value instanceof it?Promise.resolve(b.value.v).then(m,d):h(c[0][2],b)}function m(b){f("next",b)}function d(b){f("throw",b)}function h(b,U){b(U),c.shift(),c.length&&f(c[0][0],c[0][1])}},Cn=function(n){var o,i;return o={},a("next"),a("throw",function(s){throw s}),a("return"),o[Symbol.iterator]=function(){return this},o;function a(s,c){o[s]=n[s]?function(p){return(i=!i)?{value:it(n[s](p)),done:s==="return"}:c?c(p):p}:c}},kn=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof Wt=="function"?Wt(n):n[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(c){i[c]=n[c]&&function(p){return new Promise(function(f,l){p=n[c](p),s(f,l,p.done,p.value)})}}function s(c,p,f,l){Promise.resolve(l).then(function(m){c({value:m,done:f})},p)}},Rn=function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n};var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};Hn=function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&Dt(o,n,i);return r(o,n),o},Pn=function(n){return n&&n.__esModule?n:{default:n}},In=function(n,o,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!a:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(n):a?a.value:o.get(n)},$n=function(n,o,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(n,i):s?s.value=i:o.set(n,i),i},e("__extends",vn),e("__assign",gn),e("__rest",yn),e("__decorate",xn),e("__param",En),e("__metadata",wn),e("__awaiter",Sn),e("__generator",On),e("__exportStar",Tn),e("__createBinding",Dt),e("__values",Wt),e("__read",kr),e("__spread",_n),e("__spreadArrays",Mn),e("__spreadArray",Ln),e("__await",it),e("__asyncGenerator",An),e("__asyncDelegator",Cn),e("__asyncValues",kn),e("__makeTemplateObject",Rn),e("__importStar",Hn),e("__importDefault",Pn),e("__classPrivateFieldGet",In),e("__classPrivateFieldSet",$n)})});var rn=Ot(($t,tn)=>{(function(t,r){typeof $t=="object"&&typeof tn=="object"?tn.exports=r():typeof define=="function"&&define.amd?define([],r):typeof $t=="object"?$t.ClipboardJS=r():t.ClipboardJS=r()})($t,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return fa}});var a=i(279),s=i.n(a),c=i(370),p=i.n(c),f=i(817),l=i.n(f);function m(j){try{return document.execCommand(j)}catch(L){return!1}}var d=function(L){var T=l()(L);return m("cut"),T},h=d;function b(j){var L=document.documentElement.getAttribute("dir")==="rtl",T=document.createElement("textarea");T.style.fontSize="12pt",T.style.border="0",T.style.padding="0",T.style.margin="0",T.style.position="absolute",T.style[L?"right":"left"]="-9999px";var P=window.pageYOffset||document.documentElement.scrollTop;return T.style.top="".concat(P,"px"),T.setAttribute("readonly",""),T.value=j,T}var U=function(L,T){var P=b(L);T.container.appendChild(P);var $=l()(P);return m("copy"),P.remove(),$},X=function(L){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},P="";return typeof L=="string"?P=U(L,T):L instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(L==null?void 0:L.type)?P=U(L.value,T):(P=l()(L),m("copy")),P},V=X;function M(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M=function(T){return typeof T}:M=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},M(j)}var ze=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},T=L.action,P=T===void 0?"copy":T,$=L.container,Q=L.target,Ae=L.text;if(P!=="copy"&&P!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Q!==void 0)if(Q&&M(Q)==="object"&&Q.nodeType===1){if(P==="copy"&&Q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(P==="cut"&&(Q.hasAttribute("readonly")||Q.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Ae)return V(Ae,{container:$});if(Q)return P==="cut"?h(Q):V(Q,{container:$})},Ue=ze;function Pe(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pe=function(T){return typeof T}:Pe=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},Pe(j)}function ra(j,L){if(!(j instanceof L))throw new TypeError("Cannot call a class as a function")}function fn(j,L){for(var T=0;T0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof $.action=="function"?$.action:this.defaultAction,this.target=typeof $.target=="function"?$.target:this.defaultTarget,this.text=typeof $.text=="function"?$.text:this.defaultText,this.container=Pe($.container)==="object"?$.container:document.body}},{key:"listenClick",value:function($){var Q=this;this.listener=p()($,"click",function(Ae){return Q.onClick(Ae)})}},{key:"onClick",value:function($){var Q=$.delegateTarget||$.currentTarget,Ae=this.action(Q)||"copy",Ft=Ue({action:Ae,container:this.container,target:this.target(Q),text:this.text(Q)});this.emit(Ft?"success":"error",{action:Ae,text:Ft,trigger:Q,clearSelection:function(){Q&&Q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function($){return _r("action",$)}},{key:"defaultTarget",value:function($){var Q=_r("target",$);if(Q)return document.querySelector(Q)}},{key:"defaultText",value:function($){return _r("text",$)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function($){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return V($,Q)}},{key:"cut",value:function($){return h($)}},{key:"isSupported",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Q=typeof $=="string"?[$]:$,Ae=!!document.queryCommandSupported;return Q.forEach(function(Ft){Ae=Ae&&!!document.queryCommandSupported(Ft)}),Ae}}]),T}(s()),fa=pa},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,c){for(;s&&s.nodeType!==o;){if(typeof s.matches=="function"&&s.matches(c))return s;s=s.parentNode}}n.exports=a},438:function(n,o,i){var a=i(828);function s(f,l,m,d,h){var b=p.apply(this,arguments);return f.addEventListener(m,b,h),{destroy:function(){f.removeEventListener(m,b,h)}}}function c(f,l,m,d,h){return typeof f.addEventListener=="function"?s.apply(null,arguments):typeof m=="function"?s.bind(null,document).apply(null,arguments):(typeof f=="string"&&(f=document.querySelectorAll(f)),Array.prototype.map.call(f,function(b){return s(b,l,m,d,h)}))}function p(f,l,m,d){return function(h){h.delegateTarget=a(h.target,l),h.delegateTarget&&d.call(f,h)}}n.exports=c},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(n,o,i){var a=i(879),s=i(438);function c(m,d,h){if(!m&&!d&&!h)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(h))throw new TypeError("Third argument must be a Function");if(a.node(m))return p(m,d,h);if(a.nodeList(m))return f(m,d,h);if(a.string(m))return l(m,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function p(m,d,h){return m.addEventListener(d,h),{destroy:function(){m.removeEventListener(d,h)}}}function f(m,d,h){return Array.prototype.forEach.call(m,function(b){b.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(m,function(b){b.removeEventListener(d,h)})}}}function l(m,d,h){return s(document.body,m,d,h)}n.exports=c},817:function(n){function o(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),p=document.createRange();p.selectNodeContents(i),c.removeAllRanges(),c.addRange(p),a=c.toString()}return a}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,a,s){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var c=this;function p(){c.off(i,p),a.apply(s,arguments)}return p._=a,this.on(i,p,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),c=0,p=s.length;for(c;c{"use strict";var $s=/["'&<>]/;Mi.exports=js;function js(e){var t=""+e,r=$s.exec(t);if(!r)return t;var n,o="",i=0,a=0;for(i=r.index;i{function e(o,i){parent.postMessage(o,i||"*")}function t(...o){return o.reduce((i,a)=>i.then(()=>new Promise(s=>{let c=document.createElement("script");c.src=a,c.addEventListener("load",()=>s()),document.body.appendChild(c)})),Promise.resolve())}function r(){let o=document.createElement("iframe");return o.width=o.height=o.frameBorder="0",o}var n=class{constructor(o,i){if(this.url=o,this.onerror=null,this.onmessage=null,this.onmessageerror=null,this.handleMessage=s=>{s.source===this.worker&&(s.stopImmediatePropagation(),this.dispatchEvent(new MessageEvent("message",{data:s.data})),this.onmessage&&this.onmessage(s))},this.handleError=(s,c,p,f,l)=>{if(c===this.url.toString()){let m=new ErrorEvent("error",{message:s,filename:c,lineno:p,colno:f,error:l});this.dispatchEvent(m),this.onerror&&this.onerror(m)}},typeof i!="undefined")throw new TypeError("Options are not supported for iframe workers");let a=new EventTarget;this.addEventListener=a.addEventListener.bind(a),this.removeEventListener=a.removeEventListener.bind(a),this.dispatchEvent=a.dispatchEvent.bind(a),document.body.appendChild(this.iframe=r()),this.worker.document.open(),this.worker.document.write(` + + + + + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    Disable by image

    +

    You can disable lightbox of images separately by adding off-glb class through markdown_extensions attr_list. Enable attr_list via mkdocs.yml:

    +
    markdown_extensions:
    +  - attr_list
    +
    +

    Check more detail about attr_list on the official document.

    +

    Demo

    +

    The first image's lightbox is disabled.

    +
    ![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .off-glb }
    +Lanyu, Taiwan. Credit: Blueswen
    +
    +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) 
    +Obertraun, Austria. Credit: Blueswen
    +
    +

    Lanyu, Taiwan +Lanyu, Taiwan. Credit: Blueswen

    +

    Obertraun, Austria +Obertraun, Austria. Credit: Blueswen

    +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/disable/page/index.html b/docs/disable/page/index.html new file mode 100644 index 0000000..99b0dda --- /dev/null +++ b/docs/disable/page/index.html @@ -0,0 +1,275 @@ + + + + + + + + + + +Disable by page - MkDocs GLightbox + + + + + + + + + + + + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    Disable by page

    +

    You can disable lightbox of all images on a specific page by adding page metadata glightbox: false through markdown_extensions meta. Enable meta via mkdocs.yml:

    +
    markdown_extensions:
    +  - meta
    +
    +

    Check more detail about meta on the official document.

    +

    Demo

    +

    All images' lightbox are disabled on this page.

    +
    ---
    +glightbox: false
    +---
    +
    +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg) 
    +Lanyu, Taiwan. Credit: Blueswen
    +
    +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) 
    +Obertraun, Austria. Credit: Blueswen
    +
    +

    Lanyu, Taiwan +Lanyu, Taiwan. Credit: Blueswen

    +

    Obertraun, Austria +Obertraun, Austria. Credit: Blueswen

    +
    + +
    +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/gallery/index.html b/docs/gallery/index.html index a339918..5129a47 100644 --- a/docs/gallery/index.html +++ b/docs/gallery/index.html @@ -7,9 +7,9 @@ - + Gallery - MkDocs GLightbox - + @@ -147,6 +147,37 @@ +
  • + + + +
  • @@ -183,6 +214,19 @@

    Gallery

    + @@ -205,7 +236,7 @@

    MkDocs GLightbox

    Dependency

    1. Python Package
        -
      1. beautifulsoup4==4.11.1
      2. +
      3. beautifulsoup4>=4.11.1
    2. GLightbox javascript file and css file
        @@ -221,7 +252,7 @@

        Usage

      1. -

        Add glightbox plugin in to your mkdocs.yml plugins sections:

        +

        Add glightbox plugin to your mkdocs.yml plugins sections:

        plugins:
            - glightbox
         
        @@ -286,9 +317,12 @@

        Usage

        Check more options information on GLightbox Docs.

      2. +
      3. +

        For more flexibility, you can disable lightbox by a specific image or a specific page.

        +

      Demo

      -

      Click image to try lightbox and enjoy the view of Taiwan.

      +

      Click the image to try lightbox and enjoy the view of Taiwan.

      Sunset over Taipei City Sunset over Taipei City. Credit: Thomas Tucker

      Lanyu, Taiwan @@ -336,6 +370,6 @@

      License

      - + \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 7283f32..3230f9d 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -2,22 +2,32 @@ https://github.com/blueswen/mkdocs-glightbox/ - 2022-07-16 + 2022-08-10 daily https://github.com/blueswen/mkdocs-glightbox/gallery/ - 2022-07-16 + 2022-08-10 + daily + + + https://github.com/blueswen/mkdocs-glightbox/disable/image/ + 2022-08-10 + daily + + + https://github.com/blueswen/mkdocs-glightbox/disable/page/ + 2022-08-10 daily https://github.com/blueswen/mkdocs-glightbox/taiwan/mountain/ - 2022-07-16 + 2022-08-10 daily https://github.com/blueswen/mkdocs-glightbox/taiwan/sea/ - 2022-07-16 + 2022-08-10 daily \ No newline at end of file diff --git a/docs/sitemap.xml.gz b/docs/sitemap.xml.gz index 8594a2583cc743b86bc1d5f3cf6866bd610cae93..86915c9cec28a883ab932d338cc37b64bcf7cfb1 100644 GIT binary patch literal 262 zcmV+h0r~zPiwFo3wDV#D|8r?{Wo=<_E_iKh0M(Q|Zo@DPh4-Ao&~DN3loqzK^#tt! zWSNzO>cXCLox^@*Lu zp_`K<%vCW5>Y2%TdIeaPg_F(b^^|2|Ir?#;vBZJ1zgcmVN z>uw!vlm{C8vi+G-OXo1%c0xN^l7mCAUTWMK^Ryr2EbStT9_LWTurF#t`TxN8R{o3l M0khEL#g7C40C@U?EC2ui literal 249 zcmV|fNA-IXq@nO|3QHI$dgTQHeE$YK*qo zEE8AJ!{ipEf&u*J92K?NS#9zZPcXoGvQ3bbeVj$#^?lntw)=-_xoI1lGBRlVNcbgY zY2A5%jdDeUU$#F}YUv!N^PSLUX^X6STtXegeNhw2{|COb`uO4pB9iTVC<6chwRe4k diff --git a/docs/taiwan/mountain/index.html b/docs/taiwan/mountain/index.html index 21c8bbd..10c456a 100644 --- a/docs/taiwan/mountain/index.html +++ b/docs/taiwan/mountain/index.html @@ -7,9 +7,9 @@ - + Mountain - MkDocs GLightbox - + @@ -147,6 +147,37 @@
    3. +
    4. + + + +
    5. @@ -213,6 +244,6 @@

      Mountain

      - + \ No newline at end of file diff --git a/docs/taiwan/sea/index.html b/docs/taiwan/sea/index.html index e8b3f36..0c47a70 100644 --- a/docs/taiwan/sea/index.html +++ b/docs/taiwan/sea/index.html @@ -7,9 +7,9 @@ - + Sea - MkDocs GLightbox - + @@ -147,6 +147,37 @@ +
    6. + + + +
    7. @@ -213,6 +244,6 @@

      Sea

      - + \ No newline at end of file