creating-telegraph-pages
Creating Telegraph Pages
Use the bundled scripts/telegraph.py by absolute path. A page is a public external write. An exact request authorizes one page only when final title, content, and any byline/link are explicit; otherwise present those fields for approval before publishing. Account creation is a separate external-state change.
Prepare
- Preserve the user's language and wording unless editing was requested. Reject secrets, private data, and local-only asset links.
- Convert the body to a temporary JSON array of Telegraph nodes. Text may be a string; elements use
tag, optionalattrs, and optionalchildren. - Allow only
a,aside,b,blockquote,br,code,em,figcaption,figure,h3,h4,hr,i,iframe,img,li,ol,p,pre,s,strong,u,ul, orvideo. Attributes are string-valuedhreforsrc. Convert larger Markdown headings toh3/h4and keep encoded content at or below 64 KB. - Record an explicit byline decision along with the final title, links, node structure, and one-page publication scope. Approve either exact author values or no public byline; do not infer omission from missing fields.
Credentials and Account Boundary
Do not preflight, read, or print credentials. Invoke the helper directly; for create-page, it automatically resolves a non-empty TELEGRAPH_ACCESS_TOKEN, then an explicit trusted --token-file, then $XDG_CONFIG_HOME/telegraph/access-token (or ~/.config/telegraph/access-token). Only if the helper reports that no usable credential exists should you request a token or propose account creation. Never place a token in arguments, repository files, captured output, logs, or the response.
Only when no usable token exists, obtain separate approval for account creation, short name, and a new secret-file path. Then run: