Skip to content

Open and write iThoughts .itmz maps - #6

Open
Martin-PB wants to merge 7 commits into
mainfrom
mp-ithoughts-itmz
Open

Martin-PB wants to merge 7 commits into
mainfrom
mp-ithoughts-itmz

Conversation

@Martin-PB

@Martin-PB Martin-PB commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Intention

Couvrir un format de plus du programme « tous les formats de mind map » : ouvrir et écrire les cartes iThoughts .itmz (iThoughts / iThoughtsX de toketaWare), dans la continuité de FreeMind (#1), MindManager (#3), WiseMapping (#4) et Mindomo (#5).

Réalisation

  • src/ithoughts.ts (nouveau) : lecteur/écrivain .itmz — un zip tenant un mapdata.xml. Lecture : <topic> imbriqués (dans un wrapper <topics> comme iThoughts les écrit, ou directement dans <iThoughts> comme l'exportateur de MultiMarkdown les écrit), ordre des frères = ordre du fichier, titres multi-lignes (échappements numériques &#10;), notes (note), feuilles auto-fermées ; un topic au niveau supérieur en dehors de la racine de la carte ouvre comme sa propre sheet. Refus stricts : pas un zip (vieux .itm d'iThoughtsHD non lu), zip sans mapdata.xml, racine XML inattendue, aucun topic. Écriture : une carte par sheet (sheets supplémentaires = topics racines que iThoughts peut ne pas montrer) — chaque topic avec un uuid frais, échappements d'attributs (&amp; &lt; &gt; &quot; &apos; &#10; &#13; &#9;), feuille auto-fermée. Pertes documentées : couleurs, icônes, images, hyperliens, infos de tâche, pliage, sujets flottants, noms de sheets.
  • src/ithoughts.test.ts (nouveau) : 4 tests vitest (carte avec wrapper <topics>, multi-lignes et note ; forme sans wrapper ; refus stricts ; aller-retour avec vérification du XML écrit).
  • src/files.ts : branches itmz de docBytes/parseDoc, "itmz" dans les filtres Open, { name: "iThoughts (.itmz)" } dans Save as. src/files.test.ts : aller-retour plan.itmz. src/App.tsx : entrée « iThoughts (.itmz) » dans le menu d'export. README.md : paragraphe iThoughts, mentions dans Outline formats et Safety rule.

Ce que l'agent a fait

Recherche du format : documentation de l'éditeur (toketaWare décrit le .itmz comme « relativement ouvert » — un zip tenant un XML), gist de référence de la communauté iThoughts (structure <iThoughts version="4.0"> → <topics> → <topic>, attributs text/note/uuid/position…, B. Terpstra, 2026), et le couple lecteur/écrivain ITMZ de MultiMarkdown 6/7 (F. Penney, MIT) — les trois sources concordent. Module et tests écrits puis validés dans un jumeau exécutable sandbox : 23 contrôles verts (les deux formes de document, les 4 refus, l'aller-retour avec vérification du XML produit, racine <topics> nue). Push en un commit unique 65c8ee6d (trailers Agent: Vibe (Mistral, glm-5-latest-short) / Relu-par-humain: Martin-PB), puis relecture depuis GitHub : 6 fichiers identiques byte-à-byte, 12 ⌘ dans App.tsx, zéro mojibake.

  • Correctif CI (2026-10-18) : un second commit répare deux échecs de CI — le filtre de relations du lecteur WiseMapping porte désormais une garde de type (le compilateur voyait encore des extrémités potentiellement absentes et refusait le build), et le test gzip FreeMind compare les deux lectures sans leurs ids frais (correctif déjà présent sur la branche FreeMind).

Vérifications humaines

