@@ -14,6 +14,7 @@ export class NotionImporter extends FormatImporter {
1414 removeNotionToc : boolean ;
1515 autoDetectedLanguages : string [ ] ;
1616 languageDetectionMinimumThreshold : number ;
17+ preserveIconAsProperty : string ;
1718
1819 init ( ) {
1920 this . parentsInSubfolders = true ;
@@ -32,6 +33,8 @@ export class NotionImporter extends FormatImporter {
3233 'sql' ,
3334 'plaintext' ,
3435 ] ;
36+ this . preserveIconAsProperty = 'sticker' ;
37+
3538 this . addFileChooserSetting ( 'Exported Notion' , [ 'zip' ] ) ;
3639 this . addOutputLocationSetting ( 'Notion' ) ;
3740 new Setting ( this . modal . contentEl )
@@ -59,6 +62,12 @@ export class NotionImporter extends FormatImporter {
5962 . addTextArea ( ( textArea ) => textArea
6063 . setValue ( this . autoDetectedLanguages . join ( '\n' ) )
6164 . onChange ( ( value ) => value ? this . autoDetectedLanguages = value . split ( '\n' ) : [ ] ) ) ;
65+ new Setting ( this . modal . contentEl )
66+ . setName ( 'Property name for icon' )
67+ . setDesc ( 'Icons can be preserved as a property with the given name. Leaving this empty will skip adding any such property.' )
68+ . addText ( ( text ) => text
69+ . setValue ( this . preserveIconAsProperty )
70+ . onChange ( ( value ) => value ? this . preserveIconAsProperty = value : '' ) ) ;
6271 }
6372
6473 async import ( ctx : ImportContext ) : Promise < void > {
@@ -68,6 +77,7 @@ export class NotionImporter extends FormatImporter {
6877 removeNotionToc,
6978 autoDetectedLanguages,
7079 languageDetectionMinimumThreshold,
80+ preserveIconAsProperty,
7181 files,
7282 } = this ;
7383 console . log ( 'Auto detecting languages: ' + autoDetectedLanguages . join ( '\n' ) ) ;
@@ -150,6 +160,7 @@ export class NotionImporter extends FormatImporter {
150160 removeNotionToc,
151161 autoDetectedLanguages,
152162 languageDetectionMinimumThreshold,
163+ preserveIconAsProperty,
153164 } ;
154165 const markdownBody = await readToMarkdown ( info , conversionOptions , file ) ;
155166
0 commit comments