mirror of
https://github.com/mnaoumov/obsidian-backlink-full-path.git
synced 2026-07-22 05:41:39 +00:00
Restyle
This commit is contained in:
parent
d8daa16f0e
commit
e4da485498
2 changed files with 18 additions and 11 deletions
|
|
@ -101,19 +101,23 @@ export class Plugin extends PluginBase<PluginTypes> {
|
|||
|
||||
const container = createDiv();
|
||||
setTooltip(container, file.path);
|
||||
if (parentStr) {
|
||||
container.appendText(parentStr);
|
||||
if (this.settings.shouldDisplayParentPathOnSeparateLine) {
|
||||
container.createEl('br');
|
||||
} else {
|
||||
container.createSpan({ prepend: this.settings.shouldReversePathParts, text: pathSeparator });
|
||||
}
|
||||
}
|
||||
container.createSpan({
|
||||
cls: this.settings.shouldHighlightFileName ? 'backlink-full-path file-name' : '',
|
||||
prepend: this.settings.shouldReversePathParts && !this.settings.shouldDisplayParentPathOnSeparateLine,
|
||||
cls: ['backlink-full-path', 'file-name', ...(this.settings.shouldHighlightFileName ? ['file-name-highlighted'] : [''])],
|
||||
text: fileNamePart
|
||||
});
|
||||
|
||||
if (parentStr) {
|
||||
let text = parentStr;
|
||||
if (!this.settings.shouldDisplayParentPathOnSeparateLine) {
|
||||
text = this.settings.shouldReversePathParts ? pathSeparator + text : text + pathSeparator;
|
||||
}
|
||||
container.createSpan({
|
||||
cls: ['backlink-full-path', 'parent-path', ...(this.settings.shouldDisplayParentPathOnSeparateLine ? ['separate-line'] : [])],
|
||||
prepend: !this.settings.shouldReversePathParts && !this.settings.shouldDisplayParentPathOnSeparateLine,
|
||||
text
|
||||
});
|
||||
}
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
.backlink-full-path {
|
||||
&.file-name {
|
||||
&.file-name.file-name-highlighted {
|
||||
font-size: var(--font-ui-large);
|
||||
font-weight: bold;
|
||||
}
|
||||
&.parent-path.separate-line {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue