jekyll-theme-paperwiki 0.1.0

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.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +57 -0
  4. data/_config.yml +33 -0
  5. data/_includes/collections_sidebar.html +57 -0
  6. data/_includes/global_footer.html +4 -0
  7. data/_includes/global_head.html +27 -0
  8. data/_includes/global_header.html +25 -0
  9. data/_layouts/_dictionary.html +10 -0
  10. data/_layouts/collections.html +15 -0
  11. data/_layouts/default.html +21 -0
  12. data/_layouts/grammar.html +17 -0
  13. data/_layouts/page.html +9 -0
  14. data/_layouts/portal.html +41 -0
  15. data/_layouts/post.html +12 -0
  16. data/_layouts/reference_desk.html +50 -0
  17. data/_layouts/wiki.html +96 -0
  18. data/_layouts/work.html +17 -0
  19. data/_plugins/_gloss.rb +22 -0
  20. data/_plugins/_interlinear.rb +24 -0
  21. data/_plugins/ipa.rb +19 -0
  22. data/_plugins/lang.rb +27 -0
  23. data/_sass/partials/_base.scss +150 -0
  24. data/_sass/partials/_blog.scss +10 -0
  25. data/_sass/partials/_collections.scss +183 -0
  26. data/_sass/partials/_entries.scss +136 -0
  27. data/_sass/partials/_global.scss +111 -0
  28. data/_sass/partials/_glossing.scss +37 -0
  29. data/_sass/partials/_launchpad.scss +123 -0
  30. data/_sass/partials/_page.scss +13 -0
  31. data/_sass/partials/_search.scss +7 -0
  32. data/_sass/style.scss +14 -0
  33. data/_sass/variables/_colors.scss +49 -0
  34. data/_sass/variables/_fonts.scss +126 -0
  35. data/assets/css/style.scss +5 -0
  36. data/assets/fonts/.DS_Store +0 -0
  37. data/assets/fonts/Inter/.DS_Store +0 -0
  38. data/assets/fonts/Inter/Inter-Bold.otf +0 -0
  39. data/assets/fonts/Inter/Inter-Bold.woff +0 -0
  40. data/assets/fonts/Inter/Inter-Bold.woff2 +0 -0
  41. data/assets/fonts/Inter/Inter-Italic.otf +0 -0
  42. data/assets/fonts/Inter/Inter-Italic.woff +0 -0
  43. data/assets/fonts/Inter/Inter-Italic.woff2 +0 -0
  44. data/assets/fonts/Inter/Inter-Regular.otf +0 -0
  45. data/assets/fonts/Inter/Inter-Regular.woff +0 -0
  46. data/assets/fonts/Inter/Inter-Regular.woff2 +0 -0
  47. data/assets/fonts/Inter/LICENSE.txt +94 -0
  48. data/assets/fonts/LiberationMono/.DS_Store +0 -0
  49. data/assets/fonts/LiberationMono/LICENSE +102 -0
  50. data/assets/fonts/LiberationMono/LiberationMono-Bold.ttf +0 -0
  51. data/assets/fonts/LiberationMono/LiberationMono-Italic.ttf +0 -0
  52. data/assets/fonts/LiberationMono/LiberationMono-Regular.ttf +0 -0
  53. data/assets/fonts/LibertinusSerif/LibertinusSerif-Bold.otf +0 -0
  54. data/assets/fonts/LibertinusSerif/LibertinusSerif-Bold.woff2 +0 -0
  55. data/assets/fonts/LibertinusSerif/LibertinusSerif-BoldItalic.otf +0 -0
  56. data/assets/fonts/LibertinusSerif/LibertinusSerif-BoldItalic.woff2 +0 -0
  57. data/assets/fonts/LibertinusSerif/LibertinusSerif-Italic.otf +0 -0
  58. data/assets/fonts/LibertinusSerif/LibertinusSerif-Italic.woff2 +0 -0
  59. data/assets/fonts/LibertinusSerif/LibertinusSerif-Regular.otf +0 -0
  60. data/assets/fonts/LibertinusSerif/LibertinusSerif-Regular.woff2 +0 -0
  61. data/assets/fonts/LibertinusSerif/OFL.txt +93 -0
  62. data/assets/fonts/RemixIcon/.keep +0 -0
  63. data/assets/fonts/RemixIcon/.keep 3 +0 -0
  64. data/assets/fonts/RemixIcon/remixicon.css +2317 -0
  65. data/assets/fonts/RemixIcon/remixicon.eot +0 -0
  66. data/assets/fonts/RemixIcon/remixicon.glyph.json +1 -0
  67. data/assets/fonts/RemixIcon/remixicon.less +2319 -0
  68. data/assets/fonts/RemixIcon/remixicon.svg +6835 -0
  69. data/assets/fonts/RemixIcon/remixicon.symbol.svg +11356 -0
  70. data/assets/fonts/RemixIcon/remixicon.ttf +0 -0
  71. data/assets/fonts/RemixIcon/remixicon.woff +0 -0
  72. data/assets/fonts/RemixIcon/remixicon.woff2 +0 -0
  73. data/assets/images/favicon.png +0 -0
  74. data/assets/js/list.js +2020 -0
  75. data/assets/js/lunr.js +3475 -0
  76. data/assets/js/search.js +46 -0
  77. data/assets/js/toc.js +104 -0
  78. metadata +133 -0
