DesktopNaotu Documentation

桌面版脑图 (百度脑图离线版,思维导图) 跨平台支持 Windows/Linux/Mac OS. (A cross-platform multilingual Mind Map Tool)

5,091 stars TypeScript TypeScript 7 files · ~12,051 tokens #desktop-app#inaotu#mind#mindmap#naotu
RAW Doc

File: README.md

[Binary file]


File: bower.json

{
"name": "desktopnaotu",
"description": "桌面版脑图",
"main": "main.js",
"authors": [
"'Jack' <'[email protected]'>"
],
"license": "MIT",
"keywords": [
"mind",
"naotu"
],
"homepage": "https://github.com/NaoTu/DesktopNaotu",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {
"seajs": "^3.0.0",
"bootbox.js": "bootbox#^4.4.0"
},
"dependencies": {
"kity": "^2.0.5",
"marked": "0.6.2",
"kityminder-editor": "git://github.com/NaoTu/kityminder-editor#master",
"bootbox.js": "bootbox#^4.4.0",
"kityminder-core": "git://github.com/NaoTu/kityminder-core.git#dev"
},
"overrides": {
"jquery": {
"main": [
"dist/jquery.min.js"
]
},
"angular": {
"main": [
"angular.min.js"
]
},
"codemirror": {
"main": [
"lib/codemirror.js",
"lib/codemirror.css",
"mode/xml/xml.js",
"mode/javascript/javascript.js",
"mode/css/css.js",
"mode/htmlmixed/htmlmixed.js",
"mode/markdown/markdown.js",
"addon/mode/overlay.js",
"mode/gfm/gfm.js"
]
},
"bootstrap": {
"main": [
"dist/css/bootstrap.css"
]
},
"color-picker": {
"main": [
"dist/color-picker.css",
"dist/color-picker.js"
]
},
"seajs": {
"main": []
}
},
"resolutions": {
"angular": "~1.4.7",
"marked": "0.6.2",
"seajs": "^3.0.0"
}
}


File: config.json

{
"executableName": "桌面版脑图",
"dest": "../installers/",
"icon": "./app/static/favicon.png",
"categories": [
"Utility"
],
"lintianOverrides": [
"changelog-file-missing-in-native-package"
]
}


File: package.json

{
"name": "desktopnaotu",
"version": "3.2.3",
"description": "桌面版脑图",
"main": "dist/main.js",
"scripts": {
"start": "gulp default",
"demo": "electron .",
"packwin32": "cross-var electron-packager ./ DesktopNaotu --asar --platform=win32 --arch=ia32 --out=../OutApp --icon=app/static/favicon.ico --electron-version=3.1.13 --app-version=$npm_package_version --ignore="(.git|screenshot|doc|src|app|bower_components|electron-packager)" --overwrite --prune",
"packwin32dev": "cross-var electron-packager ./ DesktopNaotu --platform=win32 --arch=ia32 --out=../OutApp --icon=app/static/favicon.ico --electron-version=3.1.13 --app-version=$npm_package_version --ignore="(.git|screenshot|doc|bower_components|electron-packager)" --overwrite --prune",
"packwin64": "cross-var electron-packager ./ DesktopNaotu --asar --platform=win32 --arch=x64 --out=../OutApp --icon=app/static/favicon.ico --electron-version=3.1.13 --app-version=$npm_package_version --ignore="(.git|screenshot|doc|src|app|bower_components|electron-packager)" --overwrite --prune",
"packwin64dev": "cross-var electron-packager ./ DesktopNaotu --platform=win32 --arch=x64 --out=../OutApp --icon=app/static/favicon.ico --electron-version=3.1.13 --app-version=$npm_package_version --ignore="(.git|screenshot|doc|bower_components|electron-packager)" --overwrite --prune",
"packmacos": "cross-var electron-packager ./ DesktopNaotu --asar --platform=darwin --arch=x64 --out=../OutApp --icon=app/static/favicon.icns --electron-version=3.1.13 --app-version=$npm_package_version --ignore="(.git|screenshot|doc|src|app|bower_components|electron-packager)" --overwrite --prune",
"packlinux": "cross-var electron-packager ./ DesktopNaotu --asar --platform=linux --arch=x64 --out=../OutApp --icon=app/static/favicon.png --electron-version=3.1.13 --app-version=$npm_package_version --ignore="(.git|screenshot|doc|src|app|bower_components|electron-packager)" --overwrite --prune",
"packlinuxarm": "cross-var electron-packager ./ desktopnaotu --asar --platform=linux --arch=arm64 --out=../OutApp --icon=app/static/favicon.png --electron-version=3.1.13 --app-version=$npm_package_version --ignore="(.git|screenshot|doc|src|app|bower_components|electron-packager|.electron)" --overwrite --prune",
"deb64": "cross-var electron-installer-debian --src ../OutApp/desktopnaotu-linux-arm64 --dest ../installers/ --arch arm64 --config config.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/NaoTu/DesktopNaotu.git"
},
"keywords": ["mind", "naotu"],
"author": "'Jack' <'[email protected]'>",
"license": "MIT",
"bugs": {
"url": "https://github.com/NaoTu/DesktopNaotu/issues"
},
"homepage": "https://github.com/NaoTu/DesktopNaotu#readme",
"devDependencies": {
"@babel/core": "^7.4.3",
"@types/byline": "^4.2.31",
"@types/ejs": "^3.0.5",
"@types/node": "^12.20.4",
"browserify": "^16.2.3",
"cross-var": "^1.1.0",
"del": "^3.0.0",
"electron-installer-debian": "^3.1.0",
"electron-packager": "^12.2.0",
"grunt": "^1.0.4",
"grunt-electron-installer": "^2.1.0",
"gulp": "^3.9.1",
"gulp-cache": "^1.0.2",
"gulp-clean-css": "^3.10.0",
"gulp-concat": "^2.6.1",
"gulp-connect": "^5.6.1",
"gulp-filter": "^5.1.0",
"gulp-jshint": "^2.1.0",
"gulp-livereload": "^4.0.0",
"gulp-minify-css": "^1.2.4",
"gulp-notify": "^3.2.0",
"gulp-tsc": "^1.3.2",
"gulp-uglify": "^3.0.1",
"js-beautify": "^1.9.1",
"jshint": "^2.10.2",
"run-sequence": "^2.2.1",
"tsify": "^4.0.1",
"typescript": "^3.4.4",
"vinyl-source-stream": "^2.0.0"
},
"dependencies": {
"ejs": "^3.1.5",
"electron": "^11.2.1",
"hotkeys-js": "^3.6.2",
"moment": "^2.23.0",
"winston": "^3.1.0"
}
}


File: tsconfig.json

