Typora是非常好用的markdown软件。如果想实现导出功能
安装步骤
在Typora-帮助- Install and Pandoc
选择mac对应的安装方法
进入后图片如下,有两种,一种是在github上下载,一种是直接在mac的终端用命令行。
github上不去,我选择用命令行安装。
终端命令行:brew install pandoc
输入命令行执行安装命令
报错问题及解决办法
安装过程中会有报错问题。
报错信息
Updating Homebrew...
Traceback (most recent call last):
10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'
9: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'
8: from /usr/local/Homebrew/Library/Homebrew/global.rb:28:in `<top (required)>'
7: from /usr/local/Homebrew/Library/Homebrew/global.rb:28:in `require'
6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in `<top (required)>'
5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in `<module:OS>'
4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:in `prerelease?'
3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `version'
2: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `new'
1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:26:in `initialize'
/usr/local/Homebrew/Library/Homebrew/version.rb:368:in `initialize': Version value must be a string; got a NilClass () (TypeError)
根据最后一句可得知报错在version.rb:368,即第368行。也就是说版本号需要调整。
/usr/local/Homebrew/Library/Homebrew/version.rb:368:in `initialize': Version value must be a string; got a NilClass () (TypeError)
解决办法
找到文件夹/usr/local/Homebrew/Library/Homebrew/,打开version.db,将下面的@version改为’10.14.1’。
def initialize(val)
raise TypeError, "Version value must be a string; got a #{val.class} (#{val})" unless val.respond_to?(:to_str)
@version = '10.14.1'
注意不要升级brew,否则会覆盖掉@version
而更新brew的命令
brew update-reset
-
重新在终端输入brew install pandoc
-
解决报错:The following formula pandoc cannot be installed as binary package and must be built from source
Updating Homebrew... Error: The following formula pandoc cannot be installed as binary package and must be built from source. Install the Command Line Tools:
在终端中输入:
xcode-select --install
会提醒让安装xcode,点击安装,等待安装完成。
-
再次输入brew install pandoc
安装开始会显示如下图片,等待安装完成。