Skip to content

Commit

Permalink
Prep 0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jun 19, 2021
1 parent c12a79e commit f2e0313
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "breadcrumbs",
"name": "Breadcrumbs",
"version": "0.0.6",
"version": "0.0.7",
"minAppVersion": "0.12.5",
"description": "Visualise the hierarchy of your vault using a breadcrumb trail",
"author": "SkepticMystic",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "breadcrumbs-plugin",
"version": "0.0.6",
"version": "0.0.7",
"description": "Visualise the hierarchy of your vault using a breadcrumb trail",
"main": "main.js",
"scripts": {
Expand Down
14 changes: 5 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,14 @@ class BreadcrumbsView extends ItemView {
// General use
const splitLinksRegex = new RegExp(/\[\[(.+?)\]\]/g);
const dropHeaderOrAlias = new RegExp(/\[\[([^#|]+)\]\]/);

function splitAndDrop(str: string | undefined): string[] | [] {
if (str === undefined || str === "") {
return [];
} else {
return str
.match(splitLinksRegex)
.map((link) => link.match(dropHeaderOrAlias)[1]);
.map((link) => link.replace(dropHeaderOrAlias, "$1"));
}
}

Expand Down Expand Up @@ -144,8 +145,6 @@ class BreadcrumbsView extends ItemView {
const childLinks: string | undefined =
arr.content.match(getChildLinksRegex)?.[1];



const [splitParentLinks, splitSiblingLinks, splitChildLinks] = [
splitAndDrop(parentLinks),
splitAndDrop(siblingLinks),
Expand All @@ -160,7 +159,7 @@ class BreadcrumbsView extends ItemView {
};

console.log(currentNeighbourObj);
return currentNeighbourObj
return currentNeighbourObj;
}
);
// console.log(neighbourArr);
Expand All @@ -178,7 +177,7 @@ class BreadcrumbsView extends ItemView {
const gSiblings = new Graph();
const gChildren = new Graph();

neighbourArr.forEach(neighbourObj => {
neighbourArr.forEach((neighbourObj) => {
gAllInOne.setNode(neighbourObj.current, neighbourObj.current);
gParents.setNode(neighbourObj.current, neighbourObj.current);
gSiblings.setNode(neighbourObj.current, neighbourObj.current);
Expand All @@ -201,11 +200,8 @@ class BreadcrumbsView extends ItemView {
gChildren.setEdge(neighbourObj.current, child, "child")
);
}

});



neighbourArr.forEach((neighbourObj) => {
gAllInOne.setNode(neighbourObj.current, neighbourObj.current);

Expand All @@ -228,7 +224,7 @@ class BreadcrumbsView extends ItemView {
}
});

return {gAllInOne, gParents, gChildren, gSiblings};
return { gAllInOne, gParents, gChildren, gSiblings };
}

// Graph stuff...
Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"0.0.7": "0.12.5",
"0.0.6": "0.12.5",
"0.0.5": "0.12.5",
"0.0.4": "0.12.5",
Expand Down

0 comments on commit f2e0313

Please sign in to comment.