render

package
v2.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiffSame    = "same"
	DiffAdded   = "added"
	DiffRemoved = "removed"
	DiffChanged = "changed"
)

Part states and line ops in a charter's diff.

Variables

This section is empty.

Functions

func Charter

func Charter(ctx context.Context, e *engine.Engine, projectID string, snapshot int) (html, jsonData []byte, err error)

Charter renders a project charter to HTML and JSON for a given snapshot. snapshot=0 means the working copy; snapshot>0 means a specific version. Returns byte slices for HTML and JSON, both deterministic.

func OperationCharter

func OperationCharter(ctx context.Context, e *engine.Engine, id string) ([]byte, error)

OperationCharter renders an operation, a service that keeps running, as its service description (ITIL's service design package, cut to what Cartograph holds): what it does and when, who runs it, what it is part of, how it is measured, what it uses and produces, and which projects are changing it.

The last section is the one no other view shows. A project names the operation it lands in (TAXONOMY.md D17); read back here, it tells the people who run a service what is about to be handed to them.

func PartsCSS added in v2.11.0

func PartsCSS() string

PartsCSS is the styling of what a charter's sections hold (chips, the components diagram, the schedule chart, the iron triangle), for an interface drawing the charter as parts in a page of its own, where the charter's page styles do not belong (#77). It reads the charter's colour variables: --fg, --muted, --line, --soft, --paper, --accent, --accent-soft, --ok, --warn, --bad and --sans.

func ProgrammeCharter

func ProgrammeCharter(ctx context.Context, e *engine.Engine, id string) ([]byte, error)

ProgrammeCharter renders a programme as the document its definition adds up to: what it is for, what is wrong, what it serves, how it believes the change happens (its theory of change), what is inside it, and who runs it. The same five-part skeleton a project's charter uses, with a programme's own sections (MSP programme brief, PMI program charter).

Read-only and derived, like every other view: nothing is stored, so there is nothing to keep in step.

Types

type DiffLine added in v2.11.0

type DiffLine struct {
	Op   string `json:"op"`
	Text string `json:"text"`
}

DiffLine is one line of a part's text: same, added or removed.

type Part added in v2.11.0

type Part struct {
	Title string `json:"title"`
	// Step is the step of the project's walk the section is written in.
	Step string `json:"step,omitempty"`
	// Anchor is the section's id in the HTML, "" for an empty part.
	Anchor string `json:"anchor,omitempty"`
	// HTML is what the renderer wrote under the heading, escaped as the
	// charter is.
	HTML string `json:"html"`
	// Fields are the JSON pointers of the fields written in it as typed,
	// each editable in place.
	Fields []string `json:"fields"`
	Empty  bool     `json:"empty"`
	// contains filtered or unexported fields
}

Part is one section of a charter.

func CharterParts added in v2.11.0

func CharterParts(ctx context.Context, e *engine.Engine, projectID string) ([]Part, error)

CharterParts is a project's charter as its parts, as ctx reads it.

type PartDiff added in v2.11.0

type PartDiff struct {
	Title string `json:"title"`
	Step  string `json:"step,omitempty"`
	// State is same, added, removed or changed.
	State string     `json:"state"`
	Lines []DiffLine `json:"lines"`
}

PartDiff is one part of a charter against the record.

func CharterDiff added in v2.11.0

func CharterDiff(record, changed context.Context, e *engine.Engine, id string) ([]PartDiff, error)

CharterDiff is project id's charter as the change set on changed reads it, against the record on record. A project new in the change set is added whole.

type WorkItem added in v2.9.0

type WorkItem struct {
	Code        string `json:"code"`
	Deliverable string `json:"deliverable"`
	Task        string `json:"task,omitempty"`
	Name        string `json:"name"`
	Role        string `json:"role,omitempty"`
	Note        string `json:"note,omitempty"`
}

WorkItem is one line of a project's work breakdown: a deliverable (D2) or one task under it (D2.1).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL