File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed
Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ export class Templater {
7474 } ;
7575 }
7676
77+ get_current_running_config ( ) : RunningConfig {
78+ return this . functions_generator . get_config ( ) ;
79+ }
80+
7781 async read_and_parse_template ( config : RunningConfig ) : Promise < string > {
7882 const template_content = await this . plugin . app . vault . read (
7983 config . template_file as TFile
@@ -164,6 +168,8 @@ export class Templater {
164168 return ;
165169 }
166170
171+ const backup_config = this . get_current_running_config ( ) ;
172+
167173 const { path } = created_note ;
168174 this . start_templater_task ( path ) ;
169175 let running_config : RunningConfig ;
@@ -223,6 +229,10 @@ export class Templater {
223229 } ) ;
224230 }
225231
232+ await this . functions_generator . generate_object (
233+ backup_config ,
234+ FunctionsMode . USER_INTERNAL
235+ ) ;
226236 await this . end_templater_task ( path ) ;
227237 return created_note ;
228238 }
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ export class FunctionsGenerator implements IGenerateObject {
1919 this . user_functions = new UserFunctions ( this . plugin ) ;
2020 }
2121
22+ get_config ( ) : RunningConfig {
23+ return this . internal_functions . get_config ( ) ;
24+ }
25+
2226 async init ( ) : Promise < void > {
2327 await this . internal_functions . init ( ) ;
2428 }
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ export class InternalFunctions implements IGenerateObject {
2323 this . modules_array . push ( new InternalModuleConfig ( this . plugin ) ) ;
2424 }
2525
26+ get_config ( ) : RunningConfig {
27+ return this . modules_array [ 0 ] . get_config ( ) ;
28+ }
29+
2630 async init ( ) : Promise < void > {
2731 for ( const mod of this . modules_array ) {
2832 await mod . init ( ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ export abstract class InternalModule implements IGenerateObject {
1616 return this . name ;
1717 }
1818
19+ get_config ( ) : RunningConfig {
20+ return this . config ;
21+ }
22+
1923 abstract create_static_templates ( ) : Promise < void > ;
2024 abstract create_dynamic_templates ( ) : Promise < void > ;
2125 abstract teardown ( ) : Promise < void > ;
You can’t perform that action at this time.
0 commit comments