@@ -7,10 +7,8 @@ import { API } from './api/API';
77import { setFirstWeekday } from './utils/DatePickerUtils' ;
88import { createMarkdownRenderChildWidgetEditorPlugin } from './cm6/Cm6_ViewPlugin' ;
99import { MDRCManager } from './MDRCManager' ;
10- import { DEFAULT_SETTINGS , type InputFieldTemplate , type MetaBindPluginSettings } from './settings/Settings' ;
10+ import { DEFAULT_SETTINGS , type MetaBindPluginSettings } from './settings/Settings' ;
1111import { type IPlugin } from './IPlugin' ;
12- import { EnclosingPair , ParserUtils } from './utils/ParserUtils' ;
13- import { ErrorLevel , MetaBindParsingError } from './utils/errors/MetaBindErrors' ;
1412import { ObsidianMetadataAdapter } from './metadata/ObsidianMetadataAdapter' ;
1513import { FaqView , MB_FAQ_VIEW_TYPE } from './utils/faq/FaqView' ;
1614
@@ -128,26 +126,6 @@ export default class MetaBindPlugin extends Plugin implements IPlugin {
128126 const bestLinkPath = this . app . metadataCache . getFirstLinkpathDest ( name , '' ) ;
129127
130128 return bestLinkPath === null ? [ ] : [ bestLinkPath . path ] ;
131-
132- // const fileNameIsPath = isPath(name);
133- // const processedFileName = fileNameIsPath ? removeFileEnding(name) : getFileName(removeFileEnding(name));
134- //
135- // const allFiles = this.app.vault.getMarkdownFiles();
136- // const filePaths: string[] = [];
137- // for (const file of allFiles) {
138- // // console.log(removeFileEnding(file.path));
139- // if (fileNameIsPath) {
140- // if (removeFileEnding(file.path) === processedFileName) {
141- // filePaths.push(file.path);
142- // }
143- // } else {
144- // if (getFileName(removeFileEnding(file.name)) === processedFileName) {
145- // filePaths.push(file.path);
146- // }
147- // }
148- // }
149- //
150- // return filePaths;
151129 }
152130
153131 isFilePathExcluded ( path : string ) : boolean {
@@ -176,45 +154,11 @@ export default class MetaBindPlugin extends Plugin implements IPlugin {
176154 console . log ( `meta-bind | Main >> settings save` ) ;
177155
178156 DateParser . dateFormat = this . settings . preferredDateFormat ;
179- // this.api.inputFieldParser.parseTemplates(this.settings.inputTemplates);
180157 setFirstWeekday ( this . settings . firstWeekday ) ;
181158 await this . saveData ( this . settings ) ;
182159 }
183160
184161 applyTemplatesMigration ( oldSettings : MetaBindPluginSettings ) : MetaBindPluginSettings {
185- if ( oldSettings . inputTemplates !== undefined ) {
186- const templates = oldSettings . inputTemplates ;
187- const newTemplates : InputFieldTemplate [ ] = [ ] ;
188-
189- try {
190- let templateDeclarations = templates ? ParserUtils . split ( templates , '\n' , new EnclosingPair ( '[' , ']' ) ) : [ ] ;
191- templateDeclarations = templateDeclarations . map ( x => x . trim ( ) ) . filter ( x => x . length > 0 ) ;
192-
193- for ( const templateDeclaration of templateDeclarations ) {
194- let templateDeclarationParts : string [ ] = ParserUtils . split ( templateDeclaration , '->' , new EnclosingPair ( '[' , ']' ) ) ;
195- templateDeclarationParts = templateDeclarationParts . map ( x => x . trim ( ) ) ;
196-
197- if ( templateDeclarationParts . length === 1 ) {
198- throw new MetaBindParsingError ( {
199- errorLevel : ErrorLevel . CRITICAL ,
200- effect : 'failed to parse template declaration' ,
201- cause : `template must include one "->"` ,
202- } ) ;
203- } else if ( templateDeclarationParts . length === 2 ) {
204- newTemplates . push ( {
205- name : templateDeclarationParts [ 0 ] ,
206- declaration : templateDeclarationParts [ 1 ] ,
207- } ) ;
208- }
209- }
210- } catch ( e ) {
211- console . warn ( 'failed to migrate templates' , e ) ;
212- }
213-
214- delete oldSettings . inputTemplates ;
215- oldSettings . inputFieldTemplates = newTemplates ;
216- }
217-
218162 return oldSettings ;
219163 }
220164
0 commit comments