我正在使用 Nikola,一个静态网站生成器,来建立一个网站。我正在通过Github Actions自动构建它。我还想使用Pandoc帮助将我的 markdown 转换为 html,但我注意到 Pandoc 并未包含在原始操作中。因此,我不得不尝试弄清楚如何包含它。然而,我一次又一次地被FileNotFound
错误所挫败。
首先,我尝试编辑操作,以便在 Ubuntu 环境中安装 Pandoc。下面是我编辑的动作版本。我只添加了Install Pandoc on Ubuntu
步骤。
on: [push]
jobs:
nikola-build:
runs-on: ubuntu-latest
steps:
- name: Install Pandoc on Ubuntu
run: sudo apt-get install -y pandoc
- name: Check out
uses: actions/checkout@v2
- name: Build and Deploy Nikola
uses: getnikola/nikola-action@v3
with:
dry_run: false
当这再次失败并通知我找不到 Pandoc 时,我requirements.txt
在我的存储库中添加了一个文件:
Pandoc
我尝试再次运行该操作。两个安装——我编写的操作步骤——pip install pandoc
运行没有任何问题并且成功。然而到了Nikola开始建站的那一步,好像不管怎么做都渲染失败,因为找不到Pandoc:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/nikola/plugins/compile/pandoc.py", line 76, in compile
subprocess.check_call(['pandoc', '-o', dest, source] + self._get_pandoc_options(source))
File "/usr/local/lib/python3.8/subprocess.py", line 359, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/local/lib/python3.8/subprocess.py", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pandoc'
我到处寻找类似问题的解决方案,但它们很少而且已经过时。我将非常感谢您对这个问题的任何见解,有什么问题,我可以做些什么来解决它等等。