Skip to content

Commit

Permalink
Header links now referred to as anchor links
Browse files Browse the repository at this point in the history
  • Loading branch information
rca-umb committed Dec 1, 2024
1 parent 9fe6fd9 commit 4e92009
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { App, Editor, Notice, Plugin, PluginSettingTab, Setting } from 'obsidian';

interface HeaderDisplayTextSettings {
interface AnchorDisplayTextSettings {
includeNoteName : string;
whichHeadings: string;
includeNotice: boolean;
noticeText: string;
sep : string;
}

const DEFAULT_SETTINGS: HeaderDisplayTextSettings = {
const DEFAULT_SETTINGS: AnchorDisplayTextSettings = {
includeNoteName: 'headersOnly',
whichHeadings: 'allHeaders',
includeNotice: false,
noticeText: 'Link changed!',
sep: ' '
}

export default class HeaderDisplayText extends Plugin {
settings: HeaderDisplayTextSettings;
export default class AnchorDisplayText extends Plugin {
settings: AnchorDisplayTextSettings;

async onload() {
await this.loadSettings();

this.addSettingTab(new HeaderDisplayTextSettingTab(this.app, this));
this.addSettingTab(new AnchorDisplayTextSettingTab(this.app, this));

// look for header link creation
this.registerEvent(
Expand Down Expand Up @@ -77,10 +77,10 @@ export default class HeaderDisplayText extends Plugin {

}

class HeaderDisplayTextSettingTab extends PluginSettingTab {
plugin: HeaderDisplayText;
class AnchorDisplayTextSettingTab extends PluginSettingTab {
plugin: AnchorDisplayText;

constructor(app: App, plugin: HeaderDisplayText) {
constructor(app: App, plugin: AnchorDisplayText) {
super(app, plugin);
this.plugin = plugin;
}
Expand Down
8 changes: 4 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "header-display-text",
"name": "Header Display Text",
"id": "anchor-display-text",
"name": "anchor Display Text",
"version": "0.2.0",
"minAppVersion": "0.15.0",
"description": "Automatically uses linked headers as the display text for the link.",
"author": "Robert Arsenault",
"description": "Automatically uses the linked heading as the display text for the anchor links.",
"author": "Robert C Arsenault",
"authorUrl": "https://github.com/rca-umb",
"isDesktopOnly": false
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "header-display-text-plugin",
"name": "anchor-display-text-plugin",
"version": "0.2.0",
"description": "Plugin for Obsidian (https://obsidian.md) that sets the display text of linked headers to the name of the header.",
"description": "Plugin for Obsidian (https://obsidian.md) that sets the display text of anchor links to the name of the heading.",
"main": "main.js",
"scripts": {
"dev": "node esbuild.config.mjs",
Expand Down

0 comments on commit 4e92009

Please sign in to comment.