Al0den / notion.nvim

Notion API wrapper for Neovim
MIT License
61 stars 4 forks source link

Markdown preview is not working. #15

Closed nekowasabi closed 4 months ago

nekowasabi commented 4 months ago

Describe the bug Markdown preview is not working. Preview windows is showing json data. And cannot update notion page.

To Reproduce Steps to reproduce the behavior:

  1. Execute ':Notion menu'
  2. Select notion's item.
  3. Typing 'e'
  4. Add text like '# abcdefg'
  5. Execute ':w' for updating notion's page.

Expected behavior

  1. Show markdown preview.
  2. Enable update notion's page.

Screenshots

image

Desktop (please complete the following information):

Al0den commented 4 months ago

Not able to reproduce, works as expected on my side? image image

(Changed the - to ---), needed no reload or whatever

Mind providing details?

Al0den commented 4 months ago

If you mean not being able to edit the markdown page, that is normal (for now), only editing the raw json is fully supported. Working on the markdown part, but not for soon at all.

nekowasabi commented 4 months ago

Sorry, I was mistaken in thinking that markdown could be edited. I look forward to the markdown editing feature. Thanks for your response! 👍

nekowasabi commented 4 months ago

Just to be sure I am reporting this, I was able to save the Notion page by editing the JSON directly and saving it. However, an error occurs in the save process callback. This may be the same error you fixed before.

013ce6ea-20b9-4743-a4e7-cdf91500e47a
vim.schedule lua error occured by callback: ...ets/.config/nvim/plugged/notion.nvim/lua/notion/init.lua:22: bad argument #1 to 'write' (string ex
pected, got nil)
stack traceback:
        [C]: in function 'write'
        ...ets/.config/nvim/plugged/notion.nvim/lua/notion/init.lua:22: in function 'writeFile'
        ...ts/.config/nvim/plugged/notion.nvim/lua/notion/parse.lua:34: in function 'updateMarkdown'
        ...ts/.config/nvim/plugged/notion.nvim/lua/notion/parse.lua:52: in function <...ts/.config/nvim/plugged/notion.nvim/lua/notion/parse.lua:52>
Al0den commented 4 months ago

Aware of it, updateMarkdown code commented out in commit b769c76, not a fix but no time to dig into it today. PackerSync should remove the error, and #16 is a note for myself to fix that