使用MarkText替代Typora

安装

要求

咱们Windows下使用就在Windows下编译。

  • Node.js >=v14 and yarn
  • Python >=v3.6 for node-gyp
  • C++ compiler and development tools

Windows下的附加需求:

  • Visual Studio 2019(官方推荐)

clone

git clone https://github.com/marktext/marktext.git

开始build

cd marktext 

npm install --global node-gyp@latest

npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}

node-gyp install

yarn install

{% folding 我的报错 %}

报错改变了,是个好兆头。

yarn install v1.22.17
info No lockfile found.
$ node .electron-vue/preinstall.js
[1/4] Resolving packages...
warning element-ui > async-validator > babel-runtime > [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
warning [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
warning unsplash-js > [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning vega-lite > @types/[email protected]: This is a stub types definition. fast-json-stable-stringify provides its own type definitions, so you do not need this installed.
warning vscod[email protected]: This package has been renamed to @vscode/ripgrep, please update to the new name
info There appears to be trouble with your network connection. Retrying...
warning devtron > [email protected]: Support has ended for 9.x series. Upgrade to @latest
warning svg-sprite-loader > svg-baker > micromatch > snapdragon > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
warning svg-sprite-loader > svg-baker > micromatch > snapdragon > source-map-resolve > [email protected]: See https://github.com/lydell/source-map-url#deprecated
warning svg-sprite-loader > svg-baker > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning svg-sprite-loader > svg-baker > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning webpack-hot-middleware > [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
[2/4] Fetching packages...
warning [email protected]: The engine "atom" appears to be invalid.
warning [email protected]: The engine "atom" appears to be invalid.
warning [email protected]: The engine "atom" appears to be invalid.
[3/4] Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "eslint@^7.12.1".
warning " > [email protected]" has incorrect peer dependency "eslint-plugin-promise@^4.2.1 || ^5.0.0".
[4/4] Building fresh packages...
[7/12] ⠠ fontmanager-redux
[2/12] ⠠ @hfelix/spellchecker
[3/12] ⠠ cld
[9/12] ⠠ vscode-ripgrep
error C:\Desktop\build\marktext\node_modules\vscode-ripgrep: Command failed.
Exit code: 1
Command: node ./lib/postinstall.js
Arguments:
Directory: C:\Desktop\build\marktext\node_modules\vscode-ripgrep
Output:
Finding release for v13.0.0-4
GET https://api.github.com/repos/microsoft/ripgrep-prebuilt/releases/tags/v13.0.0-4
Deleting invalid download cache
Downloading ripgrep failed: TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
    at new NodeError (node:internal/errors:371:5)
    at new ClientRequest (node:_http_client:158:11)
    at request (node:https:353:10)
    at Object.get (node:https:387:15)
    at C:\Desktop\build\marktext\node_modules\vscode-ripgrep\lib\download.js:141:15
    at new Promise (<anonymous>)
    at get (C:\Desktop\build\marktext\node_modules\vscode-ripgrep\lib\download.js:135:12)

寄了

{% endfolding %}

这时候就可以请万能的网友编译一份发你,我就是这样做的。

图片上传

这里我使用的依旧是picgo。

安装

yarn global add picgo

配置插件

这样才能上传到我的图床上面去

  • 安装插件

    picgo install lskypro
    

    输出:

    C:\\> picgo install lskypro
    
    added 1 package, and audited 2 packages in 2s
    
    found 0 vulnerabilities
    [PicGo SUCCESS]: 插件安装成功
    
  • 选择插件

    picgo set uploader
    

    找到 lskypro,回车

    输入上传api https://img.chs.pub/api/upload

    输入token

    输出:

    ? Choose a(n) uploader lskypro
    ? 使用LskyPro的图床的API上传网址(如:https://pic.wfblog.net/api/upload) https://img.chs.pub/api/upload
    ? 在图床获取的Token mytoken
    [PicGo SUCCESS]: Configure config successfully!
    

指定上传方式

picgo use uploader

选中lskypro即可

测试

复制文件,粘贴,上传成功!

但是直接剪切板复制是不能上传的,这里建议搭配其他能使剪切板粘贴的图片变成文件的软件使用。