Skip to content

Commit 50e8a56

Browse files
committed
Add docfx-tools template and cleanup docfx.json
1 parent 9be19e3 commit 50e8a56

7 files changed

Lines changed: 14 additions & 93 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@
4040
[submodule "python"]
4141
path = python
4242
url = https://github.com/harp-tech/harp-python.git
43+
[submodule "docfx-tools"]
44+
path = docfx-tools
45+
url = https://github.com/bonsai-rx/docfx-tools.git

docfx-tools

Submodule docfx-tools added at 0ab0799

docfx.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
],
1717
"dest": "api",
1818
"filter": "filter.yml",
19-
"enumSortOrder": "declaringOrder",
20-
"disableGitFeatures": false,
21-
"disableDefaultFilter": false
19+
"enumSortOrder": "declaringOrder"
2220
}
2321
],
2422
"build": {
@@ -47,8 +45,6 @@
4745
"resource": [
4846
{
4947
"files": [
50-
"logo.svg",
51-
"favicon.ico",
5248
"src/device.*/Assets/*.png",
5349
"src/device.*/Assets/*.jpg",
5450
"protocol/assets/**",
@@ -78,7 +74,7 @@
7874
"globalMetadata": {
7975
"_enableNewTab": true,
8076
"_enableSearch": true,
81-
"_appFooter": "<span>&copy; 2023 harp-tech and Contributors</span> - <span>Licensed under <a href=\"https://creativecommons.org/licenses/by-sa/4.0/\">CC BY-SA 4.0</a>.</span> - <span>Made with <a href=\"https://dotnet.github.io/docfx\">docfx</a></span>",
77+
"_appFooter": "<span>&copy; 2025 harp-tech and Contributors</span> - <span>Licensed under <a href=\"https://creativecommons.org/licenses/by-sa/4.0/\">CC BY-SA 4.0</a>.</span> - <span>Made with <a href=\"https://dotnet.github.io/docfx\">docfx</a></span>",
8278
"_gitContribute": {
8379
"repo": "https://github.com/harp-tech/harp-tech.github.io",
8480
"branch": "main",
@@ -91,9 +87,9 @@
9187
"template": [
9288
"default",
9389
"modern",
90+
"docfx-tools/template",
9491
"template"
9592
],
96-
"postProcessors": [ "ExtractSearchIndex" ],
9793
"markdownEngineName": "markdig",
9894
"markdownEngineProperties": {
9995
"markdigExtensions": [
File renamed without changes.
File renamed without changes.

template/public/main.css

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1 @@
1-
.workflow {
2-
border: 1px solid #e3e3e3;
3-
padding: 1px;
4-
}
5-
6-
.workflow > p > img {
7-
padding-top: 12px;
8-
padding-left: 12px;
9-
padding-right: 12px;
10-
}
11-
12-
.codeHeader {
13-
box-sizing: content-box;
14-
background-color: #f2f2f2;
15-
color: #171717;
16-
display: flex;
17-
flex-direction: row;
18-
border: 1px solid #e3e3e3;
19-
border-bottom: 0;
20-
margin-top: 16px;
21-
min-height: 30px;
22-
}
23-
24-
.codeHeader > .language {
25-
padding: 2px 16px;
26-
flex-grow: 1;
27-
line-height: 26px;
28-
}
29-
30-
.wrap-right > p > img,
31-
.wrap-right > p > a > img {
32-
max-width: 50%;
33-
float: inline-end;
34-
}
1+
@import "workflow.css";

template/public/main.js

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,13 @@
1-
var WorkflowContainer = {
2-
createCodeHeader: function(text) {
3-
const div = document.createElement("div");
4-
div.className = "codeHeader";
5-
div.innerHTML =
6-
'<span class="language">'+ text +'</span>'+
7-
'<a class="btn border-0 code-action" href="#" title="Copy">'+
8-
' <i class="bi bi-clipboard"></i>'+
9-
'</a>';
10-
return div;
11-
},
12-
setCopyAlert: function(element) {
13-
const copyIcon = element.querySelector("i");
14-
element.classList.add("link-success");
15-
copyIcon.classList.add("bi-check-lg");
16-
copyIcon.classList.remove("bi-clipboard");
17-
setTimeout(function() {
18-
copyIcon.classList.remove("bi-check-lg");
19-
copyIcon.classList.add("bi-clipboard");
20-
element.classList.remove("link-success");
21-
}, 1000);
22-
},
23-
renderElement: function(element) {
24-
const img = element.querySelector("img");
25-
const workflowPath = img.src;
26-
img.src = workflowPath.replace(/\.[^.]+$/, ".svg");
27-
28-
const codeHeader = WorkflowContainer.createCodeHeader("Workflow");
29-
const button = codeHeader.querySelector("a");
30-
button.addEventListener("click", (e) => {
31-
e.preventDefault();
32-
fetch(workflowPath).then(req => req.text()).then(contents => {
33-
navigator.clipboard.writeText(contents);
34-
WorkflowContainer.setCopyAlert(button);
35-
});
36-
});
37-
38-
const wrap = document.createElement("p");
39-
const parent = element.parentElement
40-
parent.insertBefore(wrap, element);
41-
wrap.appendChild(codeHeader);
42-
wrap.appendChild(element);
43-
},
44-
init: async function() {
45-
for (const element of document.getElementsByClassName("workflow")) {
46-
WorkflowContainer.renderElement(element)
47-
}
48-
}
49-
}
1+
import WorkflowContainer from "./workflow.js"
502

513
export default {
524
defaultTheme: 'light',
535
iconLinks: [{
546
icon: 'github',
557
href: 'https://github.com/harp-tech',
568
title: 'GitHub'
57-
}]
58-
}
59-
WorkflowContainer.init();
9+
}],
10+
start: () => {
11+
WorkflowContainer.init();
12+
}
13+
}

0 commit comments

Comments
 (0)