使用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 > core-js@2.6.12: 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 popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
warning unsplash-js > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning vega-lite > @types/fast-json-stable-stringify@2.1.0: This is a stub types definition. fast-json-stable-stringify provides its own type definitions, so you do not need this installed.
warning vscode-ripgrep@1.13.2: 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 > highlight.js@9.18.5: Support has ended for 9.x series. Upgrade to @latest
warning svg-sprite-loader > svg-baker > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning svg-sprite-loader > svg-baker > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning svg-sprite-loader > svg-baker > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning svg-sprite-loader > svg-baker > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning webpack-hot-middleware > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
[2/4] Fetching packages...
warning file-icons@2.1.47: The engine "atom" appears to be invalid.
warning atom-fs@0.2.1: The engine "atom" appears to be invalid.
warning mapped-disposable@1.0.3: The engine "atom" appears to be invalid.
[3/4] Linking dependencies...
warning " > eslint-config-standard@16.0.3" has incorrect peer dependency "eslint@^7.12.1".
warning " > eslint-config-standard@16.0.3" 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即可

测试

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

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