@@ -0,0 +1,46 @@
1
+ // Yoinked in its entirety from https://davidwalsh.name/adding-search-to-your-site-with-javascript
2
+
3
+ var searchIndex = lunr(function() {
4
+ this.ref("id");
5
+ this.field("title", { boost: 10 });
6
+ this.field("content");
7
+ for (var key in window.pages) {
8
+ this.add({
9
+ "id": key,
10
+ "title": pages[key].title,
11
+ "content": pages[key].content
12
+ });
13
+ }
14
+ });
15
+
16
+
17
+
18
+ function getQueryVariable(variable) {
19
+ var query = window.location.search.substring(1);
20
+ var vars = query.split("&");
21
+ for (var i = 0; i < vars.length; i++) {
22
+ var pair = vars[i].split("=");
23
+ if (pair[0] === variable) {
24
+ return decodeURIComponent(pair[1].replace(/\+/g, "%20"));
25
+ }
26
+ }
27
+ }
28
+
29
+ var searchTerm = getQueryVariable("q");
30
+ // creation of searchIndex from earlier example
31
+ var results = searchIndex.search(searchTerm);
32
+ var resultPages = results.map(function (match) {
33
+ return pages[match.ref];
34
+ });
35
+
36
+
37
+
38
+
39
+ // resultPages from previous example
40
+ resultsString = "";
41
+ resultPages.forEach(function (r) {
42
+ resultsString += "<dt>";
43
+ resultsString += "<a class='result' href='" + r.url + "'>" + r.title + "</a></dt>";
44
+ resultsString += "<dd>" + r.content.substring(0, 200) + "..." + "</dd>";
45
+ });
46
+ document.querySelector("#search-results").innerHTML = resultsString;
data/assets/js/toc.js ADDED
@@ -0,0 +1,104 @@
1
+ /*
2
+ Demo for this article:
3
+ http://blustemy.io/creating-a-table-of-contents-in-javascript/
4
+ */
5
+
6
+ class TableOfContents {
7
+ /*
8
+ The parameters from and to must be Element objects in the DOM.
9
+ */
10
+ constructor({ from, to }) {
11
+ this.fromElement = from;
12
+ this.toElement = to;
13
+ // Get all the ordered headings.
14
+ this.headingElements = this.fromElement.querySelectorAll("h2, h3, h4, h5, h6");
15
+ this.tocElement = document.createElement("div");
16
+ }
17
+
18
+ /*
19
+ Get the most important heading level.
20
+ For example if the article has only <h2>, <h3> and <h4> tags
21
+ this method will return 2.
22
+ */
23
+ getMostImportantHeadingLevel() {
24
+ let mostImportantHeadingLevel = 6; // <h6> heading level
25
+ for (let i = 0; i < this.headingElements.length; i++) {
26
+ let headingLevel = TableOfContents.getHeadingLevel(this.headingElements[i]);
27
+ mostImportantHeadingLevel = (headingLevel < mostImportantHeadingLevel) ?
28
+ headingLevel : mostImportantHeadingLevel;
29
+ }
30
+ return mostImportantHeadingLevel;
31
+ }
32
+
33
+ /*
34
+ Generate a unique id string for the heading from its text content.
35
+ */
36
+ static generateId(headingElement) {
37
+ return headingElement.textContent.replace(/\s+/g, "_");
38
+ }
39
+
40
+ /*
41
+ Convert <h1> to 1 … <h6> to 6.
42
+ */
43
+ static getHeadingLevel(headingElement) {
44
+ switch (headingElement.tagName.toLowerCase()) {
45
+ case "h1": return 1;
46
+ case "h2": return 2;
47
+ case "h3": return 3;
48
+ case "h4": return 4;
49
+ case "h5": return 5;
50
+ case "h6": return 6;
51
+ default: return 1;
52
+ }
53
+ }
54
+
55
+ generateToc() {
56
+ let currentLevel = this.getMostImportantHeadingLevel() - 1,
57
+ currentElement = this.tocElement;
58
+
59
+ for (let i = 0; i < this.headingElements.length; i++) {
60
+ let headingElement = this.headingElements[i],
61
+ headingLevel = TableOfContents.getHeadingLevel(headingElement),
62
+ headingLevelDifference = headingLevel - currentLevel,
63
+ linkElement = document.createElement("a");
64
+
65
+ if (!headingElement.id) {
66
+ headingElement.id = TableOfContents.generateId(headingElement);
67
+ }
68
+ linkElement.href = `#${headingElement.id}`;
69
+ linkElement.textContent = headingElement.textContent;
70
+
71
+ if (headingLevelDifference > 0) {
72
+ // Go down the DOM by adding list elements.
73
+ for (let j = 0; j < headingLevelDifference; j++) {
74
+ let listElement = document.createElement("ol"),
75
+ listItemElement = document.createElement("li");
76
+ listElement.appendChild(listItemElement);
77
+ currentElement.appendChild(listElement);
78
+ currentElement = listItemElement;
79
+ }
80
+ currentElement.appendChild(linkElement);
81
+ } else {
82
+ // Go up the DOM.
83
+ for (let j = 0; j < -headingLevelDifference; j++) {
84
+ currentElement = currentElement.parentNode.parentNode;
85
+ }
86
+ let listItemElement = document.createElement("li");
87
+ listItemElement.appendChild(linkElement);
88
+ currentElement.parentNode.appendChild(listItemElement);
89
+ currentElement = listItemElement;
90
+ }
91
+
92
+ currentLevel = headingLevel;
93
+ }
94
+
95
+ this.toElement.appendChild(this.tocElement.firstChild);
96
+ }
97
+ }
98
+
99
+ document.addEventListener("DOMContentLoaded", () =>
100
+ new TableOfContents({
101
+ from: document.querySelector(".entry"),
102
+ to: document.querySelector(".entry-index")
103
+ }).generateToc()
104
+ );
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-theme-paperwiki
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - pomeloshark
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-12-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ description:
28
+ email:
29
+ - pomeloshark@proton.me
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - LICENSE.txt
35
+ - README.md
36
+ - _config.yml
37
+ - _includes/collections_sidebar.html
38
+ - _includes/global_footer.html
39
+ - _includes/global_head.html
40
+ - _includes/global_header.html
41
+ - _layouts/_dictionary.html
42
+ - _layouts/collections.html
43
+ - _layouts/default.html
44
+ - _layouts/grammar.html
45
+ - _layouts/page.html
46
+ - _layouts/portal.html
47
+ - _layouts/post.html
48
+ - _layouts/reference_desk.html
49
+ - _layouts/wiki.html
50
+ - _layouts/work.html
51
+ - _plugins/_gloss.rb
52
+ - _plugins/_interlinear.rb
53
+ - _plugins/ipa.rb
54
+ - _plugins/lang.rb
55
+ - _sass/partials/_base.scss
56
+ - _sass/partials/_blog.scss
57
+ - _sass/partials/_collections.scss
58
+ - _sass/partials/_entries.scss
59
+ - _sass/partials/_global.scss
60
+ - _sass/partials/_glossing.scss
61
+ - _sass/partials/_launchpad.scss
62
+ - _sass/partials/_page.scss
63
+ - _sass/partials/_search.scss
64
+ - _sass/style.scss
65
+ - _sass/variables/_colors.scss
66
+ - _sass/variables/_fonts.scss
67
+ - assets/css/style.scss
68
+ - assets/fonts/.DS_Store
69
+ - assets/fonts/Inter/.DS_Store
70
+ - assets/fonts/Inter/Inter-Bold.otf
71
+ - assets/fonts/Inter/Inter-Bold.woff
72
+ - assets/fonts/Inter/Inter-Bold.woff2
73
+ - assets/fonts/Inter/Inter-Italic.otf
74
+ - assets/fonts/Inter/Inter-Italic.woff
75
+ - assets/fonts/Inter/Inter-Italic.woff2
76
+ - assets/fonts/Inter/Inter-Regular.otf
77
+ - assets/fonts/Inter/Inter-Regular.woff
78
+ - assets/fonts/Inter/Inter-Regular.woff2
79
+ - assets/fonts/Inter/LICENSE.txt
80
+ - assets/fonts/LiberationMono/.DS_Store
81
+ - assets/fonts/LiberationMono/LICENSE
82
+ - assets/fonts/LiberationMono/LiberationMono-Bold.ttf
83
+ - assets/fonts/LiberationMono/LiberationMono-Italic.ttf
84
+ - assets/fonts/LiberationMono/LiberationMono-Regular.ttf
85
+ - assets/fonts/LibertinusSerif/LibertinusSerif-Bold.otf
86
+ - assets/fonts/LibertinusSerif/LibertinusSerif-Bold.woff2
87
+ - assets/fonts/LibertinusSerif/LibertinusSerif-BoldItalic.otf
88
+ - assets/fonts/LibertinusSerif/LibertinusSerif-BoldItalic.woff2
89
+ - assets/fonts/LibertinusSerif/LibertinusSerif-Italic.otf
90
+ - assets/fonts/LibertinusSerif/LibertinusSerif-Italic.woff2
91
+ - assets/fonts/LibertinusSerif/LibertinusSerif-Regular.otf
92
+ - assets/fonts/LibertinusSerif/LibertinusSerif-Regular.woff2
93
+ - assets/fonts/LibertinusSerif/OFL.txt
94
+ - assets/fonts/RemixIcon/.keep
95
+ - assets/fonts/RemixIcon/.keep 3
96
+ - assets/fonts/RemixIcon/remixicon.css
97
+ - assets/fonts/RemixIcon/remixicon.eot
98
+ - assets/fonts/RemixIcon/remixicon.glyph.json
99
+ - assets/fonts/RemixIcon/remixicon.less
100
+ - assets/fonts/RemixIcon/remixicon.svg
101
+ - assets/fonts/RemixIcon/remixicon.symbol.svg
102
+ - assets/fonts/RemixIcon/remixicon.ttf
103
+ - assets/fonts/RemixIcon/remixicon.woff
104
+ - assets/fonts/RemixIcon/remixicon.woff2
105
+ - assets/images/favicon.png
106
+ - assets/js/list.js
107
+ - assets/js/lunr.js
108
+ - assets/js/search.js
109
+ - assets/js/toc.js
110
+ homepage: https://github.com/pomeloshark/jekyll-theme-paperwiki
111
+ licenses:
112
+ - MIT
113
+ metadata: {}
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ requirements: []
129
+ rubygems_version: 3.1.2
130
+ signing_key:
131
+ specification_version: 4
132
+ summary: A theme meant for use as a personal wiki.
133
+ test_files: []