@honkit/honkit-plugin-theme 5.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 (49) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +37 -0
  3. package/_assets/ebook/ebook.css +1 -0
  4. package/_assets/ebook/epub.css +1 -0
  5. package/_assets/ebook/mobi.css +1 -0
  6. package/_assets/ebook/pdf.css +1 -0
  7. package/_assets/website/images/apple-touch-icon-precomposed-152.png +0 -0
  8. package/_assets/website/images/favicon.ico +0 -0
  9. package/_assets/website/style.css +7 -0
  10. package/_assets/website/theme.js +1 -0
  11. package/_i18n/ar.json +20 -0
  12. package/_i18n/bn.json +20 -0
  13. package/_i18n/ca.json +20 -0
  14. package/_i18n/cs.json +20 -0
  15. package/_i18n/de.json +20 -0
  16. package/_i18n/el.json +20 -0
  17. package/_i18n/en.json +22 -0
  18. package/_i18n/es.json +20 -0
  19. package/_i18n/fa.json +20 -0
  20. package/_i18n/fi.json +20 -0
  21. package/_i18n/fr.json +20 -0
  22. package/_i18n/he.json +20 -0
  23. package/_i18n/it.json +20 -0
  24. package/_i18n/ja.json +20 -0
  25. package/_i18n/ko.json +20 -0
  26. package/_i18n/nl.json +20 -0
  27. package/_i18n/no.json +20 -0
  28. package/_i18n/pl.json +20 -0
  29. package/_i18n/pt.json +20 -0
  30. package/_i18n/ro.json +20 -0
  31. package/_i18n/ru.json +20 -0
  32. package/_i18n/sv.json +20 -0
  33. package/_i18n/tr.json +20 -0
  34. package/_i18n/uk.json +20 -0
  35. package/_i18n/vi.json +20 -0
  36. package/_i18n/zh-hans.json +20 -0
  37. package/_i18n/zh-tw.json +20 -0
  38. package/_layouts/ebook/page.html +36 -0
  39. package/_layouts/ebook/pdf_footer.html +8 -0
  40. package/_layouts/ebook/pdf_header.html +7 -0
  41. package/_layouts/ebook/summary.html +58 -0
  42. package/_layouts/layout.html +26 -0
  43. package/_layouts/website/header.html +28 -0
  44. package/_layouts/website/languages.html +19 -0
  45. package/_layouts/website/layout.html +28 -0
  46. package/_layouts/website/page.html +96 -0
  47. package/_layouts/website/summary.html +61 -0
  48. package/index.js +8 -0
  49. package/package.json +94 -0
