File tree Expand file tree Collapse file tree 8 files changed +31
-33
lines changed Expand file tree Collapse file tree 8 files changed +31
-33
lines changed Original file line number Diff line number Diff line change
1
+
2
+ export interface DatabaseEntryMeta {
3
+ id : string ;
4
+ url : string ;
5
+ }
Original file line number Diff line number Diff line change
1
+ import { DatabaseEntryMeta } from './DatabaseEntryMeta' ;
2
+
1
3
/**
2
4
* Conventional selection of meta information about a Notion API page.
3
5
* Made availabel as top-level frontmatter on rendered markdown pages
4
6
*/
5
- export interface PageMeta extends DatabaseEntryMeta {
6
- id : string ;
7
- url : string ;
7
+ export interface DatabasePageMeta extends DatabaseEntryMeta {
8
8
title : string ;
9
9
category : string ;
10
10
order ?: number ;
11
11
layout ?: string ;
12
12
}
13
13
14
- export interface DatabaseEntryMeta {
15
- id : string ;
16
- url : string ;
17
- title : string ;
18
- }
14
+
Original file line number Diff line number Diff line change 1
- import { PageMeta } from "./PageMeta" ;
1
+ import { DatabasePageMeta } from './DatabasePageMeta' ;
2
2
3
- export interface PageProperties {
3
+ export interface DatabasePageProperties {
4
4
/**
5
5
* Meta information about a Notion API page
6
6
*/
7
- meta : PageMeta ;
7
+ meta : DatabasePageMeta ;
8
8
9
9
/**
10
10
* A mapping of property object keys -> property values
@@ -16,4 +16,3 @@ export interface PageProperties {
16
16
*/
17
17
keys : Map < string , string > ;
18
18
}
19
-
Original file line number Diff line number Diff line change 1
- import * as yaml from "js-yaml" ;
2
- import { PageProperties } from "./PageProperties" ;
1
+ import * as yaml from 'js-yaml' ;
2
+
3
+ import { DatabasePageProperties } from './DatabasePageProperties' ;
3
4
4
5
export class FrontmatterRenderer {
5
6
constructor ( ) { }
6
7
7
- public renderFrontmatter ( props : PageProperties ) {
8
+ public renderFrontmatter ( props : DatabasePageProperties ) {
8
9
const obj = {
9
10
...props . meta ,
10
11
properties : props . values ,
Original file line number Diff line number Diff line change 1
- import { Page , PropertyValue } from " @notionhq/client/build/src/api-types" ;
1
+ import { Page , PropertyValue } from ' @notionhq/client/build/src/api-types' ;
2
2
3
- import { logger } from "./logger" ;
4
- import { PageProperties } from "./PageProperties" ;
5
- import { RichTextRenderer } from " ./RichTextRenderer" ;
6
- import { slugify } from " ./slugify" ;
7
- import { DatabaseConfig , DatabaseConfigRenderPages } from " ./SyncConfig" ;
3
+ import { DatabasePageProperties } from './DatabasePageProperties' ;
4
+ import { logger } from './logger' ;
5
+ import { RichTextRenderer } from ' ./RichTextRenderer' ;
6
+ import { slugify } from ' ./slugify' ;
7
+ import { DatabaseConfig , DatabaseConfigRenderPages } from ' ./SyncConfig' ;
8
8
9
9
const debug = require ( "debug" ) ( "properties" ) ;
10
10
@@ -22,7 +22,7 @@ export class PropertiesParser {
22
22
public async parsePageProperties (
23
23
page : Page ,
24
24
config : DatabaseConfigRenderPages
25
- ) : Promise < PageProperties > {
25
+ ) : Promise < DatabasePageProperties > {
26
26
const {
27
27
title,
28
28
category,
Original file line number Diff line number Diff line change 1
- import { PageProperties } from "./PageProperties" ;
2
-
1
+ import { DatabasePageProperties } from './DatabasePageProperties' ;
3
2
4
3
export interface RenderDatabasePageTask {
5
4
id : string ;
6
5
file : string ;
7
- properties : PageProperties ;
6
+ properties : DatabasePageProperties ;
8
7
render : ( ) => Promise < any > ;
9
8
}
Original file line number Diff line number Diff line change
1
+ import { DatabaseEntryMeta } from './DatabaseEntryMeta' ;
2
+
1
3
export interface RenderedDatabaseEntry {
2
- meta : {
3
- id : string ;
4
- url : string ;
5
- } ;
4
+ meta : DatabaseEntryMeta ,
6
5
properties : Record < string , any > ;
7
6
}
Original file line number Diff line number Diff line change 1
- import { PageMeta } from "./PageMeta" ;
2
- import { RenderedDatabaseEntry } from "./RenderedDatabaseEntry" ;
3
-
1
+ import { DatabasePageMeta } from './DatabasePageMeta' ;
2
+ import { RenderedDatabaseEntry } from './RenderedDatabaseEntry' ;
4
3
5
4
export interface RenderedDatabasePage extends RenderedDatabaseEntry {
6
- meta : PageMeta ;
5
+ meta : DatabasePageMeta ;
7
6
file : string ;
8
7
}
You can’t perform that action at this time.
0 commit comments