Documentation ¶
Index ¶
- Constants
- func ActivateNotionTerm(client *notionapi.Client, pageid string, play chan struct{}) http.Handler
- func AddRichText(client *notionapi.Client, codeBlock notionapi.CodeBlock, content string) (notionapi.Block, error)
- func AddTermLine(config *Config, codeBlock notionapi.CodeBlock) (notionapi.Block, error)
- func AppendCodeBlock(client *notionapi.Client, pageid string, content string) (resp *notionapi.AppendBlockChildrenResponse, err error)
- func AppendEmbedBlock(client *notionapi.Client, pageid string, url string) (resp *notionapi.AppendBlockChildrenResponse, err error)
- func AppendHeadingBlock(client *notionapi.Client, pageid string, content string) (resp *notionapi.AppendBlockChildrenResponse, err error)
- func ButtonPage() http.Handler
- func CreateButtonBlock(config Config) notionapi.BlockID
- func CreateHeadingCaptionBlock(config Config) notionapi.BlockID
- func CreateTerminalBlock(config Config) notionapi.BlockID
- func DeactivateNotionTerm(pause chan struct{}) http.Handler
- func DeleteEmbed(config Config) (err error)
- func ExecAndPrint(config *Config, termBlock notionapi.CodeBlock, cmd string)
- func GetButtonBlock(children notionapi.Blocks, buttonId notionapi.BlockID) (button notionapi.EmbedBlock, err error)
- func GetHeadingCaptionBlock(children notionapi.Blocks, headingID notionapi.BlockID) (headingCaption notionapi.Heading3Block, err error)
- func GetTableBlock(children notionapi.Blocks) (table notionapi.TableBlock, err error)
- func GetTerminalBlock(children notionapi.Blocks, termId notionapi.BlockID) (terminal notionapi.CodeBlock, err error)
- func GetTerminalLastRichText(termCode notionapi.CodeBlock) (terminal string, err error)
- func LaunchNotiontermServer(config *Config, isServer bool, play chan struct{}, pause chan struct{}) (stopServer chan bool)
- func LaunchUrlWaitingServer(config *Config) (pageid string)
- func NotiontermRun(config *Config, play chan struct{}, pause chan struct{})
- func RequestButtonBlock(client *notionapi.Client, pageid string, buttonId notionapi.BlockID) (button notionapi.EmbedBlock, err error)
- func RequestHeadingCaptionBlock(client *notionapi.Client, pageid string, headingID notionapi.BlockID) (button notionapi.Heading3Block, err error)
- func RequestTerminalBlock(client *notionapi.Client, pageId string, termId notionapi.BlockID) (terminal notionapi.CodeBlock, err error)
- func UpdateButtonUrl(client *notionapi.Client, buttonID notionapi.BlockID, url string) (notionapi.Block, error)
- func UpdateCaptionById(client *notionapi.Client, pageID string, captionBlock CaptionBlock, ...) (notionapi.Block, error)
- func UpdateCodeContent(client *notionapi.Client, codeBlockID notionapi.BlockID, content string) (notionapi.Block, error)
- func WaitPageIDHandler(config *Config, urlCh chan string) http.Handler
- type CaptionBlock
- type Config
Constants ¶
const CONFIGURATION string = "C O N F I G U R A T I O N"
const PORT = "Port"
const SHELL = "Shell"
const TARGET = "Target"
const TERMINAL string = "T E R M I N A L"
Variables ¶
This section is empty.
Functions ¶
func ActivateNotionTerm ¶
ActivateNotionTerm: endpoint to activate notionterm
func AddRichText ¶
func AddRichText(client *notionapi.Client, codeBlock notionapi.CodeBlock, content string) (notionapi.Block, error)
AddRichText: Add rich text in code
func AddTermLine ¶
AddTermLine: Add rich text with a new line and "$"
func AppendCodeBlock ¶ added in v1.0.0
func AppendCodeBlock(client *notionapi.Client, pageid string, content string) (resp *notionapi.AppendBlockChildrenResponse, err error)
AppendCodeBlock: Add a code block ("shell") at the end of the page
func AppendEmbedBlock ¶ added in v1.0.0
func AppendEmbedBlock(client *notionapi.Client, pageid string, url string) (resp *notionapi.AppendBlockChildrenResponse, err error)
AppendEmbedBlock: Add a embed block with specified url
func AppendHeadingBlock ¶ added in v1.0.0
func AppendHeadingBlock(client *notionapi.Client, pageid string, content string) (resp *notionapi.AppendBlockChildrenResponse, err error)
AppendEmbedBlock: Add a embed block with specified url
func CreateButtonBlock ¶ added in v1.0.0
CreateButtonBlock: create embed block with url button
func CreateHeadingCaptionBlock ¶ added in v1.0.0
func CreateTerminalBlock ¶ added in v1.0.0
CreateTerminalBlock: create the block code simulating a terminal
func DeactivateNotionTerm ¶
DeactivateNotionTerm: endpoint to deactivate notionterm
func DeleteEmbed ¶ added in v1.0.0
DeleteEmbed: find the last embed/bookmark block of a page and delete it
func ExecAndPrint ¶
ExecAndPrint: execute command and print the result in code block
func GetButtonBlock ¶
func GetButtonBlock(children notionapi.Blocks, buttonId notionapi.BlockID) (button notionapi.EmbedBlock, err error)
GetButtonBlock: retrieve "button" block (embed blocks)
func GetHeadingCaptionBlock ¶ added in v1.0.0
func GetHeadingCaptionBlock(children notionapi.Blocks, headingID notionapi.BlockID) (headingCaption notionapi.Heading3Block, err error)
GetHeadingCaptionBlock: retrieve heading3 block by id.
func GetTableBlock ¶
func GetTableBlock(children notionapi.Blocks) (table notionapi.TableBlock, err error)
GetTableBlock: retrieve table block
func GetTerminalBlock ¶
func GetTerminalBlock(children notionapi.Blocks, termId notionapi.BlockID) (terminal notionapi.CodeBlock, err error)
GetTerminalBlock: retrieve "terminal" block (code blocks)
func GetTerminalLastRichText ¶
GetTerminalLastRichText: Obtain the last RichText
func LaunchNotiontermServer ¶ added in v1.0.0
func LaunchNotiontermServer(config *Config, isServer bool, play chan struct{}, pause chan struct{}) (stopServer chan bool)
LaunchNotiontermServer: Launch server with appropriate endpoint: /button which return a button widget, /activate to activate button , /deactivate for the reverse, and if
func LaunchUrlWaitingServer ¶ added in v1.0.0
LaunchUrlWaitingServer: launch the server waiting for url parameter, kill it when task is finished
func NotiontermRun ¶ added in v1.0.0
func NotiontermRun(config *Config, play chan struct{}, pause chan struct{})
NotionTerm: "Infinite loop" to read the content of terminal code block and execute it if it is a command, then returning stdout
func RequestButtonBlock ¶
func RequestButtonBlock(client *notionapi.Client, pageid string, buttonId notionapi.BlockID) (button notionapi.EmbedBlock, err error)
RequestButtonBlock: retrieve "button" widget (embed block)
func RequestHeadingCaptionBlock ¶ added in v1.0.0
func RequestHeadingCaptionBlock(client *notionapi.Client, pageid string, headingID notionapi.BlockID) (button notionapi.Heading3Block, err error)
RequestButtonBlock: retrieve heading 3 block to store caption/path
func RequestTerminalBlock ¶
func RequestTerminalBlock(client *notionapi.Client, pageId string, termId notionapi.BlockID) (terminal notionapi.CodeBlock, err error)
RequestTerminalBlock: retrieve "terminal" block (code blocks)
func UpdateButtonUrl ¶
func UpdateButtonUrl(client *notionapi.Client, buttonID notionapi.BlockID, url string) (notionapi.Block, error)
UpdateButtonUrl: update url of the button widget
func UpdateCaptionById ¶ added in v1.0.0
func UpdateCaptionById(client *notionapi.Client, pageID string, captionBlock CaptionBlock, caption string) (notionapi.Block, error)
UpdateCaptionID: update caption of captionBlock. For the light mode the "caption block" is a heading3 so we change the content (not the caption)