@@ -0,0 +1,96 @@
1
+ {% extends "./layout.html" %}
2
+
3
+ {% block title %}{{ page.title }} · {{ super() }}{% endblock %}
4
+
5
+ {% block description %}{{ page.description }}{% endblock %}
6
+
7
+ {% block head %}
8
+ {{ super() }}
9
+ {% if page.next and page.next.path %}
10
+ <link rel="next" href="{{ page.next.path|resolveFile }}" />
11
+ {% endif %}
12
+ {% if page.previous and page.previous.path %}
13
+ <link rel="prev" href="{{ page.previous.path|resolveFile }}" />
14
+ {% endif %}
15
+ {% endblock %}
16
+
17
+ {% block javascript %}
18
+ <script>
19
+ window.honkit = {};
20
+ window.honkit.metadata = {{ template.getJSContext()|dump|safe }};
21
+ </script>
22
+ <script src="{{ 'theme.js'|resolveAsset }}"></script>
23
+ {% for resource in plugins.resources.js %}
24
+ {% if resource.url %}
25
+ <script src="{{ resource.url }}"></script>
26
+ {% else %}
27
+ <script src="{{ resource.path|resolveAsset }}"></script>
28
+ {% endif %}
29
+ {% endfor %}
30
+ {% endblock %}
31
+
32
+ {% block body %}
33
+ <div class="book">
34
+ <div class="book-summary">
35
+ {% block book_sidebar %}
36
+ {% block search_input %}{% endblock %}
37
+ {% block book_summary %}
38
+ <nav role="navigation">
39
+ {% include "website/summary.html" %}
40
+ </nav>
41
+ {% endblock %}
42
+ {% endblock %}
43
+ </div>
44
+
45
+ <div class="book-body">
46
+ {% block book_body %}
47
+ <div class="body-inner">
48
+ {% block book_inner %}
49
+ {% include "website/header.html" %}
50
+
51
+ <div class="page-wrapper" tabindex="-1" role="main">
52
+ <div class="page-inner">
53
+ {% block search_results %}
54
+ <section class="normal markdown-section">
55
+ {% block page %}
56
+ {{ page.content|safe }}
57
+ {% endblock %}
58
+ </section>
59
+ {% block book_navigation %}
60
+ <div class="bottom-navigation">
61
+ {% if page.previous and page.previous.path %}
62
+ <a href="{{ page.previous.path|resolveFile }}{{ page.previous.anchor }}"
63
+ class="bottom-navigation---prev-link navigation navigation-prev {% if not (page.next and page.next.path) %}navigation-unique{% endif %}"
64
+ aria-label="Previous page: {{ page.previous.title }}">
65
+ <div>
66
+ <div class="bottom-navigation--prev-sublabel">Previous</div>
67
+ <div class="bottom-navigation--prev-label">
68
+ {{ page.previous.title }}
69
+ </div>
70
+ </div>
71
+ </a>
72
+ {% endif %}
73
+
74
+ {% if page.next and page.next.path %}
75
+ <a href="{{ page.next.path|resolveFile }}{{ page.next.anchor }}"
76
+ class="bottom-navigation---next-link navigation navigation-next {% if not (page.previous and page.previous.path) %}navigation-unique{% endif %}"
77
+ aria-label="Next page: {{ page.next.title }}">
78
+ <div>
79
+ <div class="bottom-navigation--next-sublabel">Next</div>
80
+ <div class="bottom-navigation--next-label">
81
+ {{ page.next.title }}
82
+ </div>
83
+ </div>
84
+ </a>
85
+ {% endif %}
86
+ </div>
87
+ {% endblock %}
88
+ {% endblock %}
89
+ </div>
90
+ </div>
91
+ {% endblock %}
92
+ </div>
93
+ {% endblock %}
94
+ </div>
95
+ </div>
96
+ {% endblock %}
@@ -0,0 +1,61 @@
1
+ {% macro articles(_articles) %}
2
+ {% for article in _articles %}
3
+ <li class="chapter {% if article.path == file.path and not article.anchor %}active{% endif %}" data-level="{{ article.level }}" {% if article.path %}data-path="{{ article.path|resolveFile }}"{% endif %}>
4
+ {% if article.path and getPageByPath(article.path) %}
5
+ <a href="{{ article.path|resolveFile }}{{ article.anchor }}">
6
+ {% elif article.url %}
7
+ <a href="{{ article.url }}" target="_blank" rel="noopener">
8
+ {% else %}
9
+ <span>
10
+ {% endif %}
11
+ {% if article.level != "0" and config.pluginsConfig['theme-default'].showLevel %}
12
+ <b>{{ article.level }}.</b>
13
+ {% endif %}
14
+ {{ article.title }}
15
+ {% if article.path or article.url %}
16
+ </a>
17
+ {% else %}
18
+ </span>
19
+ {% endif %}
20
+
21
+ {% if article.articles.length > 0 %}
22
+ <ul class="articles">
23
+ {{ articles(article.articles, file, config) }}
24
+ </ul>
25
+ {% endif %}
26
+ </li>
27
+ {% endfor %}
28
+ {% endmacro %}
29
+
30
+ <ul class="summary">
31
+ {% set _divider = false %}
32
+ {% if config.links.sidebar %}
33
+ {% for linkTitle, link in config.links.sidebar %}
34
+ {% set _divider = true %}
35
+ <li>
36
+ <a href="{{ link }}" target="_blank" rel="noopener" class="custom-link">{{ linkTitle }}</a>
37
+ </li>
38
+ {% endfor %}
39
+ {% endif %}
40
+
41
+ {% if _divider %}
42
+ <li class="divider"></li>
43
+ {% endif %}
44
+
45
+ {% for part in summary.parts %}
46
+ {% if part.title %}
47
+ <li class="header">{{ part.title }}</li>
48
+ {% elif not loop.first %}
49
+ <li class="divider"></li>
50
+ {% endif %}
51
+ {{ articles(part.articles, file, config) }}
52
+ {% endfor %}
53
+
54
+ <li class="divider"></li>
55
+
56
+ <li>
57
+ <a href="https://github.com/honkit/honkit" target="_blank" rel="noopener" class="gitbook-link">
58
+ {{ "GITBOOK_LINK"|t }}
59
+ </a>
60
+ </li>
61
+ </ul>
package/index.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ hooks: {
3
+ config: function (config) {
4
+ config.styles = config.styles || config.pluginsConfig["@honkit/honkit-plugin-theme"].styles;
5
+ return config;
6
+ }
7
+ }
8
+ };
package/package.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "@honkit/honkit-plugin-theme",
3
+ "version": "5.1.0",
4
+ "description": "Default theme for HonKit",
5
+ "bugs": {
6
+ "url": "https://github.com/honkit/honkit/issues"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/honkit/honkit.git"
11
+ },
12
+ "license": "Apache-2.0",
13
+ "author": "azu <azuciao@gmail.com>",
14
+ "main": "./index.js",
15
+ "files": [
16
+ "index.js",
17
+ "_assets",
18
+ "_i18n",
19
+ "_layouts",
20
+ "!__tests__"
21
+ ],
22
+ "scripts": {
23
+ "prebuild": "npm run clean",
24
+ "build": "npm-run-all build:js build:css cp",
25
+ "build:css": "npm-run-all -p build:css:*",
26
+ "build:css:ebook": "lessc -clean-css src/less/ebook.less _assets/ebook/ebook.css",
27
+ "build:css:epub": "lessc -clean-css src/less/epub.less _assets/ebook/epub.css",
28
+ "build:css:mobi": "lessc -clean-css src/less/mobi.less _assets/ebook/mobi.css",
29
+ "build:css:pdf": "lessc -clean-css src/less/pdf.less _assets/ebook/pdf.css",
30
+ "build:css:website": "lessc -clean-css src/less/website.less _assets/website/style.css",
31
+ "build:js": "esbuild src/js/theme/index.js --bundle --minify --outfile=_assets/website/theme.js",
32
+ "clean": "rimraf _assets && mkdirp _assets/ebook/ _assets/website/ _assets/website/fonts _assets/website/images",
33
+ "cp": "npm-run-all -p cp:*",
34
+ "cp:favicon": "cpy --flat logo/favicon.ico _assets/website/images/",
35
+ "cp:logo": "cpy --flat logo/apple-touch-icon.png _assets/website/images/ --rename=apple-touch-icon-precomposed-152.png",
36
+ "prepublish": "npm run build"
37
+ },
38
+ "devDependencies": {
39
+ "cpy-cli": "^4.2.0",
40
+ "esbuild": "^0.18.13",
41
+ "gitbook-markdown-css": "^1.1.0",
42
+ "less": "2.7.1",
43
+ "less-plugin-clean-css": "1.5.1",
44
+ "mkdirp": "^1.0.4",
45
+ "npm-run-all": "^4.1.5",
46
+ "rimraf": "^3.0.2"
47
+ },
48
+ "engines": {
49
+ "gitbook": ">=3.0.0"
50
+ },
51
+ "publishConfig": {
52
+ "access": "public"
53
+ },
54
+ "gitbook": {
55
+ "properties": {
56
+ "styles": {
57
+ "type": "object",
58
+ "title": "Custom Stylesheets",
59
+ "properties": {
60
+ "website": {
61
+ "title": "Stylesheet for website output",
62
+ "default": "styles/website.css"
63
+ },
64
+ "pdf": {
65
+ "title": "Stylesheet for PDF output",
66
+ "default": "styles/pdf.css"
67
+ },
68
+ "epub": {
69
+ "title": "Stylesheet for ePub output",
70
+ "default": "styles/epub.css"
71
+ },
72
+ "mobi": {
73
+ "title": "Stylesheet for Mobi output",
74
+ "default": "styles/mobi.css"
75
+ },
76
+ "ebook": {
77
+ "title": "Stylesheet for ebook outputs (PDF, ePub, Mobi)",
78
+ "default": "styles/ebook.css"
79
+ },
80
+ "print": {
81
+ "title": "Stylesheet to replace default ebook css",
82
+ "default": "styles/print.css"
83
+ }
84
+ }
85
+ },
86
+ "showLevel": {
87
+ "type": "boolean",
88
+ "title": "Show level indicator in TOC",
89
+ "default": false
90
+ }
91
+ }
92
+ },
93
+ "gitHead": "6acb1146ae4c21d64283f88f06f26427a35f349b"
94
+ }