docula 0.0.5
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.
- package/LICENSE +21 -0
- package/README.md +52 -0
- package/bin/docula.js +7 -0
- package/init/_data/site.json +4 -0
- package/init/_includes/assets/css/highlight/highlight.min.js +1433 -0
- package/init/_includes/assets/css/highlight/styles/base16/dracula.min.css +7 -0
- package/init/_includes/assets/css/styles/home.css +256 -0
- package/init/_includes/assets/css/styles/index.css +971 -0
- package/init/_includes/assets/css/styles/variables.css +30 -0
- package/init/_includes/assets/images/docula.png +0 -0
- package/init/_includes/assets/images/logo.svg +10 -0
- package/init/_includes/doc.njk +17 -0
- package/init/_includes/search/pagefind.njk +66 -0
- package/init/_includes/shared/head.njk +13 -0
- package/init/_includes/shared/header.njk +23 -0
- package/init/_includes/shared/homeHeader.njk +20 -0
- package/init/_includes/shared/main.njk +47 -0
- package/init/_includes/shared/scripts.njk +52 -0
- package/init/_includes/shared/searchModal.njk +10 -0
- package/init/_includes/shared/sidebar.njk +50 -0
- package/init/api/Readme.md +3 -0
- package/init/docs/Readme.md +83 -0
- package/init/docs/docs.json +13 -0
- package/init/index.njk +72 -0
- package/init/versions.njk +33 -0
- package/package.json +109 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--font-family: 'Open Sans', sans-serif;
|
|
3
|
+
|
|
4
|
+
--color-primary: #08c2ff;
|
|
5
|
+
--color-secondary: #bd72d1;
|
|
6
|
+
--color-secondary-dark: #af34d0;
|
|
7
|
+
--color-text: #322d3c;
|
|
8
|
+
|
|
9
|
+
--background: #ffffff;
|
|
10
|
+
--home-background: #F0F2FA;
|
|
11
|
+
--header-background: #fbfbfb;
|
|
12
|
+
|
|
13
|
+
--sidebar-background: #ffffff;
|
|
14
|
+
--sidebar-text: #322d3c;
|
|
15
|
+
--sidebar-text-active: #08c2ff;
|
|
16
|
+
|
|
17
|
+
--border: rgba(238,238,245,1);
|
|
18
|
+
|
|
19
|
+
--background-search-highlight: var(--color-secondary-dark);
|
|
20
|
+
--color-search-highlight: #ffffff;
|
|
21
|
+
--search-input-background: var(--header-background);
|
|
22
|
+
|
|
23
|
+
--code: rgba(238,238,245,1);
|
|
24
|
+
|
|
25
|
+
--pagefind-ui-text: var(--color-text) !important;
|
|
26
|
+
--pagefind-ui-font: var(--font-family) !important;
|
|
27
|
+
--pagefind-ui-background: var(--background) !important;
|
|
28
|
+
--pagefind-ui-border: var(--border) !important;
|
|
29
|
+
--pagefind-ui-scale: .9 !important;
|
|
30
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg width="512" height="512" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient x1="30%" y1="20%" x2="65%" y2="50%" id="gradient">
|
|
5
|
+
<stop stop-color="#24C6DC" offset="0%"></stop>
|
|
6
|
+
<stop stop-color="#C86DD7" offset="100%"></stop>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
<path fill="url(#gradient)" fill-rule="nonzero" d="M189 196v-17.4c13.7 10.2 40.2 15 66.5 15 26.3 0 52.8-4.8 66.5-15V196c0 12-30 21.8-66.5 21.8-36.6 0-66.5-9.8-66.5-21.8zm133 16.6v19.8c-3.7 11-32.3 19.4-66.5 19.4s-62.8-8.5-66.5-19.4v-20c13.7 10.4 40.2 15 66.5 15 26.3 0 52.8-4.6 66.5-14.8zM189 162v-17.4c13.7 10.2 40.2 15 66.5 15 26.3 0 52.8-4.8 66.5-15V162c0 12-30 22-66.5 22-36.6 0-66.5-10-66.5-22zm66.5-12c-36.7 0-66.5-10-66.5-22s29.8-21.8 66.5-21.8S322 116 322 128s-29.8 22-66.5 22zm.5 362C114.6 512 0 397.4 0 256S114.6 0 256 0s256 114.6 256 256-114.6 256-256 256zm0-3c139.7 0 253-113.3 253-253S395.6 3 256 3 3 116.4 3 256s113.3 253 253 253zM122 351.2l56-51h5l-56.5 51 59.3 60h-5l-58.7-59.7v59.8h-3.5v-111h3.4v51zm77 23.3c0 4.4.7 8.7 2 13 1.3 4.3 3.3 8 6 11.5 2.6 3.5 6 6.3 10 8.4 4 2 9 3 14.5 3 5.7 0 10.7-1 15-3.3 4.5-2 8.3-5.4 11.5-9.7l2.5 2.2c-3.5 4.6-7.7 8-12.4 10.5-4.7 2.4-10.2 3.6-16.5 3.6-5.3 0-10.2-1-14.6-3-4.5-1.8-8.3-4.5-11.5-8-3.2-3.4-5.6-7.5-7.4-12.3-1.6-5-2.5-10-2.5-15.7 0-5.5 1-10.5 2.7-15 1.8-4.7 4.2-8.7 7.3-12 3-3.4 6.7-6 11-7.8 4-2 8.6-2.8 13.4-2.8 5.6 0 10.5 1 14.7 3 4.2 2 7.7 4.6 10.4 8 3 3 5 6.8 6.3 11 1.4 4 2 8.3 2 12.6v3H199zm61-3c0-4.7-.8-9-2.4-13-1.5-3.8-3.5-7-6.2-10-2.6-2.6-5.7-4.8-9.4-6.3-3.6-1.5-7.7-2.3-12.2-2.3-5.5 0-10 1-14 3.4-4 2.2-7 5-9.5 8.3-2.5 3.3-4.3 6.8-5.4 10.4-1.3 3.7-1.8 7-1.8 9.6h61zm40.7 63.7c-1.6 4.5-4 8-6.6 10.5-2.7 2.4-6.3 3.6-10.7 3.6-1 0-2 0-3.3-.3-1.2 0-2.3-.3-3-.7l.8-3c.6.3 1.5.5 2.6.7 1 .2 2.2.3 3.2.3 2.2 0 4-.4 5.8-1.3 1.6-.8 3-2 4-3.2 1.3-1.3 2.2-2.8 3-4.4.8-1.7 1.5-3.4 2-5l7-19-28.5-74.2h3.6l26.6 70.4 25.6-70.4h3.7l-35.8 96zm76.3-24h-4.5l-28.4-72h3.8l27 68.7h.2l26-68.8h3.7L377 411.4z"></path>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
{% include "shared/head.njk" %}
|
|
4
|
+
<body>
|
|
5
|
+
<div class="layout">
|
|
6
|
+
{% include "shared/header.njk" %}
|
|
7
|
+
{% include "shared/sidebar.njk" %}
|
|
8
|
+
{% include "shared/main.njk" %}
|
|
9
|
+
{% include "shared/searchModal.njk" %}
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
{% include "search/pagefind.njk" %}
|
|
13
|
+
{% include "shared/scripts.njk" %}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<link href="/_pagefind/pagefind-ui.css" rel="stylesheet">
|
|
2
|
+
<script src="/_pagefind/pagefind-ui.js" type="text/javascript"></script>
|
|
3
|
+
<script>
|
|
4
|
+
window.addEventListener('DOMContentLoaded', (event) => {
|
|
5
|
+
new PagefindUI({
|
|
6
|
+
element: "#search",
|
|
7
|
+
showImages: false,
|
|
8
|
+
debounceTimeoutMs: 500
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<!--pagefind UI-->
|
|
14
|
+
<script>
|
|
15
|
+
const searchModal = document.querySelector('#search-modal');
|
|
16
|
+
const searchModalContainer = document.querySelector('#search-container');
|
|
17
|
+
const closeModalBtn = document.querySelector('#close-modal-btn');
|
|
18
|
+
const searchBtn = document.querySelector('#search-btn');
|
|
19
|
+
|
|
20
|
+
const closeEmptyModal = (e) => {
|
|
21
|
+
const pagefindInput = document.querySelector('.pagefind-ui__search-input');
|
|
22
|
+
if(pagefindInput) {
|
|
23
|
+
if(!pagefindInput.value ) {
|
|
24
|
+
if (pagefindInput === e.target || pagefindInput.contains(e.target)) return;
|
|
25
|
+
searchModal.classList.remove('show-modal');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const closeDesktopModal = (e) => {
|
|
31
|
+
const pagefindInput = document.querySelector('.pagefind-ui__search-input');
|
|
32
|
+
if(isDesktop && pagefindInput) {
|
|
33
|
+
if(pagefindInput.value ) {
|
|
34
|
+
if (searchModalContainer === e.target || searchModalContainer.contains(e.target)) return;
|
|
35
|
+
searchModal.classList.remove('show-modal');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
searchModal.addEventListener('click', (e) => {
|
|
41
|
+
closeEmptyModal(e);
|
|
42
|
+
closeDesktopModal(e)
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const autofocusInput = () => {
|
|
46
|
+
const pagefindInput = document.querySelector('.pagefind-ui__search-input');
|
|
47
|
+
if (pagefindInput) {
|
|
48
|
+
pagefindInput.focus();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleSearchModal = () => {
|
|
53
|
+
searchModal.classList.add('show-modal');
|
|
54
|
+
autofocusInput()
|
|
55
|
+
};
|
|
56
|
+
searchBtn.addEventListener('click', handleSearchModal);
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
if(closeModalBtn) {
|
|
60
|
+
closeModalBtn.addEventListener('click', () => {
|
|
61
|
+
searchModal.classList.remove('show-modal');
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<head>
|
|
2
|
+
<meta charset="UTF-8">
|
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
4
|
+
<link rel="stylesheet" href="/assets/css/styles/variables.css">
|
|
5
|
+
<link rel="stylesheet" href="/assets/css/styles/index.css">
|
|
6
|
+
<link rel="stylesheet" href="/assets/css/styles/home.css">
|
|
7
|
+
<title>{{ site.name }}</title>
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet">
|
|
11
|
+
<link rel="stylesheet" href="/assets/css/highlight/styles/base16/dracula.min.css">
|
|
12
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.css@7.4.5/themes/satellite-min.css" integrity="sha256-TehzF/2QvNKhGQrrNpoOb2Ck4iGZ1J/DI4pkd2oUsBc=" crossorigin="anonymous">
|
|
13
|
+
</head>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<header class="header" id="header">
|
|
2
|
+
<div class="header-content">
|
|
3
|
+
<nav class="nav">
|
|
4
|
+
<div class="header-menu hide-d">
|
|
5
|
+
<a class="header-logo" href="/">
|
|
6
|
+
<img src="/../assets/images/logo.svg" alt="logo" />
|
|
7
|
+
</a>
|
|
8
|
+
<button id="open-sidebar" class="icon menu-btn">
|
|
9
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>
|
|
10
|
+
<span>Menu</span>
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<div class="header-search">
|
|
16
|
+
<button aria-label="Open search" class="icon search-btn" id="search-btn">
|
|
17
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352c79.5 0 144-64.5 144-144s-64.5-144-144-144S64 128.5 64 208s64.5 144 144 144z"/></svg>
|
|
18
|
+
<span class="hidden search-text">Search the documentation</span>
|
|
19
|
+
</button>
|
|
20
|
+
</div>
|
|
21
|
+
</nav>
|
|
22
|
+
</div>
|
|
23
|
+
</header>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<header class="home-header">
|
|
2
|
+
<div class="header-content">
|
|
3
|
+
<nav class="nav">
|
|
4
|
+
<div class="header-menu">
|
|
5
|
+
<a class="header-logo" href="/">
|
|
6
|
+
<img src="/../assets/images/logo.svg" alt="logo" />
|
|
7
|
+
</a>
|
|
8
|
+
<a href="/docs" class="docs-link">Docs</a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<div class="header-search">
|
|
13
|
+
<button class="icon search-btn" id="search-btn">
|
|
14
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352c79.5 0 144-64.5 144-144s-64.5-144-144-144S64 128.5 64 208s64.5 144 144 144z"/></svg>
|
|
15
|
+
<span class="hidden search-text">Search the documentation</span>
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
</nav>
|
|
19
|
+
</div>
|
|
20
|
+
</header>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<div class="main-container">
|
|
2
|
+
<div class="main-content">
|
|
3
|
+
<article class="content">
|
|
4
|
+
<div class="items-start">
|
|
5
|
+
{% set navPages = collections.all | eleventyNavigationBreadcrumb(eleventyNavigation.key, { includeSelf: true }) %}
|
|
6
|
+
<div class="breadcrumb">
|
|
7
|
+
{% if navPages[0].url %}
|
|
8
|
+
<a href="{{navPages[0].url}}">{{ navPages[0].title }}</a>
|
|
9
|
+
{% else %}
|
|
10
|
+
<span>{{ navPages[0].title }}</span>
|
|
11
|
+
{% endif %}
|
|
12
|
+
{% if navPages[1] %}
|
|
13
|
+
<span>/ {{ navPages[1].title }}</span>
|
|
14
|
+
{% endif %}
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
{% if date %}
|
|
18
|
+
<div class="date hidden">
|
|
19
|
+
<span>{% formatDate "MMM dd, yyyy", date %}</span>
|
|
20
|
+
</div>
|
|
21
|
+
{% endif %}
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
<h1>{{title}}</h1>
|
|
25
|
+
|
|
26
|
+
<!-- on this page start -->
|
|
27
|
+
<div class="on-page-container on-page-main">
|
|
28
|
+
<h5>On this page</h5>
|
|
29
|
+
{{ content | toc | safe }}
|
|
30
|
+
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<!-- on this page end -->
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
{{ content | safe }}
|
|
37
|
+
|
|
38
|
+
</article>
|
|
39
|
+
|
|
40
|
+
<div class="on-page-container on-page--desktop hidden" id="on-page">
|
|
41
|
+
<div class="on-page-fixed">
|
|
42
|
+
<h5>On this page</h5>
|
|
43
|
+
{{ content | toc | safe }}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script defer>
|
|
2
|
+
const sidebar = document.querySelector('#sidebar');
|
|
3
|
+
const header = document.querySelector('#header');
|
|
4
|
+
const path = window.location.pathname;
|
|
5
|
+
const isHome = path === '/' || path === '/index.html';
|
|
6
|
+
const isDesktop = window.innerWidth >= 992;
|
|
7
|
+
|
|
8
|
+
const handleScroll = () => {
|
|
9
|
+
const onPage = document.querySelector('#on-page');
|
|
10
|
+
if(!isHome) {
|
|
11
|
+
if (window.scrollY > 0 && window.innerWidth >= 1458) {
|
|
12
|
+
onPage.classList.remove('hidden');
|
|
13
|
+
} else {
|
|
14
|
+
onPage.classList.add('hidden');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
window.addEventListener('scroll', handleScroll);
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const closeSidebar = () => {
|
|
22
|
+
const closeBtn = document.querySelector('#close-sidebar');
|
|
23
|
+
closeBtn.addEventListener('click', () => {
|
|
24
|
+
sidebar.classList.add('hidden');
|
|
25
|
+
header.classList.remove('bottom');
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const openSidebar = () => {
|
|
30
|
+
const openBtn = document.querySelector('#open-sidebar');
|
|
31
|
+
openBtn.addEventListener('click', () => {
|
|
32
|
+
sidebar.classList.remove('hidden');
|
|
33
|
+
header.classList.add('bottom');
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const handleMobileSidebar = () => {
|
|
38
|
+
if (!isHome && !isDesktop) {
|
|
39
|
+
openSidebar()
|
|
40
|
+
closeSidebar();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
document.addEventListener('DOMContentLoaded', handleMobileSidebar, false)
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
<script src="/assets/css/highlight/highlight.min.js"></script>
|
|
48
|
+
<script>
|
|
49
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
50
|
+
hljs.highlightAll()
|
|
51
|
+
});
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div class="search-modal" id="search-modal">
|
|
2
|
+
<div class="search-container" id="search-container">
|
|
3
|
+
<div id="search" class="search-box">
|
|
4
|
+
<span class="close-modal-btn hide-d" id="close-modal-btn">
|
|
5
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"/>
|
|
6
|
+
</svg>
|
|
7
|
+
</span>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<aside class="sidebar hidden" id="sidebar" data-pagefind-ignore>
|
|
2
|
+
<div class="sidebar-logo">
|
|
3
|
+
<a class="header-link" href="/">
|
|
4
|
+
<img src="/../assets/images/logo.svg" alt="logo" />
|
|
5
|
+
</a>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<section class="sidebar-container">
|
|
9
|
+
<button class="close-btn icon" id="close-sidebar">
|
|
10
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"/></svg>
|
|
11
|
+
<span>Close</span>
|
|
12
|
+
</button>
|
|
13
|
+
<div class="sidebar-content">
|
|
14
|
+
{% set navPages = collections.all | eleventyNavigation %}
|
|
15
|
+
|
|
16
|
+
{% macro renderNavListItem(entry) -%}
|
|
17
|
+
{% if entry.children.length %}
|
|
18
|
+
<li>
|
|
19
|
+
<details
|
|
20
|
+
{%- for child in entry.children %}
|
|
21
|
+
{% if child.parent == entry.title and child.url == page.url %}
|
|
22
|
+
class="active"
|
|
23
|
+
open
|
|
24
|
+
{% endif %}
|
|
25
|
+
{% endfor %}
|
|
26
|
+
>
|
|
27
|
+
<summary>{{ entry.title }}</summary>
|
|
28
|
+
<ul class="child-list" role="list">
|
|
29
|
+
{%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}
|
|
30
|
+
</ul>
|
|
31
|
+
</details>
|
|
32
|
+
</li>
|
|
33
|
+
{% else %}
|
|
34
|
+
<li>
|
|
35
|
+
<a href="{{ entry.url }}"{% if entry.url == page.url %} class="active" {% endif %}>{{ entry.title }}</a>
|
|
36
|
+
</li>
|
|
37
|
+
{%- endif -%}
|
|
38
|
+
{%- endmacro %}
|
|
39
|
+
|
|
40
|
+
<ul class="nav-list" role="list">
|
|
41
|
+
{%- for entry in navPages %}{{ renderNavListItem(entry) }}{%- endfor -%}
|
|
42
|
+
</ul>
|
|
43
|
+
|
|
44
|
+
</div>
|
|
45
|
+
</section>
|
|
46
|
+
<footer class="sidebar-footer">
|
|
47
|
+
{{ site.footer }} {{ site.authorName }} {% year %}
|
|
48
|
+
</footer>
|
|
49
|
+
|
|
50
|
+
</aside>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Docs
|
|
2
|
+
To create a `/docs` route for your documentation page, you will need to specify the document that will handle this route by adding the following at the top of your chosen file:
|
|
3
|
+
```
|
|
4
|
+
---
|
|
5
|
+
permalink: /docs/
|
|
6
|
+
---
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
The following properties can also be included to customize your documentation page:
|
|
11
|
+
|
|
12
|
+
* `title`: The title of the page, which will be used to refer to the child-parent relationship in the sidebar (string).
|
|
13
|
+
* `order`: The order of the page in the sidebar (number) [optional].
|
|
14
|
+
* `parent`: The parent of the page in the sidebar (string) [optional].
|
|
15
|
+
* `sidebarTitle`: The title of the page in the sidebar. If not provided, the title will be used (string) [optional].
|
|
16
|
+
|
|
17
|
+
## Tree of Pages in the Sidebar
|
|
18
|
+
To create a sidebar with the following structure:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Getting Started
|
|
22
|
+
Animals
|
|
23
|
+
- Dogs
|
|
24
|
+
- Cats
|
|
25
|
+
Plants
|
|
26
|
+
```
|
|
27
|
+
You will need to have the following file structure:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
docs
|
|
31
|
+
├── getting-started.md
|
|
32
|
+
├── animals
|
|
33
|
+
│ ├── animals.md
|
|
34
|
+
│ ├── dogs.md
|
|
35
|
+
│ └── cats.md
|
|
36
|
+
└── plants.md
|
|
37
|
+
```
|
|
38
|
+
Add the following to the top of each file:
|
|
39
|
+
|
|
40
|
+
__getting-started.md__
|
|
41
|
+
```
|
|
42
|
+
---
|
|
43
|
+
title: Getting Started
|
|
44
|
+
order: 0
|
|
45
|
+
---
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
__animals.md__
|
|
49
|
+
```
|
|
50
|
+
---
|
|
51
|
+
title: Animals
|
|
52
|
+
permalink: false
|
|
53
|
+
---
|
|
54
|
+
```
|
|
55
|
+
Note: For a parent page you have 2 options you can either have a page that has content or don't have a page for the parent.
|
|
56
|
+
if you would like not to generate a page for the parent you could add the following to the top of the file: `permalink: false`
|
|
57
|
+
|
|
58
|
+
__dogs.md__
|
|
59
|
+
```
|
|
60
|
+
---
|
|
61
|
+
title: Canis lupus familiaris
|
|
62
|
+
sidebarTitle: Dogs
|
|
63
|
+
parent: Animals
|
|
64
|
+
---
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
__cats.md__
|
|
68
|
+
```
|
|
69
|
+
---
|
|
70
|
+
title: Felis catus
|
|
71
|
+
sidebarTitle: Cats
|
|
72
|
+
parent: Animals
|
|
73
|
+
---
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
__plants.md__
|
|
77
|
+
```
|
|
78
|
+
---
|
|
79
|
+
title: Plants
|
|
80
|
+
---
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This file structure, along with the specified properties, will create a sidebar navigation that matches the example provided above.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"layout": "doc.njk",
|
|
3
|
+
"tags": "docs",
|
|
4
|
+
"permalink": "/docs/{{ page.fileSlug | slugify }}/",
|
|
5
|
+
"eleventyComputed": {
|
|
6
|
+
"eleventyNavigation": {
|
|
7
|
+
"key": "{{ title }}",
|
|
8
|
+
"title": "{{ sidebarTitle }}",
|
|
9
|
+
"parent": "{{ parent }}",
|
|
10
|
+
"order": "{{ order }}"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
package/init/index.njk
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
{% include "shared/head.njk" %}
|
|
4
|
+
|
|
5
|
+
<body>
|
|
6
|
+
{% include "shared/homeHeader.njk" %}
|
|
7
|
+
|
|
8
|
+
<main class="home">
|
|
9
|
+
<div class="home-hero">
|
|
10
|
+
<img src="/../assets/images/logo.svg" alt="logo" />
|
|
11
|
+
<div class="home-container">
|
|
12
|
+
<h1>{{ site.homeTitle }}</h1>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<section class="home-container">
|
|
16
|
+
{% if github %}
|
|
17
|
+
{% if github.contributors %}
|
|
18
|
+
<div class="content-container">
|
|
19
|
+
<h2 class="home-title">Contributors</h2>
|
|
20
|
+
<div class="facepile-container">
|
|
21
|
+
<div class="facepile">
|
|
22
|
+
{% for contributor in github.contributors %}
|
|
23
|
+
<a href="{{ contributor.html_url }}" target="_blank" title="{{ contributor.login }}" rel="noopener noreferrer">
|
|
24
|
+
<img src="{{ contributor.avatar_url }}" alt="{{ contributor.login }}" />
|
|
25
|
+
</a>
|
|
26
|
+
{% endfor %}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
{% endif %}
|
|
31
|
+
|
|
32
|
+
{% if github.releases %}
|
|
33
|
+
<div class="content-container">
|
|
34
|
+
<h2 class="home-title">Latest's Releases</h2>
|
|
35
|
+
{% set releasesLength = github.releases | length %}
|
|
36
|
+
{% for release in github.releases %}
|
|
37
|
+
{% if loop.index <= 3 %}
|
|
38
|
+
<div class="release">
|
|
39
|
+
<div class="release-header">
|
|
40
|
+
<a class="release-title" href="{{ release.html_url }}" target="_blank" rel="noopener noreferrer">{{ release.name }}</a>
|
|
41
|
+
<span class="release-date">{% formatDate "MMM dd, yyyy", release.published_at %}</span>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="release-body">
|
|
44
|
+
{% if release.body %}
|
|
45
|
+
<p>{% parseRelease release.body %}</p>
|
|
46
|
+
{% endif %}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
{% endif %}
|
|
50
|
+
{% endfor %}
|
|
51
|
+
|
|
52
|
+
{% if releasesLength > 5 %}
|
|
53
|
+
<a class="release-btn" href="/versions">
|
|
54
|
+
All Releases
|
|
55
|
+
<span>→</span>
|
|
56
|
+
</a>
|
|
57
|
+
{% endif %}
|
|
58
|
+
</div>
|
|
59
|
+
{% endif %}
|
|
60
|
+
|
|
61
|
+
{% endif %}
|
|
62
|
+
|
|
63
|
+
</section>
|
|
64
|
+
|
|
65
|
+
</main>
|
|
66
|
+
|
|
67
|
+
{% include "shared/searchModal.njk" %}
|
|
68
|
+
{% include "shared/scripts.njk" %}
|
|
69
|
+
{% include "search/pagefind.njk" %}
|
|
70
|
+
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
{% include "shared/head.njk" %}
|
|
4
|
+
|
|
5
|
+
<body>
|
|
6
|
+
{% include "shared/homeHeader.njk" %}
|
|
7
|
+
|
|
8
|
+
<main class="home-container">
|
|
9
|
+
<div class="content-container versions-container">
|
|
10
|
+
<h2 class="home-title">Releases</h2>
|
|
11
|
+
{% for release in github.releases %}
|
|
12
|
+
<div class="release">
|
|
13
|
+
<div class="release-header">
|
|
14
|
+
<a class="release-title" href="{{ release.html_url }}" target="_blank" rel="noopener noreferrer">{{ release.name }}</a>
|
|
15
|
+
<span class="release-date">{% formatDate "MMM dd, yyyy", release.published_at %}</span>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="release-body">
|
|
18
|
+
{% if release.body %}
|
|
19
|
+
<p>{% parseRelease release.body %}</p>
|
|
20
|
+
{% endif %}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
{% endfor %}
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
</main>
|
|
27
|
+
|
|
28
|
+
{% include "shared/searchModal.njk" %}
|
|
29
|
+
{% include "shared/scripts.njk" %}
|
|
30
|
+
{% include "search/pagefind.njk" %}
|
|
31
|
+
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docula",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "Open Source Static Site Generator",
|
|
5
|
+
"exports": "./dist/docula.js",
|
|
6
|
+
"types": "./dist/docula.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=14.16"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc -p .",
|
|
13
|
+
"clean": "rm -rf dist && rm -rf test/data/site && rm -rf node_modules",
|
|
14
|
+
"test": "xo --fix && jest --coverage",
|
|
15
|
+
"test:code": "yarn build && node ./bin/docula.js",
|
|
16
|
+
"lint": "xo --fix"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/jaredwray/docula.git"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"docula": "./bin/docula.js"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"open",
|
|
27
|
+
"source",
|
|
28
|
+
"static",
|
|
29
|
+
"site",
|
|
30
|
+
"github",
|
|
31
|
+
"zendesk",
|
|
32
|
+
"intercom",
|
|
33
|
+
"swagger",
|
|
34
|
+
"stripe"
|
|
35
|
+
],
|
|
36
|
+
"author": "Jared Wray (me@jaredwray.com)",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/jaredwray/docula/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/jaredwray/docula#readme",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@11ty/eleventy": "^1.0.2",
|
|
44
|
+
"@11ty/eleventy-navigation": "^0.3.5",
|
|
45
|
+
"@types/fs-extra": "^11.0.1",
|
|
46
|
+
"@types/inquirer": "^9.0.3",
|
|
47
|
+
"@types/jest": "^29.4.0",
|
|
48
|
+
"@types/luxon": "^3.2.0",
|
|
49
|
+
"@types/markdown-it": "^12.2.3",
|
|
50
|
+
"jest": "^29.4.1",
|
|
51
|
+
"jest-ts-webcompat-resolver": "^1.0.0",
|
|
52
|
+
"ts-jest": "^29.0.5",
|
|
53
|
+
"ts-jest-resolver": "^2.0.0",
|
|
54
|
+
"typescript": "^4.9.5",
|
|
55
|
+
"xo": "^0.53.1"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@11ty/eleventy": "^1.0.2",
|
|
59
|
+
"ajv": "^6.12.6",
|
|
60
|
+
"algoliasearch": "^4.14.3",
|
|
61
|
+
"axios": "^1.3.0",
|
|
62
|
+
"commander": "^10.0.0",
|
|
63
|
+
"dayjs": "^1.11.7",
|
|
64
|
+
"dotenv": "^16.0.3",
|
|
65
|
+
"download-stats": "^0.3.4",
|
|
66
|
+
"eleventy-plugin-toc": "^1.1.5",
|
|
67
|
+
"fs-extra": "^11.1.0",
|
|
68
|
+
"inquirer": "^8.2.3",
|
|
69
|
+
"instantsearch.js": "^4.50.2",
|
|
70
|
+
"luxon": "^3.2.1",
|
|
71
|
+
"markdown-it": "^13.0.1",
|
|
72
|
+
"markdown-it-anchor": "^8.6.6",
|
|
73
|
+
"node-fetch": "3.3.0",
|
|
74
|
+
"winston": "^3.8.2"
|
|
75
|
+
},
|
|
76
|
+
"files": [
|
|
77
|
+
"dist",
|
|
78
|
+
"bin",
|
|
79
|
+
"init"
|
|
80
|
+
],
|
|
81
|
+
"xo": {
|
|
82
|
+
"rules": {
|
|
83
|
+
"@typescript-eslint/no-unsafe-assignment": 0,
|
|
84
|
+
"@typescript-eslint/no-unsafe-return": 0
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"jest": {
|
|
88
|
+
"moduleFileExtensions": [
|
|
89
|
+
"ts",
|
|
90
|
+
"js"
|
|
91
|
+
],
|
|
92
|
+
"transform": {
|
|
93
|
+
"^.+\\.[jt]sx?$": [
|
|
94
|
+
"ts-jest",
|
|
95
|
+
{
|
|
96
|
+
"useESM": true,
|
|
97
|
+
"tsconfig": "tsconfig.json"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"resolver": "jest-ts-webcompat-resolver",
|
|
102
|
+
"testMatch": [
|
|
103
|
+
"**/test/*.test.(ts)",
|
|
104
|
+
"**/test/plugins/*.test.(ts)",
|
|
105
|
+
"**/test/eleventy/*.test.(ts)"
|
|
106
|
+
],
|
|
107
|
+
"testEnvironment": "node"
|
|
108
|
+
}
|
|
109
|
+
}
|