Skip to content
/ xminder Public
forked from diduweiwu/xminder

Support Xmind8/Zen file parsing; support Xmind8 file generation

License

Notifications You must be signed in to change notification settings

MingGH/xminder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. Project Overview: xminder (Modified Version)

This is an enhanced version of the original repository xminder. In this modified edition, implemented a series of changes to adapt the project to new requirements and a modern technology stack.

Here are the key modifications:

  • Java Version Upgrade: The project now utilizes Java 17, taking advantage of the latest language features and performance improvements.
  • Dependency Upgrades: Other related dependencies within the project have been updated to their latest stable versions. This ensures that the project is using the most recent and reliable libraries.
  • Add Project-Reactor: Project Reactor has been introduced to enable reactive programming capabilities. This addition provides a powerful framework for future project transformations.

概要介绍

  • 支持解析上传的xmind8与xmind zen两种格式的思维导图文件
  • 支持构建并生成xmind思维导图文件(仅限xmind8格式的文档,为了更好的兼容性)

用法

解析

方法1

直接调用 XmindParser.parseFile(String xmindFilePath) 方法,会获得Sheet列表, 每个Sheet对象里面有Children,Title等属性

方法2

新建XmindParser对象并调用parse方法, new XmindParser().parse(filePath),返回值与上述方法一致

PS: parseForJsonContent(String filePath) // 成员方法 parseFileForJsonContent(String filePath) // 静态方法 可以获取解析完成后的Xmind节点Json数据结构,可以拿来实现自定义处理逻辑

创建

使用XmindBuilder方法,用法参考如下示例

// 初始化builder
var builder = XmindBuilder.builder();
// 初始化画布
var sheet = builder.createSheet("哈哈哈");
// 在画布上面创建一个节点,该节点默认为根节点
// PS: 目前限制只能生成根节点
var rootTopic = sheet.createChildNode("哈哈Root");
// 在根节点后面创建第二个子节点,lambda函数里面可以基于子节点继续创建节点
rootTopic.createChildNode("哈哈Root2", secondTopic -> secondTopic.createChildNode("哈哈哈"));
// 在根节点后面再次创建一个子节点
rootTopic.createChildNode("囧囧4");
// xmind文件保存路径,注意使用xmind文件后缀名
var saveFilePath = "/Users/test/Downloads/" + RandomUtil.randomString(8) + ".xmind";
builder.build(saveFilePath);
// 构建完成后,文件就保存在 saveFilePath路径下了

About

Support Xmind8/Zen file parsing; support Xmind8 file generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%