{
"compilerOptions": {
/* Basic Options /
"target": "ES3" /
Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. /,
"module": "commonjs" /
Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. /,
"lib": [
"es2016",
"dom"
] /
Specify library files to be included in the compilation. /,
// "allowJs": true, /
Allow javascript files to be compiled. /
// "checkJs": true, /
Report errors in .js files. /
// "jsx": "preserve", /
Specify JSX code generation: 'preserve', 'react-native', or 'react'. /
// "declaration": true, /
Generates corresponding '.d.ts' file. /
// "declarationMap": true, /
Generates a sourcemap for each corresponding '.d.ts' file. /
"sourceMap": true /
Generates corresponding '.map' file. /,
// "outFile": "main.js" /
Concatenate and emit output to single file. /,
"outDir": "./dist" /
Redirect output structure to the directory. /,
// "rootDir": "./", /
Specify the root directory of input files. Use to control the output directory structure with --outDir. /
// "composite": true, /
Enable project compilation /
// "removeComments": true, /
Do not emit comments to output. /
// "noEmit": true, /
Do not emit outputs. /
// "importHelpers": true, /
Import emit helpers from 'tslib'. /
// "downlevelIteration": true, /
Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. /
// "isolatedModules": true, /
Transpile each file as a separate module (similar to 'ts.transpileModule'). */

text
/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true,              /* Enable strict null checks. */
// "strictFunctionTypes": true,           /* Enable strict checking of function types. */
// "strictBindCallApply": true,           /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */

/* Additional Checks */
// "noUnusedLocals": true,                /* Report errors on unused locals. */
// "noUnusedParameters": true,            /* Report errors on unused parameters. */
// "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */

/* Module Resolution Options */
// "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */
// "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [],                       /* List of folders to include type definitions from. */
// "types": [],                           /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true,  /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
// "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */

/* Source Map Options */
// "sourceRoot": "",                      /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "",                         /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */

/* Experimental Options */
// "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */

},
"include": ["app/**/*.ts"]
}


File: doc/CompileLog.md

AnClark的编译探索过程

系统环境

  • Node.js:
    • Windows下:v14.13.1
    • Arch Linux下,NVM切换:9.0.0/12(LTS版)/14.13
  • NPM: v6.14.8

第一次尝试

最初的编译步骤

  1. 克隆源码后,cnpm install、bower install安装所有依赖
  2. npm run start开始编译
  3. 新版本Node.js下我手动更新了graceful-fs到@^4.2,否则报错。在9.0版本Node.js中该组件不存在此问题,可忽略。

配置文件

  • Windows下,根据文档Dev.md一路安装各种组件。走弯路了。。。
  • Arch Linux下重来,没有修改package.json。直接npm install安装全部依赖,不再逐一安装。

最终两系统都出现了同样的编译错误。

结果卡在这地方。。。

log
[08:48:33] Using gulpfile D:\WUDownloadCachee\DesktopNaotu\gulpfile.js
[08:48:33] Starting 'default'...
[08:48:33] Starting 'clean-dist'...
[08:48:33] Finished 'clean-dist' after 60 ms
[08:48:33] Starting 'build-version'...
version -> 3.2.3.525
[08:48:33] Finished 'build-version' after 44 ms
[08:48:33] Starting 'compile'...
[08:48:33] Compiling TypeScript files using tsc version 3.9.7
[08:48:39] [tsc] > app/src/core/exec.ts(18,32): error TS2769: No overload matches this call.
[08:48:39] [tsc] >   The last overload gave the following error.
[08:48:39] [tsc] >     Argument of type '{ encoding: string; }' is not assignable to parameter of type 'BaseEncodingOptions & ExecOptions'.
[08:48:39] [tsc] >       Type '{ encoding: string; }' is not assignable to type 'BaseEncodingOptions'.
[08:48:39] [tsc] >         Types of property 'encoding' are incompatible.
[08:48:39] [tsc] >           Type 'string' is not assignable to type 'BufferEncoding'.
[08:48:39] [tsc] > app/src/lib/dialog.ts(23,9): error TS2345: Argument of type '{ filters: { name: string; extensions: string[]; }[]; }' is not assignable to parameter of type 'BrowserWindow'.
[08:48:39] [tsc] >   Object literal may only specify known properties, and 'filters' does not exist in type 'BrowserWindow'.
[08:48:39] [tsc] > app/src/lib/dialog.ts(76,7): error TS2345: Argument of type '{ title: string; defaultPath: string; filters: { name: string; extensions: string[]; 
}[]; }' is not assignable to parameter of type 'BrowserWindow'.
[08:48:39] [tsc] >   Object literal may only specify known properties, and 'defaultPath' does not exist in type 'BrowserWindow'.
[08:48:39] [tsc] > app/src/lib/dialog.ts(97,9): error TS2345: Argument of type '{ properties: string[]; defaultPath: string; }' is not assignable to parameter of type 'BrowserWindow'.
[08:48:39] [tsc] >   Object literal may only specify known properties, and 'properties' does not exist in type 'BrowserWindow'.
[08:48:39] [tsc] > app/src/lib/dialog.ts(142,7): error TS2345: Argument of type '{ title: string; defaultPath: string; filters: any[]; }' is not assignable to parameter of type 'BrowserWindow'.
[08:48:39] [tsc] >   Object literal may only specify known properties, and 'defaultPath' does not exist in type 'BrowserWindow'.
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(1674,31): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(3079,31): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(3519,25): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(3696,26): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(4249,30): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(4645,33): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(5233,36): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(5241,33): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(5579,30): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(6474,32): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(6515,25): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7646,37): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7658,31): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7668,31): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7681,33): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7693,34): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7709,42): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7722,32): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7736,32): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(7857,22): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] [tsc] > node_modules/[email protected]@electron/electron.d.ts(8366,29): error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?
[08:48:39] Failed to compile TypeScript: Error: tsc command has exited with code:2

第二次尝试

前文中出现的这一系列日志,实际上是因为新版本Electron暂不支持@types/node的最新版本(v14):

text
error TS2689: Cannot extend an interface 'NodeJS.EventEmitter'. Did you mean 'implements'?

更换@types/node为12.x版本,即可解决。

bash
cnpm install @types/[email protected]

同时注意保持TypeScript为3.9.x版本(最新的4.x也可),Node.js为9.x(或更新了graceful-fs后的14.x)。

于是,新的编译错误出现了。。。

text
[17:42:21] Using gulpfile D:\WUDownloadCachee\DesktopNaotu\gulpfile.js
[17:42:21] Starting 'default'...
[17:42:21] Starting 'clean-dist'...
[17:42:21] Finished 'clean-dist' after 78 ms
[17:42:21] Starting 'build-version'...
version -> 3.2.3.535
[17:42:21] Finished 'build-version' after 37 ms
[17:42:21] Starting 'compile'...
[17:42:21] Compiling TypeScript files using tsc version 4.0.3
[17:42:28] [tsc] > app/src/lib/dialog.ts(23,9): error TS2345: Argument of type '{ filters: { name: string; extensions: string[]; }[]; }' is not assignable to parameter of type 'BrowserWindow'.
[17:42:28] [tsc] >   Object literal may only specify known properties, and 'filters' does not exist in type 'BrowserWindow'.
[17:42:28] [tsc] > app/src/lib/dialog.ts(76,7): error TS2345: Argument of type '{ title: string; defaultPath: string; filters: { name: string; extensions: string[]; 
}[]; }' is not assignable to parameter of type 'BrowserWindow'.
[17:42:28] [tsc] >   Object literal may only specify known properties, and 'defaultPath' does not exist in type 'BrowserWindow'.
[17:42:28] [tsc] > app/src/lib/dialog.ts(97,9): error TS2345: Argument of type '{ properties: string[]; defaultPath: string; }' is not assignable to parameter of type 'BrowserWindow'.
[17:42:28] [tsc] >   Object literal may only specify known properties, and 'properties' does not exist in type 'BrowserWindow'.
[17:42:28] [tsc] > app/src/lib/dialog.ts(142,7): error TS2345: Argument of type '{ title: string; defaultPath: string; filters: any[]; }' is not assignable to parameter of type 'BrowserWindow'.
[17:42:28] [tsc] >   Object literal may only specify known properties, and 'defaultPath' does not exist in type 'BrowserWindow'.
[17:42:28] Failed to compile TypeScript: Error: tsc command has exited with code:2

最后一弹。。刚刚猛然发现

思来想去,还是参考下最新版release。用asar解开release安装目录的resources/app.asar,阅读package.json,发现用了以下版本的库:

json
...
"devDependencies": {
    "@babel/core": "^7.1.2",
    "@types/byline": "^4.2.31",
    "browserify": "^16.2.3",
    "del": "^3.0.0",
    "electron": "^3.0.11",
    "electron-packager": "^12.2.0",
    "electron-prebuilt": "^1.4.13",
    "grunt": "^1.0.3",
    "grunt-electron-installer": "^2.1.0",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^6.0.0",
    "gulp-babel": "^8.0.0",
    "gulp-cache": "^1.0.2",
    "gulp-clean-css": "^3.10.0",
    "gulp-concat": "^2.6.1",
    "gulp-connect": "^5.6.1",
    "gulp-filter": "^5.1.0",
    "gulp-imagemin": "^4.1.0",
    "gulp-jshint": "^2.1.0",
    "gulp-livereload": "^4.0.0",
    "gulp-main-bower-files": "^1.6.3",
    "gulp-minify-css": "^1.2.4",
    "gulp-notify": "^3.2.0",
    "gulp-obfuscate": "^0.2.9",
    "gulp-rename": "^1.4.0",
    "gulp-ruby-sass": "^3.0.0",
    "gulp-tsc": "^1.3.2",
    "gulp-uglify": "^3.0.1",
    "js-beautify": "^1.8.6",
    "jshint": "^2.9.6",
    "run-sequence": "^2.2.1",
    "tsify": "^4.0.1",
    "typescript": "^3.2.2",
    "vinyl-source-stream": "^2.0.0",
    "wiredep": "^4.0.0"
  },
  "dependencies": {
    "hotkeys-js": "^3.3.8",
    "moment": "^2.23.0",
    "winston": "^3.1.0"
  }
...

其中Electron居然是3.x的版本。安装这个版本试试看,保持其他依赖不变:

text
cnpm install [email protected]
gulp

果然顺利编译!

最后运行测试。再在工程package.json中添加一行:

diff
@@ -5,6 +5,7 @@
   "main": "dist/main.js",
   "scripts": {
     "start": "gulp default",
+    "demo": "electron .",
     "packwin32": "cross-var electron-packager ./ DesktopNaotu --asar --platform=win32 --arch=ia32 --out=../OutApp --icon=app/static/favicon.ico --electron-version=3.0.10 --app-version=$npm_package_version --ignore=\"(.git|screenshot|doc|src|app|bower_components|electron-packager)\" --overwrite --prune",
     "packwin32dev": "cross-var electron-packager ./ DesktopNaotu --platform=win32 --arch=ia32 --out=../OutApp --icon=app/static/favicon.ico --electron-version=3.0.10 --app-version=$npm_package_version --ignore=\"(.git|screenshot|doc|bower_components|electron-packager)\" --overwrite --prune",
     "packwin64": "cross-var electron-packager ./ DesktopNaotu --asar --platform=win32 --arch=x64 --out=../OutApp --icon=app/static/favicon.ico --electron-version=3.0.10 --app-version=$npm_package_version --ignore=\"(.git|screenshot|doc|src|app|bower_components|electron-packager)\" --overwrite --prune",

然后

text
npm run demo

成功运行了起来!


关于打包速度慢的问题

使用npm run packwin64进行打包时,发现打包速度非常慢,起码要等几个小时。CMD下设置环境变量DEBUG(set DEBUG=*)时,可看到electron-packager在不断遍历node_modules文件夹。

后来参考了这篇问答里苹果小萝卜的解决办法,才得知使用cnpm安装软件包是问题所在。它属于扁平化安装,会把所有依赖全部展开到node_modules文件夹中,这样赢得了速度,却导致文件夹下有超过1,800个项目,怪不得要遍历那么久。

于是删掉node_modules文件夹,用npm再重新安装。由于npm采用树形结构处理依赖,最终node_modules非常简洁,只有723个项目。打包速度快了不少。


可适用的编译教程

软件版本

  • Node.js: v9.x、 v12.x LTS、 v14.x
    • v10.x在运行gulp-tsc时会提示语法错误,不选。
    • 建议v9.x。模块graceful-js不兼容高版本的Node.js,但你可以手动更新。
  • TypeScript: v3.9.x、v4.0.x

1. 安装所有依赖

bash
# 自动安装依赖
npm install
bower install

# 安装编译工具 Gulp
npm install -g gulp

2. 更换graceful-fs版本(对于Node `v10.x`及以上版本)

bash
npm install graceful-fs

# 如果仍出现"ReferenceError: primordials is not defined" 的错误,
# 则删掉旧版本
rm -rf node_modules/[email protected]@graceful-fs

# 如果某个子模块依赖旧版本graceful-fs,则请根据报错信息,
# 切换到该模块目录下更新。
cd node_modules/<PATH_TO_MODULE_USING_DEPRECATED_GRACEFUL_FS>
npm install [email protected]


cd node_modules/vinyl-fs
yarn add [email protected]
cd ../../

cd node_modules/gulp-tsc
yarn add [email protected]
cd ../../

cd node_modules/gulp-tsc/node_modules/vinyl-fs
yarn add [email protected]
cd ../../../../

3. 更换`@types/node`版本

bash
npm install @types/[email protected]

4. 开始编译

bash
gulp

5. 测试运行

bash
npm run demo

File: doc/Dev.md

开发日志

开发环境

VSCode

electron 用于对node程序进行打包。

text
npm install electron --save-dev
npm install electron-prebuilt --save-dev
npm install grunt-electron-installer --save-dev
npm install kityminder-core --save
  • grunt-electron-installer 用于Windows平台的自动升级

bower解决了前端库及其依赖安装的问题。

bower
bower init

bower install kityminder-editor --save

bower 升级

bower
bower update kityminder-editor
bower update kityminder-core

gulp 是前端项目构建工具,用来压缩js和css代码,甚至压缩图片。[相关介绍](http://markpop.github.io/2014/09/17/Gulp入门教程)

创建 gulpfile.js 文件

text
npm install gulp --save-dev

npm install gulp-ruby-sass gulp-autoprefixer gulp-clean-css gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
npm install --save-dev run-sequence
npm install --save-dev gulp-connect
npm install --save-dev js-beautify
  • LiveReload 当文件修改时自动刷新页面
  • gulp.watch 监听文件的是否修改以便执行相应的任务
  • gulp-connect web服务器
  • gulp-atom-electron

使用 wiredep 把依赖的文件引入到html文件中。[相关介绍](http://www.tuicool.com/articles/2qQbMnN)

创建 .bowerrc 文件,并且修改 bower.json 中的 overrides 节点进行重新引用。

text
npm install wiredep --save-dev

jshint 是Javascript代码验证工具,这种工具可以检查你的代码并提供相关的代码改进意见。

text
npm install -g jshint
npm install --save-dev jshint

问题解决

解决 electron 与 jquery 的冲突

-- 安装编译工具
cnpm install gulp-main-bower-files --save-dev
cnpm install gulp-filter --save-dev

-- 自动更新
安装electron-squirrel-startup:
cnpm install electron-squirrel-startup

安装grunt-electron-installer:
cnpm install grunt-cli
cnpm install grunt grunt-electron-installer --save-dev

升级
npm install npm

-- 文件夹创建
https://nodejs.org/api/fs.html#fs_fs_exists_path_callback

-- electron 有专门的userData
https://segmentfault.com/q/1010000006187286?_ea=1042220

mac 编译
/Users/apple/.npm-global/lib/node_modules/electron-packager/cli.js ./ DesktopNaotu --platform=darwin --arch=x64 --out=../OutApp --icon=favicon.icns --app-version=1.6.15 --ignore="(.git|node_modules|screenshot|doc|src|bower_components|electron-packager)" --overwrite --prune

加入msg插件

bower install bootbox --save

添加本地 git tag v1.0.1
查看 git tag
推送到远程 git push origin --tags

修改远程仓库的地址
git remote rm origin
git remote add origin https://github.com/NaoTu/DesktopNaotu.git

新的版本号规则:
Major_Version_Number.Minor_Version_Number.Year.Build_Number

重新梳理依赖关系

npm uninstall jshint --save
npm uninstall kityminder-core --save
npm uninstall npm --save

npm install jshint --save-dev
npm install kityminder-core --save-dev
npm install log4js --save-dev

npm install gulp-babel --save-dev
npm install @babel/core --save-dev

新增日志的依赖包

npm install log4js --save
npm uninstall debug --save

依赖检查

npm install dependency-check -g

删除了多余的代码

发布文件 app 目录需要压缩为 app.asar 不应该出现代码文件

安装 asar

npm install asar

解压缩
在asar文件所在的根目录执行asar extract app.asar ./指令

打包项目
asar pack app/ app.asar

text
// OS X
electron/Electron.app/Contents/Resources/
└── app.asar

// Windows & Linux
electron/resources/
└── app.asar

遇到问题 加入 log4js 之后,报错找不到 debug 的模块

经过调试发现,debug 模块的查找路径有问题。

从 .\resources\app\node_modules\log4js\node_modules\debug\dist\debug.js 移动到 .\resources\app\node_modules\debug.js 即可。

另外,依赖 log4js 后,需要用到 node_modules ,所以要把 node_modules 从排除文件列表中移除

python 处理文件移动和打包

安装自定义的包

bower install git://github.com/NaoTu/kityminder-core.git#dev --save

ts dev

npm uninstall fs-extra --save
npm uninstall @types/fs-extra --save-dev
npm uninstall @types/event-kit --save-dev

https://www.cnblogs.com/zqzjs/p/6160205.html

npm install log4js --save

https://74th.github.io/vscode-debug-specs/javascript_electron/

ts debugger

https://www.jianshu.com/p/d906dfaeddc5

高版本有bug,需要指定到这个版本。
npm install typescript --save-dev
npm install gulp-tsc --save-dev


File: doc/Future.md

功能

Future

  • 优化提示效果和内容;
  • 新增自动更新功能;
  • 新增可执行文件的下载;
  • 图片上传的处理;
  • 重构代码变量和方法不污染全局;
  • 加入格式转换;
  • 加入贡献方式;
  • 拖动打开文件高亮窗口;
  • 添加状态栏;
  • 添加 Chrome App 版本
  • 添加保持窗口的大小和位置

Complete

  • 添加导出多种格式;
  • 增加快捷键说明;
  • app中加入更新日志;
  • 加入图片导出;
  • 打开的文件保存时不弹对话框;
  • 添加图标;
  • 加入版本自动生成功能;
  • 新增另存为功能;
  • 加入新建窗口;
  • 添加注册表值,右键菜单可以,选择打开;
  • 加入开发文档;
  • 完善md;
  • 减小可执行文件的尺寸(找文章);
  • 加入新建文件;
  • 添加最近打开记录;

File: doc/Help.md

帮助文档

一、下载所有百度脑图文件

场景:

百度脑图的文件是存放在百度的服务器上的,如果想在本地计算机上保留一份,那么可以用下面的方法进行批量下载。

通过下面的代码来备份,可以保留在线版的目录结构。建议定期备份你的脑图文件到本地。

步骤:

  1. 在谷歌浏览器中,打开在线脑图的列表页 http://naotu.baidu.com/home
  2. 当前,前提是你得先登陆。^_^
  3. 按下F12进入调试模式,切换到Console标签页
  4. 粘贴下面的代码,回车键执行
  5. 等待数秒后,浏览器自动下载压缩文件
javascript
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('7 T=0;6 w(){x(++T==3){1J{6 r(d,e,f){$.1b({C:d,S:"1M",27:Y,20:Y,v:e,w:6(a,b,c){f(a)}})}6 l(a,b){x(b){D.Z(a)}19{D.Z(\'%c\'+a+\'     \',\'1l: C("v:1k/1j+1m;1i,1d+1g+1f+1A+1z+1B+1x==") 1u 1v-1w;\')}}7 g={1t:$("#1q-1r").1s()};6 I(d){18(7 t=y.10();y.10()-t<=d;){}}6 17(a){7 b=F;r("B/1C",$.X(p,{1D:a},g),6(d){b=d.v});I(U.V()*W);12 b}6 13(a){7 b=F;r("B/1E",$.X(p,{1y:a},g),6(d){b=d.v});I(U.V()*W);12 b}6 z(a,b){7 c=17(a);18(7 i=0;i<c.1e;i++){7 d=c[i];x(d.16=="1o"){7 e=b.1p(d.15);z(d.G,e)}19 x(d.16=="14"){7 f=13(d.G);b.14(f.15+f.1Z,f.21)}}}D.1X();l(\'1Y!\',p);7 h=P 22();7 j=F;r("B/28",g,6(d){j=d.v});l(\'24,Q\');z(j.G,h);l(\'1Q!\',p);l(\'1L,Q\');h.1G({S:"1I"}).1N(6(a){l(\'1S!\',p);7 d=P y();7 t=d.1R()+\'R\'+(d.1O()+1)+\'R\'+d.1P();1U(a,j.1T+"1H"+t+".1K");l(\'1V,25!\',p)})}23(E){26(E)}}}6 u(a){$.1b({C:a.1W(),1F:"1n",w:w,E:6(r,s){u(a)}})}u([\'//H.J.L/o.8/A-11-29/o.k.8\',\'//q.K.m/o.8/A-11-29/o.k.8\',\'//1c.N.m/q/O-1-M/??o.8/A-1h-29/o.k.8\']);u([\'//H.J.L/9-n/0.0.2/9-n.k.8\',\'//q.K.m/9-n/0.0.2/9-n.k.8\',\'//1a.N.m/q/O-1-M/9-n/0.0.2/9-n.k.8\']);u([\'//H.J.L/9/3.1.4/9.k.8\',\'//q.K.m/9/3.1.4/9.k.8\',\'//1a.N.m/q/O-1-M/??9/3.1.5/9.k.8\']);',62,134,'||||||function|var|js|jszip|||||||||||min|printf|com|utils|FileSaver|true|cdn||||loadJs|data|success|if|Date|dirSearch|2014|bos|url|console|error|null|file_guid|libs|sleep|cdnjs|bootcss|net||pstatp|expire|new|请稍候|_|type|count|Math|random|1000|extend|false|log|now||return|getFile|file|file_name|file_type|getDir|for|else|s0|ajax|s3|PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjI0cHgiIGhlaWdodD0iMzBweCIgdmlld0JveD0iMCAwIDI0IDMwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MCA1MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgogICAgPHJlY3QgeD0iMCIgeT0iNi43MTczNiIgd2lkdGg9IjQiIGhlaWdodD0iMTcuNTY1MyIgZmlsbD0iIzMzMyI|length|CiAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMzsgNTsgMTMiIGJlZ2luPSIwcyIgZHVyPSIwLjZzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI|CiAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjU7MjE7NSIgYmVnaW49IjBzIiBkdXI9IjAuNnMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU|08|base64|svg|image|background|xml|script|directory|folder|km|csrf|val|csrf_token|right|no|repeat|PC9hbmltYXRlPgogICAgPC9yZWN0PgogIDwvc3ZnPg|fileGuid|PC9hbmltYXRlPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJ5IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTM7IDU7IDEzIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4KICAgIDwvcmVjdD4KICAgIDxyZWN0IHg9IjIwIiB5PSIxMS4yODI2IiB3aWR0aD0iNCIgaGVpZ2h0PSI4LjQzNDcyIiBmaWxsPSIjMzMzIj4KICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iNTsyMTs1IiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI|PC9hbmltYXRlPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0iMTAiIHk9IjcuMjgyNjQiIHdpZHRoPSI0IiBoZWlnaHQ9IjE2LjQzNDciIGZpbGw9IiMzMzMiPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSI1OzIxOzUiIGJlZ2luPSIwLjE1cyIgZHVyPSIwLjZzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI|PC9hbmltYXRlPgogICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJ5IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTM7IDU7IDEzIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI|ls|dirGuid|open|dataType|generateAsync|_0|blob|try|zip|正在打包文件|POST|then|getMonth|getDate|已完成文件加载|getFullYear|已完成文件打包|creater_name|saveAs|恭喜|shift|clear|脑图打包程序启动成功|ext_name|async|content|JSZip|catch|正在加载文件|脑图文件打包下载成功|alert|cache|get_root_dir|'.split('|'),0,{}))

二、如何下载单个百度脑图文件到本地?

方法1:

  • 用 Chrome 或 Firefox 浏览器打开百度脑图页面
  • 按下 F12 打开控制台界面
  • 粘贴下面的代码,按下回车即可下载脑图文件
javascript
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h{l 4(a,b){3 c=6.i(\'r://t.y.z/B/F\',\'a\');f(c){c.g=\'2:5/j,\'+b;c.k=a;3 d=6.m(\'n\');d.o(\'p\',q,1,s,0,0,0,0,0,1,1,1,1,0,u);c.v(d)}}3 2=w.x(7.8.A());3 9=7.8.C().2.5+\'.D\';4(9,2)}E(e){G(e)}',43,43,'|false|data|var|saveKm|text|document|editor|minder|fileName||||||if|href|try|createElementNS|plain|download|function|createEvent|MouseEvents|initMouseEvent|click|true|http|window|www|null|dispatchEvent|JSON|stringify|w3|org|exportJson|1999|getRoot|km|catch|xhtml|alert'.split('|'),0,{}))

方法2:

  • 在浏览器书签栏的空白处,右键“添加网页”输入“脑图下载”,在“网址”文本框中粘贴下面的代码,点击“保存”就可以长期使用了:
javascript
javascript: try{function saveKm(fileName,content){var el=document.createElementNS('http://www.w3.org/1999/xhtml','a');if(el){el.href='data:text/plain,'+content;el.download=fileName;var event=document.createEvent('MouseEvents');event.initMouseEvent('click',true,false,window,0,0,0,0,0,false,false,false,false,0,null);el.dispatchEvent(event)}}var data=JSON.stringify(editor.minder.exportJson());var fileName=editor.minder.getRoot().data.text+'.km';saveKm(fileName,data)}catch(e){alert(e)}; void (0);

三、如何下载 **[ProcessOn](https://www.processon.com/diagrams/new#temp-system)** 上的思维导图呢?

操作方法和下载百度脑图一样。在浏览器中按 F12 并在控制台中粘贴下面的代码即可下载。

javascript
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('W{2 o(e){2 6(b){1 d={4:{7:b.7,9:b.s.v(/<w>/g,\'\\n\')}};f(b.h!=u){d.4.h=b.h}f(b.5==i||b.5.z==0){8 d}1 c=[];b.5.12(2(a){c.t(6(a))});d.5=c;8 d}8{j:6(e)}}2 k(a,b){1 c=l.x(\'y://r.A.B/C/D\',\'a\');f(c){c.E=\'4:9/F,\'+b;c.G=a;1 d=l.H(\'I\');d.J(\'K\',L,3,M,0,0,0,0,0,3,3,3,3,0,i);c.N(d)}}$.O({P:"/Q/R?p="+p,S:\'T\',4:{7:U},V:2(c){1 a=q.X(c.Y);1 b=o(a);1 d=b.j.4.9+\'.Z\';k(d,q.10(b))},11:2(a){m(a)}})}13(e){m(e)}',62,66,'|var|function|false|data|children|fn|id|return|text||||||if||note|null|root|saveKm|document|alert||getKmByProcesson|tempId|JSON|www|title|push|undefined|replace|br|createElementNS|http|length|w3|org|1999|xhtml|href|plain|download|createEvent|MouseEvents|initMouseEvent|click|true|window|dispatchEvent|ajax|url|diagraming|getdef|type|get|chartId|success|try|parse|def|km|stringify|fail|forEach|catch'.split('|'),0,{}))

四、如何在打印的时候,去掉节点前面的“展开或关闭”的小圆圈

  • 1、导出为 svg 格式
  • 2、在 chrome 浏览器打开该 svg 文件
  • 3、按下 F12 打开控制台,切换到 Console 选项卡
  • 4、粘贴下面的代码
javascript
document.querySelectorAll('g[id^="node_expander"]').forEach(n => n.remove());

五、怎么重选默认保存路径

在菜单栏中,点击 文件 下的 重选自动保存的目录 菜单,或按 Ctrl+R 快捷键重选目录。

六、Linux 中如何运行

需要添加运行权限,如下命令

text
sudo chmod a+x DesktopNaotu && ./DesktopNaotu

File: doc/History.md

项目介绍

桌面版脑图 是百度脑图的离线版,帮助你在没有互联网环境的情况下,依然可以使用脑图工具。

各版本对应的系统

操作系统 位数 对应文件 大小 支持情况
MacOS 64位 DesktopNaotu-macOS-x64 < 50M 支持全部功能
Linux 64位 DesktopNaotu-linux-x64 < 50M 支持全部功能
Windows 7/10 64位 DesktopNaotu-win32-x64 < 50M 支持全部功能
Windows 7/10 32位 DesktopNaotu-win32-ia32 < 50M 支持全部功能
Windows XP 32位 DesktopNaotu-Windows-mini < 8M 不支持调试

更新记录

3.2.3 / 2019-04-17

  • 修复 备注中出现超链接打开错误的的问题;

3.2.2 / 2019-02-27

  • 新增 粘贴图片的功能;
  • 修复 部分linux打开空白的问题;

3.2.1-Beta / 2018-12-27

  • 新增 记录内容日志
  • 修复 关闭文件时产生新文件
  • 修复 开启自动保存后,产生新文件
  • 修复 关闭文件时,标题显示不正确

3.2.0-Beta / 2018-12-24

  • 采用新技术(typescript)重构软件以提高稳定性
  • 支持 Mac 版退出程序的标准快捷键Cmd+Q
  • 修复无法切换语言的问题,目前通过配置文件
  • 完善软件的备份功能
  • 加入关闭文件的功能
  • 加入创建副本的功能
  • 新建文档改为正在新窗口打开
  • 允许关闭默认保存功能,下次打开同样生效
  • 修复其他若干问题

3.1.0 / 2018-11-30

  • 新增 窗口新窗口的功能
  • 修复 无法保存的问题
  • 修复 默认打开是英文界面的问题
    • 自动升级配置文件
  • 优化 程序的若干细节

3.0.0 / 2018-11-28

  • 正式支持多语言。鸣谢:涛
    • 初版支持中文简体、中文繁体、英文
    • 软件的语言默认基于系统语言设置,也可以通过修改配置文件来强制改变
  • 修复其他小问题

2.1.1 / 2018-11-22

  • 修复 上传本地图片后无法导出png的问题。
  • 修复 帮助地址出错的问题。
  • 加入 下载百度脑图到本地的介绍。

2.0.2018 / 2018-10-22

  • 新增 恢复图片上传功能。鸣谢:涛
    • 通过 base64 的方式存储到 km 文件中
  • 新增 日志记录功能。
    • 当文件意外关闭或损坏时,有迹可循。
  • 新增 自定义默认保存路径。
    • 加入新菜单 重选自动保存的目录。

1.5.2018 / 2018-10-8

  • 修复 优化高分辨率下的菜单图标的显示。鸣谢:Yuanw、偏执♬
  • 修复 MAC 版复制和粘贴快捷键无法使用 鸣谢:jjeejj
  • 文档的完善。鸣谢:家和
  • 启用新的版本号规则。
  • 新增 DesktopNaotu-Windows 版本,基于 miniblink 的提供的 chrome 精简版内核

1.0.3 / 2018-8-31

  • 修复 导出文件不出现在最近的文件中
  • 修复 另存为时默认采用根节点的文字为文件名称
  • 修复 新建文件弹出的提示从覆盖当前文件改为关闭当前文件
  • 新增 导出默认采用根节点的文字为文件名称

1.0.2 / 2018-8-30

  • 新增 图片双击放大

1.0.1 / 2018-8-14

  • 新增 加入最近打开的文件
  • 新增 打开文件所在文件夹,一般情况下还会选中它。(有用户说不好找文件的位置)
  • 优化 替换系统的提示框,为内部消息提示。
  • 修复 Mac/Linux 标题栏文件名显示为路径的问题

1.0.0 / 2018-5-28

  • 显示当前编辑文件的名称
  • 解决 Windows 下图标锯齿的问题
  • 隐藏上传图片功能
  • 将 kityminder-editor 的依赖,调整到自建分支上(方便更高级的定制)
  • 开启默认保存功能(保存到用户文件夹中)

0.1.7 / 2018-1-25

  • 解决 导出 Freemind 错误的问题
  • 修改 默认取消了自动保存的功能

0.1.6 / 2017-10-31

  • 新增 应用程序的窗口小图标
  • 新增 Linux 任务栏的图标
  • 新增 窗口最大化和最小化(解决 Linux 下无法窗口最大化的问题)
  • 优化 资源加载完成之后再显示程序
  • 解决 macOS 上无法撤销、重做、复制、粘贴

0.1.5 / 2017-10-19

  • 修改打包方式
  • 减小了打包尺寸
  • 大大提高了程序打开效率

0.1.4 / 2017-10-17

  • 修复检查更新的异常
  • kityminder-editor 升级到最新版
  • 加入编辑菜单:剪切、复制、粘贴

0.1.3 / 2017-10-16

  • 自动保存功能可以在菜单中修改,默认自动保存

0.1.2 / 2017-10-9

  • 支持绑定km文件类型,直接打开程序
  • 添加自动保存功能

0.1.1 / 2017-8-10

  • 添加新建功能

0.1.0 / 2016-11-14

  • 支持导出多种格式的文件
  • 版本号自动生成
  • 下载地址取消密码

0.0.2 / 2016-11-11

  • 添加百度在线脑图下载的方法
  • 可执行文件下载的方法
  • 添加另存为方法
  • 添加快捷键说明

0.0.1 / 2016-11-9

  • 实现基本功能

File: doc/README-zh.md

桌面版脑图(DesktopNaotu) [](https://gitter.im/DesktopNaotu/DesktopNaotu) [](https://shang.qq.com/wpa/qunwpa?idkey=cbd6fbc32adbe20c99c005bc559ec45bf3c9bfe581f9226ed14bd0951ae95739)

软件介绍 [--> **English introduction**](../README.md)

桌面版脑图是基于百度脑图的本地化版本,帮助你在没有互联网环境的情况下,依然可以使用脑图工具。

如何下载

各版本对应的系统

操作系统 位数 对应文件 大小 支持情况
MacOS 64位 DesktopNaotu-macOS-x64 < 50M 支持全部功能
Linux 64位 DesktopNaotu-linux-x64 < 50M 支持全部功能
Windows 7/10 64位 DesktopNaotu-win32-x64 < 50M 支持全部功能
Windows 7/10 32位 DesktopNaotu-win32-ia32 < 50M 支持全部功能
Windows XP 32位 DesktopNaotu-Windows-mini < 8M 不支持调试

功能特征

软件截图

  • Windows 截图

  • Mac OS X 截图

  • Linux 截图

联系我们

问题和建议反馈:

捐赠项目

感谢您的慷慨捐赠。

License

Code released under the GPL-2.0 License.


File: locale/de.json

{
"mFile": "&File",
"miNewFile": "&New File",
"miOpenFile": "&Open File...",
"miOpenWindow": "Open a New Window",
"miCloseFile": "Close file(&W)",
"miCloneFile": "Create a copy",
"miOpenFolder": "Open &Folder...",
"miOpenRecent": "Open &Recent",
"miClearRecent": "&Clear Recently Opened",
"miSave": "&Save",
"miSaveAs": "Save &As...",
"miExport": "&Export...",
"miAutoSave": "A&uto Save",
"miSavePath": "Re-select the automatically saved directory(&R)",
"miExit": "E&xit",
"mEdit": "&Edit",
"miUndo": "&Undo",
"miRedo": "&Redo",
"miCut": "Cu&t",
"miCopy": "&Copy",
"miPaste": "&Paste",
"mWindow": "&Window",
"miMaxWin": "Ma&ximize",
"miMinWin": "Mi&nimise",
"mHelp": "&Help",
"miShortcut": "&Keyboard Shortcuts",
"miBackup": "Help document(&V)",
"miCheckVer": "Check for &Updates...",
"miAbout": "&About",
"sMainTopic": "Main Topic",
"sLoadedError": "Failed to load the file! Only support .km format file!",
"sNoFileLocation": "file does not exist",
"sNoUpdatesAvailable": "no updates available.",
"sAppName": "Desktop Naotu",
"sUpdateMessage": "A new version has been detected, please download the new version.",
"sExportKm": "Export .Km",
"sSaveKm": "Save .Km",
"sNoOpenFile": "You have not opened any files yet.",
"sNewKm": "New file will close the current file, continue?",
"sSaveTip": "The current file has not been saved. Please save it and try again.",
"sExitTip": "The current file has not been saved and will continue to exit."
}


File: locale/en.json

{
"cOK": "OK",
"cCancel": "Cancel",
"mFile": "&File",
"miNewFile": "&New File",
"miOpenFile": "&Open File...",
"miOpenWindow": "Open a New Window",
"miCloseFile": "Close file(&W)",
"miCloneFile": "Create a copy",
"miOpenFolder": "Open &Folder...",
"miOpenRecent": "Open &Recent",
"miClearRecent": "&Clear Recently Opened",
"miSave": "&Save",
"miSaveAs": "Save &As...",
"miExport": "&Export...",
"miAutoSave": "A&uto Save",
"miSavePath": "Re-select the automatically saved directory(&R)",
"miExit": "E&xit",
"mEdit": "&Edit",
"miUndo": "&Undo",
"miRedo": "&Redo",
"miCut": "Cu&t",
"miCopy": "&Copy",
"miPaste": "&Paste",
"mCustomize": "Custo&mize",
"miPreferences": "&Preferences",
"mWindow": "&Window",
"miMaxWin": "Ma&ximize",
"miMinWin": "Mi&nimise",
"miToggleDevTools": "Toggle &Developer Tools",
"mHelp": "&Help",
"miShortcut": "&Keyboard Shortcuts",
"miBackup": "Help document(&V)",
"miCheckVer": "Check for &Updates...",
"miAbout": "&About",
"sMainTopic": "Main Topic",
"sLoadedError": "Failed to load the file! Only support .km format file!",
"sNoFileLocation": "file does not exist",
"sNoUpdatesAvailable": "no updates available.",
"sAppName": "Desktop Naotu",
"sUpdateMessage": "A new version has been detected, please download the new version.",
"sExportKm": "Export .Km",
"sSaveKm": "Save .Km",
"sNoOpenFile": "You have not opened any files yet.",
"sNewKm": "New file will close the current file, continue?",
"sNewFileTip": "The current file has not been saved. Create new file anyway?",
"sSaveTip": "The current file has not been saved. Please save it and try again.",
"sExitTip": "The current file has not been saved and will continue to exit.",
"sCloseTip": "The current file has not been saved. Close anyway?",
"dShortcut": "Shortcuts",
"dShortcut_NodeOperation": "Node Operations",
"dShortcut_InsertSiblingNode": "Insert sibling node",
"dShortcut_InsertChildNode": "Insert child node",
"dShortcut_InsertParentNode": "Insert parent node",
"dShortcut_RemoveNode": "Remove node",
"dShortcut_Navigation": "Node Navigation",
"dShortcut_ReorderNodeUpDown": "Move/Reorder up/down",
"dShortcut_ExpandOrCollapse": "Expand/Collapse",
"dShortcut_EditNode": "Editing",
"dShortcut_TextNewline": "Text newline",
"dShortcut_SelectAll": "Select all",
"dShortcut_CopyNode": "Copy node",
"dShortcut_CutNode": "Cut node",
"dShortcut_PasteNode": "Paste node",
"dShortcut_Bold": "Bold",
"dShortcut_Italic": "Italic",
"dShortcut_FindNode": "Find node",
"dShortcut_ScopeControl": "Scope Control",
"dShortcut_Drag": "Drag",
"dShortcut_DragWithMouseRight": "Drag with right mouse button",
"dShortcut_DragScope": "Drag scope",
"dShortcut_Mousewheel": "Mousewheel",
"dShortcut_Touchpad": "Touchpad",
"dShortcut_MoveScope": "Move scope",
"dShortcut_DblClickOnSpace": "Double click on space",
"dShortcut_PlaceRootOnCentral": "Place root node on central",
"dShortcut_ZoomScope": "Zoom in/out",
"dShortcut_Layout": "Layout",
"dShortcut_PutLayoutInOrder": "Put layout in order",
"dShortcut_Regrets": "Regrets",
"dShortcut_Undo": "Undo",
"dShortcut_Redo": "Redo",
"dPreferences": "Preferences",
"dPreferences_Log": "Log",
"dPreferences_Log_Switch": "Log Switch",
"dPreferences_Log_TakeEffect": "Settings will be applied after restart.",
"dPreferences_Log_SaveLogToDisk": "Write log to disk",
"dPreferences_Log_Operations": "Log Operations",
"dPreferences_Log_Cleanup": "Clean Log Files",
"dPreferences_Log_OpenLogDir": "Open Log Dir",
"dPreferences_Log_Info_NotGenerated": "Log files haven't been generated.",
"dPreferences_Log_Info_LogCleanError": "Some log files cannot be removed. Maybe already removed or in use.",
"dPreferences_Log_Info_LogCleaned": "All log files have been removed.",
"dPreferences_Log_Info_NodeJsLimits": "Due to a limitation of Node.js, if you enabled saving log files to disk, they still exist but inaccessible. They will be automatically removed when exiting this program."
}


File: locale/zh_CN.json

{
"cOK": "确定",
"cCancel": "取消",
"mFile": "文件(&F)",
"miNewFile": "新建文件(&N)",
"miOpenFile": "打开文件(&O)...",
"miOpenWindow": "打开新窗口",
"miCloseFile": "关闭文件(&W)",
"miCloneFile": "创建副本",
"miOpenFolder": "打开文件夹(&F)...",
"miOpenRecent": "打开最近的文件(&R)",
"miClearRecent": "清除最近打开记录",
"miSave": "保存(&S)",
"miSaveAs": "另存为(&A)...",
"miExport": "导出(&E)...",
"miAutoSave": "自动保存",
"miSavePath": "重选自动保存的目录(&R)",
"miExit": "退出(&X)",
"mEdit": "编辑(&E)",
"miUndo": "撤销(&U)",
"miRedo": "重做(&R)",
"miCut": "剪切(&T)",
"miCopy": "复制(&C)",
"miPaste": "粘贴(&P)",
"mCustomize": "定制(&M)",
"miPreferences": "偏好设置",
"mWindow": "窗口(&W)",
"miMaxWin": "最大化(&X)",
"miMinWin": "最小化(&N)",
"miToggleDevTools": "切换开发者工具(&D)",
"mHelp": "帮助(&H)",
"miShortcut": "快捷键(&H)...",
"miBackup": "备份百度脑图到本地(&V)",
"miCheckVer": "检查更新...(&N)",
"miAbout": "关于(&A)",
"sMainTopic": "中心主题",
"sLoadedError": "加载文件失败!只允许打开.km格式的文件!",
"sNoFileLocation": "文件路径不存在",
"sNoUpdatesAvailable": "当前没有可用的更新。",
"sAppName": "桌面版脑图",
"sUpdateMessage": "检测到新版本,请下载新版本。",
"sExportKm": "导出 KityMinder 文件",
"sSaveKm": "保存 KityMinder 文件",
"sNoOpenFile": "您当前还未打开任何文件。",
"sNewFileTip": "当前文件尚未保存,是否继续新建文档?",
"sSaveTip": "当前文件尚未保存,请保存后再试?",
"sExitTip": "当前文件尚未保存,是否继续退出?",
"sCloseTip": "当前文件尚未保存,是否继续关闭?",
"dShortcut": "快捷键",
"dShortcut_NodeOperation": "节点操作",
"dShortcut_InsertSiblingNode": "插入兄弟节点",
"dShortcut_InsertChildNode": "插入子结点",
"dShortcut_InsertParentNode": "插入父节点",
"dShortcut_RemoveNode": "删除节点",
"dShortcut_Navigation": "节点导航",
"dShortcut_ReorderNodeUpDown": "向上/向下调整顺序",
"dShortcut_ExpandOrCollapse": "展开/收起节点",
"dShortcut_EditNode": "编辑节点",
"dShortcut_TextNewline": "文本换行",
"dShortcut_SelectAll": "全选节点",
"dShortcut_CopyNode": "复制节点",
"dShortcut_CutNode": "剪切节点",
"dShortcut_PasteNode": "粘贴节点",
"dShortcut_Bold": "加粗",
"dShortcut_Italic": "斜体",
"dShortcut_FindNode": "查找节点",
"dShortcut_ScopeControl": "视野控制",
"dShortcut_Drag": "拖动",
"dShortcut_DragWithMouseRight": "右键拖动",
"dShortcut_DragScope": "拖动视野",
"dShortcut_Mousewheel": "滚轮",
"dShortcut_Touchpad": "触摸板",
"dShortcut_MoveScope": "移动视野",
"dShortcut_DblClickOnSpace": "空白处双击",
"dShortcut_PlaceRootOnCentral": "居中根节点",
"dShortcut_ZoomScope": "放大/缩小视野",
"dShortcut_Layout": "布局",
"dShortcut_PutLayoutInOrder": "整理布局",
"dShortcut_Regrets": "后悔药",
"dShortcut_Undo": "撤销",
"dShortcut_Redo": "重做",
"dPreferences_Log": "日志",
"dPreferences_Log_Switch": "日志记录开关",
"dPreferences_Log_TakeEffect": "设置在重启后生效。",
"dPreferences_Log_SaveLogToDisk": "将日志写入磁盘",
"dPreferences_Log_Operations": "日志操作",
"dPreferences_Log_Cleanup": "清理日志文件",
"dPreferences_Log_OpenLogDir": "打开日志目录",
"dPreferences_Log_Info_NotGenerated": "尚未生成日志文件。",
"dPreferences_Log_Info_LogCleanError": "部分日志文件无法删除,可能是已删除或正在使用中。",
"dPreferences_Log_Info_LogCleaned": "所有日志文件已删除",
"dPreferences_Log_Info_NodeJsLimits": "由于Node.js限制,若已打开日志存盘功能,则此时日志文件仍存在且不可访问,关闭程序时会自动删除。"
}


File: locale/zh_TW.json

[Binary file]