<div class="link-card"> <div class="link-card-header"> <img src="https://github.githubassets.com/favicons/favicon.svg" class="link-card-site-icon"/> <span class="link-card-site-name">GitHub</span> </div> <div class="link-card-body"> <div class="link-card-content"> <div> <p class="link-card-title">GitHub - toppair/peek.nvim: Markdown preview plugin for Neovim</p> </div> <div class="link-card-description"> Markdown preview plugin for Neovim. Contribute to toppair/peek.nvim development by creating an accou... </div> </div> <img src="https://opengraph.githubassets.com/2d72fe8984088128aca8aa26b49289ab7d417710c9fff9eeedd7ea0738922a64/toppair/peek.nvim" class="link-card-image" /> </div> <a href="https://github.com/toppair/peek.nvim"></a> </div> [[Deno]]は1.37.1を使う。 [[lazy.nvim]]の設定に追加。 `init.lua` ```lua { "toppair/peek.nvim", event = { "BufRead", "BufNewFile" }, build = "deno task --quiet build:fast", config = function() require("peek").setup{ theme = 'light' } vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {}) vim.api.nvim_create_user_command("PeekClose", require("peek").close, {}) end, } ``` > [Installation using lazy\.nvim ? · Issue \#35 · toppair/peek\.nvim](https://github.com/toppair/peek.nvim/issues/35) ## Module not found エラー ```error Peek error: error: Module not found "file:///home/tadashi-aikawa/.local/share/nvim/lazy/peek.nvim/public/main.bundle.js". ``` `/home/tadashi-aikawa/.local/share/nvim/lazy/peek.nvim/public/main.bundle.js"` は存在するのでビルドはできてそう。 `/home/tadashi-aikawa/.local/share/nvim/lazy/peek.nvim/` に移動して https://github.com/toppair/peek.nvim/pull/50/files の変更をして ```console deno task --quiet build ``` ## libwebkit2gtkが開けないエラー ```error Peek error: error: Uncaught (in promise) Error: Could not open library: Could not open library: libwebkit2gtk-4.0.so.37: cannot open shared object file: No such file or directory return Deno.dlopen(file, symbols); ^ at new DynamicLibrary (ext:deno_ffi/00_ffi.js:440:46) at Object.dlopen (ext:deno_ffi/00_ffi.js:577:10) at prepare (file:///home/tadashi-aikawa/.local/share/nvim/lazy/peek.nvim/public/webview.js:2897:17) at eventLoopTick (ext:core/01_core.js:183:11) at async file:///home/tadashi-aikawa/.local/share/nvim/lazy/peek.nvim/public/webview.js:4025:13 ``` 存在しなそうなのでインストール。 ```console sudo apt-get update -y sudo apt-get install -y libwebkit2gtk-4.0-37 ``` ## 日本語が豆腐になる フォントが対応してなさそうなので[[Noto Sans CJK]]を[[Noto Color Emoji]]をインストールしてみる。 ```console sudo apt install fonts-noto-cjk fonts-noto-color-emoji ``` > [[📝UbuntuでブラウザのようなGUIを起動するとマルチバイト文字や絵文字が豆腐になる]] ## リンクを確認する Webviewでは無理なので[[Google Chrome]]をインストールする。 ```console sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - sudo apt-get update sudo apt-get install google-chrome-stable ``` > [[📕Google ChromeをUbuntuにインストール]] ブラウザにしても関係なかった...。