generated from tpl/obsidian-sample-plugin
Move settings into ui directory
This commit is contained in:
parent
259b939bbb
commit
42ba4c306f
|
@ -1,9 +1,9 @@
|
|||
import { Notice, Plugin, requestUrl } from "obsidian";
|
||||
import {
|
||||
type BookTrackerPluginSettings,
|
||||
BookTrackerSettingTab,
|
||||
DEFAULT_SETTINGS,
|
||||
} from "./settings/settings";
|
||||
BookTrackerSettingTab,
|
||||
} from "@ui/settings";
|
||||
import { getBookByLegacyId, type SearchResult } from "@data-sources/goodreads";
|
||||
import { Templater } from "@utils/templater";
|
||||
import {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import type { ReadingLogEntry } from "@src/types";
|
||||
import type { App } from "obsidian";
|
||||
import { BookSuggest } from "@settings/suggesters/book";
|
||||
import { BookSuggest } from "@ui/suggesters";
|
||||
interface Props {
|
||||
app: App;
|
||||
entry?: ReadingLogEntry;
|
||||
|
|
|
@ -1,40 +1,6 @@
|
|||
import BookTrackerPlugin from "@src/main";
|
||||
import { App, PluginSettingTab, Setting } from "obsidian";
|
||||
import { FileSuggest } from "./suggesters/file";
|
||||
import { FolderSuggest } from "./suggesters/folder";
|
||||
import { FieldSuggest } from "./suggesters/field";
|
||||
|
||||
export interface BookTrackerPluginSettings {
|
||||
templateFile: string;
|
||||
tbrDirectory: string;
|
||||
fileNameFormat: string;
|
||||
downloadCovers: boolean;
|
||||
coverDirectory: string;
|
||||
groupCoversByFirstLetter: boolean;
|
||||
overwriteExistingCovers: boolean;
|
||||
statusProperty: string;
|
||||
startDateProperty: string;
|
||||
endDateProperty: string;
|
||||
ratingProperty: string;
|
||||
pageLengthProperty: string;
|
||||
readingLogDirectory: string;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: BookTrackerPluginSettings = {
|
||||
templateFile: "",
|
||||
tbrDirectory: "books/tbr",
|
||||
fileNameFormat: "{{title}} - {{authors}}",
|
||||
downloadCovers: false,
|
||||
coverDirectory: "images/covers",
|
||||
groupCoversByFirstLetter: true,
|
||||
overwriteExistingCovers: false,
|
||||
statusProperty: "status",
|
||||
startDateProperty: "startDate",
|
||||
endDateProperty: "endDate",
|
||||
ratingProperty: "rating",
|
||||
pageLengthProperty: "pageLength",
|
||||
readingLogDirectory: "reading-logs",
|
||||
};
|
||||
import { FileSuggest, FolderSuggest, FieldSuggest } from "@ui/suggesters";
|
||||
|
||||
export class BookTrackerSettingTab extends PluginSettingTab {
|
||||
constructor(app: App, private plugin: BookTrackerPlugin) {
|
|
@ -0,0 +1,2 @@
|
|||
export { BookTrackerSettingTab } from "./BookTrackerSettingTab";
|
||||
export { type BookTrackerPluginSettings, DEFAULT_SETTINGS } from "./types";
|
|
@ -0,0 +1,31 @@
|
|||
export interface BookTrackerPluginSettings {
|
||||
templateFile: string;
|
||||
tbrDirectory: string;
|
||||
fileNameFormat: string;
|
||||
downloadCovers: boolean;
|
||||
coverDirectory: string;
|
||||
groupCoversByFirstLetter: boolean;
|
||||
overwriteExistingCovers: boolean;
|
||||
statusProperty: string;
|
||||
startDateProperty: string;
|
||||
endDateProperty: string;
|
||||
ratingProperty: string;
|
||||
pageLengthProperty: string;
|
||||
readingLogDirectory: string;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: BookTrackerPluginSettings = {
|
||||
templateFile: "",
|
||||
tbrDirectory: "books/tbr",
|
||||
fileNameFormat: "{{title}} - {{authors}}",
|
||||
downloadCovers: false,
|
||||
coverDirectory: "images/covers",
|
||||
groupCoversByFirstLetter: true,
|
||||
overwriteExistingCovers: false,
|
||||
statusProperty: "status",
|
||||
startDateProperty: "startDate",
|
||||
endDateProperty: "endDate",
|
||||
ratingProperty: "rating",
|
||||
pageLengthProperty: "pageLength",
|
||||
readingLogDirectory: "reading-logs",
|
||||
};
|
|
@ -1,5 +1,3 @@
|
|||
// Credits go to Liam's Periodic Notes Plugin: https://github.com/liamcain/obsidian-periodic-notes
|
||||
|
||||
import { TAbstractFile, TFile } from "obsidian";
|
||||
import { TextInputSuggest } from "./core";
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
export { BookSuggest } from "./BookSuggest";
|
||||
export { FieldSuggest } from "./FieldSuggest";
|
||||
export { FileSuggest } from "./FileSuggest";
|
||||
export { FolderSuggest } from "./FolderSuggest";
|
|
@ -21,10 +21,8 @@
|
|||
],
|
||||
"paths": {
|
||||
"@data-sources/*": ["src/data-sources/*"],
|
||||
"@settings/*": ["src/settings/*"],
|
||||
"@ui/*": ["src/ui/*"],
|
||||
"@utils/*": ["src/utils/*"],
|
||||
"@views/*": ["src/views/*"],
|
||||
"@src/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue