render markdown
All checks were successful
Updates the graph by copying the updated files in the right directory / build-and-deploy (push) Successful in 3s

This commit is contained in:
Lichene 2025-11-14 15:15:32 +01:00
parent 83df55e089
commit 372ce92e2e
3 changed files with 26 additions and 3 deletions

View file

@ -109,13 +109,21 @@ function update(source) {
}) })
.append("a") .append("a")
.attr("target", "_blank") .attr("target", "_blank")
.attr("xlink:href", function (d) { .attr(
"xlink:href",
(d) =>
"viewer.html?file=https://git.hackinpovo.it/HackInPovo/resources/raw/branch/main/notes/" +
d.name +
".md",
)
.attr("target", "_blank") // ← open in new tab
/* .attr("xlink:href", function (d) {
return ( return (
"https://git.hackinpovo.it/HackInPovo/resources/raw/branch/main/Notes/" + "https://git.hackinpovo.it/HackInPovo/resources/raw/branch/main/notes/" +
d.name + d.name +
".txt" ".txt"
); );
}) })*/
.append("svg:text") .append("svg:text")
.attr("x", function (d) { .attr("x", function (d) {
// Get the sibling text element (the node name) and calculate position // Get the sibling text element (the node name) and calculate position

15
public/viewer.html Normal file
View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
</head>
<body>
<div id="content"></div>
<script>
const mdFile = new URLSearchParams(location.search).get("file");
fetch(mdFile)
.then(r => r.text())
.then(text => document.getElementById("content").innerHTML = marked.parse(text));
</script>
</body>
</html>