11// an extension manager that uses cosmicconfig to get a list of plugin functions
22// and then runs them in sequence
33
4- import {
5- ListBlockChildrenResponseResult ,
6- ListBlockChildrenResponseResults ,
7- } from "notion-to-md/build/types" ;
4+ import { ListBlockChildrenResponseResult } from "notion-to-md/build/types" ;
85import * as Cosmic from "cosmiconfig" ;
96import { CosmiconfigResult } from "cosmiconfig/dist/types" ;
107import { NotionPage } from "../NotionPage" ;
@@ -27,7 +24,6 @@ export type IPlugin = {
2724 name : string ;
2825 // operations on notion blocks before they are converted to markdown
2926 notionBlockModifications ?: {
30- label : string ;
3127 modify : ( block : NotionBlock ) => void ;
3228 } [ ] ;
3329 // overrides for the default notion-to-markdown conversions
@@ -41,7 +37,6 @@ export type IPlugin = {
4137
4238 // corrections to links after they are converted to markdown
4339 linkModifier ?: {
44- label : string ;
4540 match : RegExp ; // does this plugin apply to this link?
4641 convert : linkConversionFunction ;
4742 } ;
@@ -51,7 +46,6 @@ export type IPlugin = {
5146} ;
5247
5348export type IRegexMarkdownModification = {
54- label : string ;
5549 regex : RegExp ;
5650 output : string ;
5751 imports ?: string [ ] ;
@@ -82,22 +76,12 @@ export type IDocuNotionContext = {
8276 relativeFilePathToFolderContainingPage : string ;
8377 pages : NotionPage [ ] ;
8478 counts : ICounts ;
85- // log: {
86- // error(s: string): void;
87- // warning(s: string): void;
88- // info(s: string): void;
89- // verbose(s: string): void;
90- // debug(s: string): void;
91- // };
9279} ;
9380
94- //let config: IDocuNotionConfig | undefined;
95-
9681// read the plugins from the config file
9782// and add them to the map
9883export function loadConfig ( ) : IDocuNotionConfig {
9984 // return Cosmic.cosmiconfigSync("docunotion").search()
100- // ?.config as IDocuNotionConfig;
10185
10286 return defaultConfig ;
10387}
0 commit comments