haskell - 我如何告诉 gitit 插件库在哪里?
问题描述
精简版
我配置gitit
为使用它的“Deprofanizer”插件,但是当我运行它时,它失败了,说:
Loading plugin 'plugins/Deprofanizer.hs'...
plugins/Deprofanizer.hs:6:1: error:
Could not find module ‘Network.Gitit.Interface’
Use -v to see a list of the files searched for.
|
6 | import Network.Gitit.Interface
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gitit: Error loading plugin: plugins/Deprofanizer.hs
显然它找到了插件,但后来无法编译它。
我该如何解决?
更长的详细版本
我已经按照说明安装了gitit
wiki 软件,使用. 如果我只是运行,它会完美运行:它会创建它的目录,初始化它的数据库,并在端口 5001 上运行一个 HTTP 服务,就像宣传的那样。stack install
gitit
static
但是我无法让插件工作,因为这似乎是一个纯粹与配置相关的问题。
示例gitit
配置包含如何配置插件的说明:
plugins:
# specifies a list of plugins to load. Plugins may be specified
# either by their path or by their module name. If the plugin name
# starts with Gitit.Plugin., gitit will assume that the plugin is
# an installed module and will not try to find a source file.
# Examples:
# plugins: plugins/DotPlugin.hs, CapitalizeEmphasisPlugin.hs
# plugins: plugins/DotPlugin
# plugins: Gitit.Plugin.InterwikiLinks
默认配置不使用插件。提供了几个插件,这里的说明看起来很清楚,所以我尝试通过将配置更改为gitit
打开Deprofanizer
插件:plugins
plugins: plugins/Deprofanizer.hs
正如样本所建议的那样。(作为示例Deprofanizer
提供。)gitit
这几乎可以工作。当我启动时gitit
,它确实找到了我期望的 Deprofanizer 模块,并尝试编译它。但:
Loading plugin 'plugins/Deprofanizer.hs'...
plugins/Deprofanizer.hs:6:1: error:
Could not find module ‘Network.Gitit.Interface’
Use -v to see a list of the files searched for.
|
6 | import Network.Gitit.Interface
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gitit: Error loading plugin: plugins/Deprofanizer.hs
该Network.Gitit.Interface
模块确实是 Gitit 发行版的一部分,我想它已编译到我的gitit
可执行文件中。但我不知道为什么插件无法导入它,或者如何修复它。我在手册中找不到任何提示这可能是一个问题。
我找到了代码(负责Network.Gitit.Plugins
加载和编译插件模块:
loadPlugin pluginName = do
logM "gitit" WARNING ("Loading plugin '" ++ pluginName ++ "'...")
runGhc (Just libdir) $ do
...
并对其进行检测以写出 的值libdir
,即/home/mjd/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5
。该目录存在,但我不知道如何处理它。
再次,问题是:
我该如何解决?
解决方案
推荐阅读
- java - Java整数到字节数组短
- postgresql - 如何在我的时区从 Postgres 获取日期
- css - 带有背景滤镜模糊的比较滑块不起作用
- vba - 在字符串中查找多个单词
- javascript - 使用 Mousetrap.js 聚焦输入字段-但输入字段也将热键粘贴为值?
- linux - 如何将所有现有文件从远程 sftp 服务器传输到本地目录并创建一个包含这些文件列表的 .txt 文件?
- sql - Oracle根据一列将行转换为动态列
- postgresql - 将本地 postgres 数据库复制到 AWS RDS 的最佳方法是什么?
- adobe-indesign - 通过脚本为标准 InDesign 面板提供了哪些方法和属性以供使用?
- excel-formula - 获取 Excel 公式中使用的单元格数