Documentation
¶
Overview ¶
Package xmind defines types for XMind content.json and zip I/O.
Index ¶
- Variables
- func CreateNewMap(path string, sheets []Sheet) error
- func DefaultSheetExtensions(structureClass string) json.RawMessage
- func WriteMap(path string, sheets []Sheet) error
- type AttributedTitleItem
- type Boundary
- type Children
- type Extension
- type Marker
- type NoteContent
- type Notes
- type Position
- type Relationship
- type Sheet
- type Summary
- type Topic
- type TopicImage
Constants ¶
This section is empty.
Variables ¶
var DefaultTheme json.RawMessage
DefaultTheme is the standard XMind theme applied to every new sheet. It is sourced from the kitchen-sink fixture (skeletonThemeId db4a5df4…, colorThemeId Rainbow-#000229-MULTI_LINE_COLORS) and matches what the XMind app writes when creating a new map with the default theme.
Functions ¶
func CreateNewMap ¶
CreateNewMap writes a new .xmind zip with content.json, metadata.json, manifest.json, and the standard XMind compatibility content.xml stub.
func DefaultSheetExtensions ¶
func DefaultSheetExtensions(structureClass string) json.RawMessage
DefaultSheetExtensions returns the standard org.xmind.ui.skeleton.structure.style extension block for a new sheet, referencing structureClass as the centralTopic layout.
Types ¶
type AttributedTitleItem ¶
type AttributedTitleItem struct {
Text string `json:"text"`
// contains filtered or unexported fields
}
AttributedTitleItem is one run of text in an attributed (rich-link) topic title. XMind uses this to store the human-readable label for a topic that has an href. Treat as opaque: preserve on round-trip, never write from handler logic.
func (*AttributedTitleItem) MarshalJSON ¶
func (a *AttributedTitleItem) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*AttributedTitleItem) UnmarshalJSON ¶
func (a *AttributedTitleItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Boundary ¶
type Boundary struct {
ID string `json:"id"`
Range string `json:"range"`
Title string `json:"title,omitempty"`
// contains filtered or unexported fields
}
Boundary groups children visually.
func (*Boundary) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Boundary) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Children ¶
type Children struct {
Attached []Topic `json:"attached,omitempty"`
Detached []Topic `json:"detached,omitempty"`
Summary []Topic `json:"summary,omitempty"`
// contains filtered or unexported fields
}
Children holds attached, detached, and summary topics.
func (*Children) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Children) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Extension ¶
type Extension struct {
Provider string `json:"provider"`
Content any `json:"content,omitempty"`
ResourceRefs []string `json:"resourceRefs,omitempty"`
}
Extension is task/audio/math metadata on a topic.
type Marker ¶
type Marker struct {
MarkerID string `json:"markerId"`
// contains filtered or unexported fields
}
Marker is a topic marker reference.
func (*Marker) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Marker) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type NoteContent ¶
type NoteContent struct {
Content string `json:"content"`
}
NoteContent wraps note body.
type Notes ¶
type Notes struct {
Plain *NoteContent `json:"plain,omitempty"`
RealHTML *NoteContent `json:"realHTML,omitempty"`
}
Notes holds plain and HTML note content. Either or both of Plain and RealHTML may be set; omitted keys are not reintroduced on marshal.
type Position ¶
type Position struct {
X float64 `json:"x"`
Y float64 `json:"y"`
// contains filtered or unexported fields
}
Position is used for floating (detached) topics.
func (*Position) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Position) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Relationship ¶
type Relationship struct {
ID string `json:"id"`
End1ID string `json:"end1Id"`
End2ID string `json:"end2Id"`
Title string `json:"title,omitempty"`
ControlPoints map[string]Position `json:"controlPoints,omitempty"`
// contains filtered or unexported fields
}
Relationship connects two topics at sheet level.
func (*Relationship) MarshalJSON ¶
func (r *Relationship) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*Relationship) UnmarshalJSON ¶
func (r *Relationship) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Sheet ¶
type Sheet struct {
ID string `json:"id"`
RevisionID string `json:"revisionId"`
Class string `json:"class"`
Title string `json:"title"`
TopicOverlapping string `json:"topicOverlapping,omitempty"`
RootTopic Topic `json:"rootTopic"`
Relationships []Relationship `json:"relationships,omitempty"`
Extensions json.RawMessage `json:"extensions,omitempty"`
Theme json.RawMessage `json:"theme,omitempty"`
LabelSortOrder string `json:"labelSortOrder,omitempty"`
// contains filtered or unexported fields
}
Sheet is one tab/sheet in a workbook.
func (*Sheet) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Sheet) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Summary ¶
type Summary struct {
ID string `json:"id"`
Range string `json:"range"`
TopicID string `json:"topicId"`
// contains filtered or unexported fields
}
Summary is a range descriptor on a parent topic (Topic.Summaries).
func (*Summary) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Summary) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Topic ¶
type Topic struct {
ID string `json:"id"`
Class string `json:"class,omitempty"`
Title string `json:"title,omitempty"`
TitleUnedited bool `json:"titleUnedited,omitempty"`
// AttributedTitle holds the display-only label shown when the topic has a link href.
// XMind writes this field; we preserve it on round-trip but never generate it ourselves.
AttributedTitle []AttributedTitleItem `json:"attributedTitle,omitempty"`
StructureClass string `json:"structureClass,omitempty"`
Labels []string `json:"labels,omitempty"`
Markers []Marker `json:"markers,omitempty"`
Href string `json:"href,omitempty"`
Image *TopicImage `json:"image,omitempty"`
Notes *Notes `json:"notes,omitempty"`
Children *Children `json:"children,omitempty"`
Boundaries []Boundary `json:"boundaries,omitempty"`
Extensions []Extension `json:"extensions,omitempty"`
Summaries []Summary `json:"summaries,omitempty"`
Position *Position `json:"position,omitempty"`
// contains filtered or unexported fields
}
Topic is a node in the mind map.
func (*Topic) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Topic) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type TopicImage ¶
type TopicImage struct {
Src string `json:"src"`
IsMathJaxImage bool `json:"isMathJaxImage,omitempty"`
// contains filtered or unexported fields
}
TopicImage references embedded image resource.
func (*TopicImage) MarshalJSON ¶
func (im *TopicImage) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*TopicImage) UnmarshalJSON ¶
func (im *TopicImage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.