FreeMind's .mm is the de facto open interchange format for mind maps, so
Cartocortex reads and writes it. Reading is the strict XML parser from the
old .xmind files (no DOCTYPE, predefined entities only), on plain and
gzipped files: texts (richcontent keeps its line order), notes (richcontent
and the old map/Note hook), links, links between topics (arrowlink),
folding, fill and text colour, bold / italic, priority (full-N) and
progress (0%-100%) icons. Left-side top-level topics open as a logic-left
or two-sided map. Writing goes the other way (Save as .mm and a new
"Export FreeMind" button): one root node per sheet, so extra sheets may
not show in FreeMind itself, and structures beyond the sideways layouts,
pictures, relationships, summaries, per-word style and floating positions
are not carried. The xmindxml entity decoder is exported for the reader.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
The first commit of this branch wrote App.tsx and README.md with the
parts it did not mean to change double-encoded: every non-ASCII
character (the command-key shortcut signs, arrows, ellipses) had become
mojibake. Both files are rebuilt from main with the same .mm edits, so
the branch now only changes what the FreeMind support needs.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
MindManager keeps its maps in a zip holding Document.xml (X5 and later;
the Mac builds of MindManager 10 wrote flat XML), and Cartocortex now
reads and writes that. Reading is the strict XML parser from the old
.xmind files (no DOCTYPE, predefined entities only): texts, notes (the
XHTML note and its plain-text preview), links, task priorities (Prio1-9)
and progress (TaskPercentage), fill and text colour ("aarrggbb", alpha
first), folding, relationships (as the map's relationship lines),
floating topics and callouts. The growth direction of the central topic
opens as a logic-left, logic-right or two-sided map. Writing goes the
other way (Save as .mmap and a new "Export MindManager" button): one map
per sheet, so extra sheets may not show in MindManager itself, and topic
links to other topics, pictures, per-word style, boundaries and
summaries are not carried. The unzip of the .xmind reader is exported
for the .mmap reader.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
WiseMapping keeps its maps as plain XML (the current "tango" dialect
and the older "pela" files), and Cartocortex now reads and writes
that. Reading is the strict XML parser from the old .xmind files (no
DOCTYPE, predefined entities only): texts (a single-line attribute or
a multi-line block), notes (the CDATA note and the percent-encoded
attribute of the old files), links, fill and text colours, bold and
italic, shapes (box and line), folding, the map's relationships (as
relationship lines) and its free branches (as floating topics,
positions kept). The side a topic sits on comes from its position, so
a left-leaning map opens as Logic (left) and a two-sided one as a
map. Writing goes the other way (Save as .wxml and a new "Export
WiseMapping" button): the first sheet is the map and the sheets after
it are WiseMapping's free branches, with positions worked out from
the tree shape; markers keep their emoji, but priorities, progress,
pictures, per-word style, boundaries, summaries and topic links are
not carried. The format was taken from WiseMapping's own serializer
and importer, and has not been checked against WiseMapping itself.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
Mindomo Desktop keeps its maps as zips of JSON parts, and Cartocortex
now reads and writes that. Reading walks nodes.json: titles keep
their line breaks, folded topics stay folded, a topic's video or web
address opens as its link, the map's relations open as relationship
lines, and topics the file marks as deleted (and everything under
them) are quietly skipped; the map named in document.json opens as
the first sheet, and any other parentless topic in the file opens as
a sheet of its own. A file that is not a zip is refused, with a note
that the older Mindomo XML is not read. Writing goes the other way
(Save as .mom and a new "Export Mindomo" button): one map per sheet,
with fresh ids, the chain of brothers kept in order and the
relationship lines written back. Notes, colours, markers, priorities,
pictures, per-word style, boundaries and summaries are not carried,
and .pmom files are not read. The format was taken apart from files
saved by Mindomo Desktop 11, and has not been checked against
Mindomo itself.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
iThoughts keeps a map as a zip holding one mapdata.xml, and Cartocortex
now reads and writes that. Reading walks the nested <topic> elements
(wrapped in a <topics> element the way iThoughts writes them, or straight
inside <iThoughts> the way MultiMarkdown writes them): titles keep their
line breaks, notes travel along, and a topic at the top level besides the
map's own opens as its own sheet. A file that is not a zip, or a zip
without mapdata.xml, is refused with a clear error. Writing goes the
other way (Save as .itmz and a new "Export iThoughts" button): one map
per sheet, each topic with a fresh uuid and its note, and a leaf closing
itself the way iThoughts writes one. Colours, icons, images, hyperlinks,
task info, folding, floating topics and sheet names are not carried,
and the old iThoughtsHD .itm files are not read. The format was taken
from what iThoughts writes (as documented by toketaWare and the iThoughts
community) and from MultiMarkdown's own exporter, and has not been
checked against iThoughts itself.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
The reader drops relationships whose ends are missing, but the type
checker still saw both ends as possibly undefined and refused the
build; the filter now carries a type guard saying what it keeps. The
FreeMind gzip test also compares the two reads without their fresh
ids, the same fix the FreeMind branch already carries.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant