Documentation
¶
Overview ¶
Package taskwrite creates and reads tracker tasks for a project: what f10 task create and task read do, for the command and the daemon alike.
Index ¶
- func Create(ctx context.Context, warn io.Writer, t *target.Target, n New) (ref.Ref, string, error)
- func DocTitle(id, doc string) string
- func Document(ctx context.Context, t *target.Target, token string, withImages bool) (string, error)
- func GithubAuth(ctx context.Context, t *target.Target) func(*http.Request)
- func LinkBodyAfter(ctx context.Context, t *target.Target, doc string, warn io.Writer) string
- func LinkMentions(ctx context.Context, t *target.Target, body string, warn io.Writer) string
- func LinkWith(ctx context.Context, t *target.Target, scan reflink.Scan, text string, ...) (string, []reflink.Mention)
- func MdLink(id, title, url string) string
- func Read(ctx context.Context, t *target.Target, r ref.Ref) (string, error)
- func RefusedUpFront(t *target.Target) (tasksource.RefusedSource, bool)
- func WithImages(ctx context.Context, doc, dir string, d images.Downloader) string
- type New
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create sends the task to the driver's create, else makes it an issue on the host, and returns it with its url. It is never retried, since a failed write is an unknown outcome.
func Document ¶
Document is the task token names as f10 task read prints it: a bundle's members joined, and with images set the linked images saved locally, so an agent reads files in place of urls that expire. An empty token is the checkout's task.
func GithubAuth ¶
GithubAuth sends the gh token only to GitHub's own hosts over https, where a private repo's attachments sit. It is read once; a failed read leaves the request bare, so its error names the image.
func LinkBodyAfter ¶
LinkBodyAfter turns the body's `After: <id>` line into a link titled with the base task, when its title and url are known.
func LinkMentions ¶ added in v0.68.0
LinkMentions links the first bare mention of each task id in a markdown body that renders links, from the titles f10 already read.
func LinkWith ¶ added in v0.68.0
func LinkWith( ctx context.Context, t *target.Target, scan reflink.Scan, text string, warn io.Writer, ) (string, []reflink.Mention)
LinkWith scans once to find the bare ids and resolves them in one lookup. It scans again to link them, and names each linked id on warn. An id it cannot title stays bare.
func Read ¶
Read is the task's text as f10 renders it, feeding the ledger's task refs so a later ref costs no tracker call.
func RefusedUpFront ¶
func RefusedUpFront(t *target.Target) (tasksource.RefusedSource, bool)
RefusedUpFront is the source that creates nothing in t's project, which answers before anything is read, so capture falls back.
func WithImages ¶
WithImages ends doc with a footer naming its downloaded images. A dir that cannot be written fails every image, never the read.