generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36d7df1
commit bbe4e6d
Showing
6 changed files
with
217 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<script lang="ts"> | ||
import type { App } from "obsidian"; | ||
import type { internalLinkObj } from "src/ListView"; | ||
export let list; | ||
const realItems: internalLinkObj[] = list.realItems; | ||
const impliedItems: internalLinkObj[] = list.impliedItems; | ||
const fieldName: string = list.fieldName; | ||
const app: App = list.app; | ||
async function openLink(item: internalLinkObj) { | ||
await app.workspace.openLinkText(item.to, item.currFile.path); | ||
} | ||
</script> | ||
|
||
<details> | ||
<summary>{fieldName}</summary> | ||
|
||
{#if realItems.length > 0} | ||
<h5 class="header">Real</h5> | ||
{/if} | ||
|
||
{#if realItems.length > 1} | ||
<ol> | ||
{#each realItems as realItem} | ||
<li> | ||
<a | ||
href="null" | ||
class={realItem.cls} | ||
on:click={async () => openLink(realItem)} | ||
> | ||
{realItem.to} | ||
</a> | ||
</li> | ||
{/each} | ||
</ol> | ||
{:else if realItems.length === 1} | ||
<a | ||
href="null" | ||
class={realItems[0].cls} | ||
on:click={async () => openLink(realItems[0])} | ||
> | ||
{realItems[0].to} | ||
</a> | ||
{/if} | ||
|
||
{#if impliedItems.length > 0} | ||
<h5 class="header">Implied</h5> | ||
{/if} | ||
|
||
{#if impliedItems.length > 1} | ||
<ol> | ||
{#each impliedItems as impliedItem} | ||
<li> | ||
<a | ||
href="null" | ||
class={impliedItem.cls} | ||
on:click={async () => openLink(impliedItem)} | ||
>{impliedItem.to} | ||
</a> | ||
</li> | ||
{/each} | ||
</ol> | ||
{:else if impliedItems.length === 1} | ||
<a | ||
href="null" | ||
class={impliedItems[0].cls} | ||
on:click={async () => openLink(impliedItems[0])}>{impliedItems[0].to}</a | ||
> | ||
{/if} | ||
</details> | ||
|
||
<style> | ||
summary { | ||
font-size: larger; | ||
margin: 3px; | ||
} | ||
h5.header { | ||
margin: 3px; | ||
} | ||
ol { | ||
margin: 3px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script lang="ts"> | ||
import List from "./List.svelte"; | ||
import type SquareProps from "./MatrixView"; | ||
export let parents: SquareProps; | ||
export let top: SquareProps; | ||
export let siblings: SquareProps; | ||
export let children: SquareProps; | ||
const lists = [parents, top, siblings, children]; | ||
const currFile = parents.app.workspace.getActiveFile().basename; | ||
</script> | ||
|
||
<h2 class="header">{currFile}</h2> | ||
{#each lists as list} | ||
{#if Object.keys(list).length} | ||
<List {list} /> | ||
{/if} | ||
{/each} | ||
|
||
<style> | ||
h2.header { | ||
margin: 3px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export const VIEW_TYPE_BREADCRUMBS_MATRIX = "breadcrumbs-matrix"; | ||
export const VIEW_TYPE_BREADCRUMBS_LIST = "breadcrumbs-list"; | ||
export const VIEW_TYPE_BREADCRUMBS_TRAIL = "breadcrumbs-trail"; | ||
export const splitLinksRegex = new RegExp(/\[\[(.+?)\]\]/g); | ||
export const dropHeaderOrAlias = new RegExp(/\[\[([^#|]+)\]\]/); |
Oops, something went wrong.