Documentation ¶
Index ¶
- Constants
- func CommentMetaAndTags(comments []string) (metaMap map[string]string, tags []string)
- func WalkIndex(entrances []string) (pages map[string]*PageMeta, err error)
- type PageChunkBlock
- type PageChunkRequest
- type PageChunkResponse
- type PageCursor
- type PageDiscussion
- type PageMeta
- type PageStackItem
Constants ¶
View Source
const (
SubTitleKey = "sub_title"
)
Variables ¶
This section is empty.
Functions ¶
func CommentMetaAndTags ¶
Types ¶
type PageChunkBlock ¶
type PageChunkBlock struct { Role string `json:"role"` Value struct { ID string `json:"id"` Version int `json:"version"` Type string `json:"type"` Text [][]string `json:"text"` // comment Properties struct { Title [][]interface{} `json:"title"` // most string otherwise [[]] style params } `json:"properties"` Format struct { PageIcon string `json:"page_icon"` PageCover string `json:"page_cover"` PageFullWidth bool `json:"page_full_width"` PageCoverPosition float64 `json:"page_cover_position"` } Discussions []string `json:"discussions"` CreatedTime int64 `json:"created_time"` LastEditedTime int64 `json:"last_edited_time"` ParentID string `json:"parent_id"` ParentTable string `json:"parent_table"` Alive bool `json:"alive"` CreatedByTable string `json:"created_by_table"` CreatedByID string `json:"created_by_id"` LastEditedByTable string `json:"last_edited_by_table"` LastEditedByID string `json:"last_edited_by_id"` ShardID int `json:"shard_id"` SpaceID string `json:"space_id"` } `json:"value"` }
func (*PageChunkBlock) RawComments ¶
func (r *PageChunkBlock) RawComments() (comments []string)
func (*PageChunkBlock) SourceImageUrl ¶
func (r *PageChunkBlock) SourceImageUrl(s string) string
type PageChunkRequest ¶
type PageChunkRequest struct { PageID string `json:"pageId"` Limit int `json:"limit"` ChunkNumber int `json:"chunkNumber"` Cursor *PageCursor `json:"cursor"` VerticalColumns bool `json:"verticalColumns"` }
type PageChunkResponse ¶
type PageChunkResponse struct { RecordMap struct { Block map[string]*PageChunkBlock `json:"block"` Comment map[string]*PageChunkBlock `json:"comment"` Discussion map[string]*PageDiscussion `json:"discussion"` } `json:"recordMap"` }
func LoadPageChunk ¶
func LoadPageChunk(pageId string) (pageChunkResp *PageChunkResponse, err error)
func (*PageChunkResponse) CurrentPageMeta ¶
func (r *PageChunkResponse) CurrentPageMeta(pageId string) (meta *PageMeta)
CurrentPageMeta fetch current page meta from response notion page may contains child page comments in parent page chunk
func (*PageChunkResponse) FetchBlockMeta ¶
func (r *PageChunkResponse) FetchBlockMeta(block *PageChunkBlock) (meta *PageMeta)
type PageCursor ¶
type PageCursor struct {
Stack [][]*PageStackItem `json:"stack"`
}
type PageDiscussion ¶
type PageDiscussion struct { Role string `json:"role"` Value struct { ID string `json:"id"` Version int `json:"version"` ParentID string `json:"parent_id"` ParentTable string `json:"parent_table"` Resolved bool `json:"resolved"` Comments []string `json:"comments"` SpaceID string `json:"space_id"` } `json:"value"` }
type PageMeta ¶
type PageMeta struct { CreatedAt string `json:"created_at"` CreateTimestamp int64 `json:"create_timestamp"` // /1000 to seconds LastModifyAt string `json:"last_modify_at"` LastModifyTimestamp int64 `json:"last_modify_timestamp"` // /1000 to seconds Title string `json:"title"` SubTitle string `json:"sub_title"` // must be alphabet and number PageName string `json:"page_name"` PageFolders []string `json:"page_folders"` Comment []string `json:"comment"` Meta map[string]string `json:"meta"` Tags []string `json:"tags"` PageCover string `json:"page_cover"` }
type PageStackItem ¶
Click to show internal directories.
Click to hide internal directories.