jekyll-theme-open-project 2.0.14 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79ea8a8a088c799b53b693af44ff15fe09ae2b8e
4
- data.tar.gz: 86e8690e0233209490694e5412d9e3d85168cdd8
3
+ metadata.gz: f3dfd201cb4a8e24160005f658abcf1de56eed59
4
+ data.tar.gz: ea6818b8f0e03ad32aebf194c14004be7a7144c4
5
5
  SHA512:
6
- metadata.gz: d2d0cff7661698030d97a7f8d04ae2701b9606bbece07ef96fa21b8126bffefbc683c13c83b4e353aca91b0ed831958ab9ebe2d4645d8ce4531012142e9a7627
7
- data.tar.gz: 4a2d8bc2fa1dce11f8469720b3afe21669159f45dbd770327a483fa2b5f4676a3bc075ec358f53c0fcaaff2519dcdc5930b1be7b9b05b928523fc9db3d59837d
6
+ metadata.gz: 855b217e521c3cb691a0e6f639bf3d6a232bbb4aa028fb5c3c010a313f79895cd2bc2130900f13ad1418651189c30370173ddbe028b925020e71914188fdf640
7
+ data.tar.gz: 6637f3b27c2d116af706cfb5a43d59c9cacdda51aef7b1079f536833d7be97bcc0401828a61e9ecb1c279cbded4e41efcc2ea356194ad99f56d83b5cd03ffd68
data/README.md CHANGED
@@ -25,8 +25,12 @@ to AWS S3.
25
25
  * [SVG guidelines](#svg-guidelines)
26
26
  * [Content guidelines](#content-guidelines)
27
27
 
28
- * [Layouts](#theme-layouts)
29
- * [Includes](#theme-includes)
28
+ * [Authoring content](#authoring-content)
29
+
30
+ * References:
31
+
32
+ * [Layouts](#theme-layouts)
33
+ * [Includes](#theme-includes)
30
34
 
31
35
 
32
36
  ## Starting a site with this theme
@@ -116,6 +120,11 @@ These settings apply to both site types (hub and project).
116
120
  # and without trailing slash.
117
121
  # Used e.g. for marking external links in docs and blog posts.
118
122
 
123
+ github_repo_url: https://github.com/example-org/example.com
124
+ # URL to GitHub repo for the site.
125
+ # Using GitHub & specifying this setting is currently required
126
+ # for “suggest edits” buttons to show on documentation pages.
127
+
119
128
  title: Example
120
129
  description: The example of examples
121
130
  # The above two are used by jekyll-seo-tag for things such as
@@ -650,6 +659,36 @@ Place the symbol in assets/symbol.svg within project directory.
650
659
  - Blog post excerpt: about 20–24 words, no markup
651
660
 
652
661
 
662
+ ## Authoring content
663
+
664
+ Content is expected to be authored in AsciiDoc.
665
+ Some features, such as in-page navigation in software/project documentation
666
+ and code listing copy buttons,
667
+ require HTML structure to match the one generated from AsciiDoc by jekyll-asciidoc
668
+ and won’t work with content is authored in Markdown, for example.
669
+
670
+ ### Disabling copy button on code listings
671
+
672
+ By default, each code listing widget, like below, will have a copy button
673
+ next to the `<pre>` element.
674
+
675
+ ```
676
+ [source,sh]
677
+ ----
678
+ docker pull ribose/metanorma
679
+ ----
680
+ ```
681
+
682
+ To disable that button for a particular listing, add `.nocopy` class to it:
683
+
684
+ ```
685
+ [.nocopy]
686
+ [source,sh]
687
+ ----
688
+ docker pull ribose/metanorma
689
+ ----
690
+ ```
691
+
653
692
  ## Theme includes
654
693
 
655
694
  Commonly used overridable includes are (paths relative to your site root):
@@ -102,7 +102,9 @@ supporting expandable navigation widget.
102
102
  <button class="docs-nav-toggle">Toggle table of contents</button>
103
103
 
104
104
  {% assign suggest_edits_base_url = item_data.docs.git_repo_url | default: item_data.repo_url %}
105
- <a href="{{ suggest_edits_base_url }}/edit/master/{{ item_data.docs.git_repo_subtree | default: "docs" }}/{{ page.path | split: "/" | last }}" class="docs-suggest-edits">Suggest edits to this page</a>
105
+ {% if suggest_edits_base_url %}
106
+ <a href="{{ suggest_edits_base_url }}/edit/master/{{ item_data.docs.git_repo_subtree | default: "docs" }}/{{ page.path | split: "/" | last }}" class="docs-suggest-edits">Suggest edits to this page</a>
107
+ {% endif %}
106
108
  </nav>
107
109
  {% endif %}
108
110
 
@@ -128,6 +128,7 @@
128
128
  {% comment %}
129
129
  This would break a strict CSP, but Jekyll refuses to Liquid-process JS files
130
130
  without also adding HTML wrapping. Eek.
131
+ TODO: Move this to data attributes on <body>.
131
132
  {% endcomment %}
132
133
  <script>
133
134
  window.initAlgolia = function () {
@@ -141,6 +142,8 @@
141
142
  </script>
142
143
  {% endif %}
143
144
 
145
+ <script src="{{ "assets/js/clipboard.min.js" | relative_url }}"></script>
146
+ <script src="{{ "assets/listing-widget.js" | relative_url }}"></script>
144
147
  <script src="{{ "assets/js/headroom.min.js" | relative_url }}"></script>
145
148
  <script src="{{ "assets/js/opf.js" | relative_url }}"></script>
146
149
 
@@ -260,6 +260,20 @@
260
260
  .content {
261
261
  align-self: stretch;
262
262
 
263
+ position: relative;
264
+ button.listing-clipboard-button {
265
+ position: absolute;
266
+ right: 0;
267
+ top: .25em;
268
+ padding: .3em .3em;
269
+ font-size: 80%;
270
+ transform: translateX(100%);
271
+ color: $code-listing-border-color;
272
+ background: $code-listing-background-color;
273
+ border: 0;
274
+ cursor: pointer;
275
+ }
276
+
263
277
  pre {
264
278
  margin: 0;
265
279
  }
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * clipboard.js v2.0.4
3
+ * https://zenorocha.github.io/clipboard.js
4
+ *
5
+ * Licensed MIT © Zeno Rocha
6
+ */
7
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=o(n(1)),c=o(n(3)),u=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return n.resolveOptions(e),n.listenClick(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,c.default),i(o,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===r(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,u.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return s("action",t)}},{key:"defaultTarget",value:function(t){var e=s("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return s("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),o}();function s(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=l},function(t,e,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=n(2),c=(o=a)&&o.__esModule?o:{default:o};var u=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return i(e,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,c.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,c.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();t.exports=u},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var d=n(5),h=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(l=t).addEventListener(s,f),{destroy:function(){l.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,u=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(c,u)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(c,u)})}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,u,l,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(7);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])});
@@ -0,0 +1,19 @@
1
+ (function () {
2
+
3
+ const listings = document.querySelectorAll('main .listingblock:not(.nocopy) pre');
4
+ const buttonHint = 'Copy code to clipboard';
5
+
6
+ for (let el of listings) {
7
+ let copyBtn = document.createElement('button');
8
+ copyBtn.innerHTML = '<i class="fas fa-copy"></i>';
9
+ copyBtn.setAttribute('aria-label', buttonHint);
10
+ copyBtn.setAttribute('title', buttonHint);
11
+ copyBtn.classList.add('listing-clipboard-button');
12
+ el.parentNode.insertBefore(copyBtn, el);
13
+ }
14
+
15
+ new ClipboardJS(document.querySelectorAll('button.listing-clipboard-button'), {
16
+ target: function (triggerEl) { return triggerEl.nextElementSibling; },
17
+ });
18
+
19
+ }());
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-open-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.14
4
+ version: 2.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-14 00:00:00.000000000 Z
11
+ date: 2019-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 2.0.14
75
+ version: 2.0.15
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.14
82
+ version: 2.0.15
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -215,8 +215,10 @@ files:
215
215
  - assets/img/external-link.svg
216
216
  - assets/js/adoc-toc.js
217
217
  - assets/js/anchor-scroll.js
218
+ - assets/js/clipboard.min.js
218
219
  - assets/js/headroom.min.js
219
220
  - assets/js/opf.js
221
+ - assets/listing-widget.js
220
222
  homepage: https://github.com/riboseinc/jekyll-theme-open-project/
221
223
  licenses:
222
224
  - MIT