module 'djot' not found: #149
-
I can't seem to use
What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments 11 replies
-
You'll need to install the djot package via luarocks:
from the djot repository should do this. Or, you can use djot-reader.lua in the djot source directory, and add to the top of djot-reader.lua
Note: the API is a bit unstable and it's possible that djot-reader.lua may stop working if I change the djot API. If that happens, remind me and I can fix it. |
Beta Was this translation helpful? Give feedback.
-
There are several env vars which need/can be set. See https://web.archive.org/web/20210127030419/http://www.thijsschreijer.nl/blog/?p=1025 |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. From the documentation I was told to copy the reader and writer filters to the working directory and use them from there when using Pandoc. Could something be done to reference how to install these filters into Pandoc? I am running Mac OS 10.15.7 here, but I think the old OS is not the root of the problem here. |
Beta Was this translation helpful? Give feedback.
-
I've found a way to avoid these problems by creating a single lua file that includes the custom reader or writer and the whole djot library. First you need to install the "amalg" tool:
You should now have a single file |
Beta Was this translation helpful? Give feedback.
-
Nice! That works great here.
Will this be integrated somehow into the filters that are provided or can the documentation be expanded?
I really enjoy writing in Djot, and find it very easy to use as Markdown, but I much prefer Djot over Markdown in the long run.
|
Beta Was this translation helpful? Give feedback.
-
I've added some documentation on this and a handy Makefile target. |
Beta Was this translation helpful? Give feedback.
-
Thanks, but I still get an error. Have pasted from below after following the instructions in readme.md.
How can I fix this?
```
Error running Lua:
...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3965: bad argument #1 to 'gsub' (string expected, got nil)
stack traceback:
...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3965: in function <...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3950>
(...tail calls...)
...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3840: in method 'render_children'
...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3859: in function <...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3856>
(...tail calls...)
...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3840: in method 'render_children'
...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3859: in function <...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3856>
(...tail calls...)
...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3840: in method 'render_children'
...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3853: in function <...rs/tbd/.local/share/pandoc/readers/djot-reader.amalg.lua:3850>
(...tail calls...)
```
Sendt fra min Mac Mini via Apple Mail
… Den 29. dec. 2022 kl. 18.11 skrev John MacFarlane ***@***.***>:
I've added some documentation on this and a handy Makefile target.
I'll also start testing the custom reader/writer on CI, so I'll know when they break.
—
Reply to this email directly, view it on GitHub <#149 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGGLXRT2HN7CKEBZV7LBFNDWPXA5BANCNFSM6AAAAAASRGWNOQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
I think that was a bug I fixed this morning. Do you have the latest code from github? |
Beta Was this translation helpful? Give feedback.
-
Yes, I cloned this just less than two hours ago, and it still breaks.
After doing a totally new clone of the repository I managed to create the amalg.lua files, but if I copy them into my data-dir in Pandoc under readers and writers the reader will not function.
I have tried to reinstall everything and installing Djot from the source provided via the cloned repository.
I use the GitHub for desktop on Mac OS here if that can be of any help.
|
Beta Was this translation helpful? Give feedback.
-
This is getting more and more interesting.
The read and write works fine if all stays in the djot repository directory including the djot-reader.amalg.lua and djot-writer.amalg.lua files. If I copy those to the data-dir for Pandoc and put djot-reader.amalg.lua in the subdirectory: readers
and the djot-writer.amalg.lua in the subdirectory: writers
it all starts to break.
Sendt fra min Mac Mini via Apple Mail
… Den 29. dec. 2022 kl. 21.24 skrev John MacFarlane ***@***.***>:
I think that was a bug I fixed this morning. Do you have the latest code from github?
—
Reply to this email directly, view it on GitHub <#149 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGGLXRWAPS26ZXITU5EUNJLWPXXPJANCNFSM6AAAAAASRGWNOQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
I only use the official version op Pandoc, and the issue is present every time I try to use the scripts outside the djot repository directory. That includes the scripts, but also the files I try to work with. How can this be fixed?I ended installing Djot via themake installfile from the repository. Sendt fra min iPhone via Braille Sense U2/MBrailleDen 30. dec. 2022 kl. 01.06 skrev John MacFarlane ***@***.***>:
If you're using the latest dev pandoc, there's a recent change that wants you to put custom readers/writers in "custom" rather than "readers".
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ok will try again when I am back home.Perhaps there is something going on while I tried reinstalling all the packages. Hope you don't mind I update this, if I find something. Sendt fra min iPhone via Braille Sense U2/MBrailleDen 31. dec. 2022 kl. 00.11 skrev John MacFarlane ***@***.***>:
Sorry, I don't know how to help you. It worked for me (in readers) with the last official release. Make sure you're using the right user data directory (see pandoc --version).
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I now tried to clean up from all the install I have done in the past, and ran the pandoc from the DJOT-directory that I cloned from GitHub.
´´´
I used this:
pandoc -f djot-reader.amalg.lua -t djot-writer.amalg.lua -o test-djot.txt README.MD
Got the following output:
Error running Lua:
djot-reader.amalg.lua:3965: bad argument #1 to 'gsub' (string expected, got nil)
stack traceback:
djot-reader.amalg.lua:3965: in function <djot-reader.amalg.lua:3950>
(...tail calls...)
djot-reader.amalg.lua:3840: in method 'render_children'
djot-reader.amalg.lua:3859: in function <djot-reader.amalg.lua:3856>
(...tail calls...)
djot-reader.amalg.lua:3840: in method 'render_children'
djot-reader.amalg.lua:3859: in function <djot-reader.amalg.lua:3856>
(...tail calls...)
djot-reader.amalg.lua:3840: in method 'render_children'
djot-reader.amalg.lua:3853: in function <djot-reader.amalg.lua:3850>
(...tail calls...)
´´´
My data-dir is: ~/.local/share/pandoc
and I have saved the files in both readers and writers directories for the respective files so djot-reader goes into readers and djot-writer goes into writers.
Have tried installing Pandoc from both the Homebrew and the installer, and ended trying with the installer again.
I have installed DJot by typing:
´´´
brew install luarocks
luarocks install djot
´´´
All of this seems to work fine. Then I do:
´´´
make djot-reader.amalg.lua
make djot-writer.amalg.lua
´´´
It all looks fine until I run the Pandoc command.
|
Beta Was this translation helpful? Give feedback.
-
Hi!
When I use the
´´´
luarocks install djot
I get the following error:
djot 0.2.0-1 depends on lua >= 5.1 (5.4-1 provided by VM)
mkdir: /usr/local/lib/luarocks/rocks-5.4/djot/0.2.0-1/lua: Permission denied
Error: failed making directory /usr/local/lib/luarocks/rocks-5.4/djot/0.2.0-1/lua
I also just reinstalled Xcode developer tools again.
´´´
Sendt fra min Mac Mini via Apple Mail
… Den 1. jan. 2023 kl. 20.55 skrev John MacFarlane ***@***.***>:
To be safe, try (in the djot repository):
git pull
make -B djot-reader.amalg.lua
make -B djot-writer.amalg.lua
—
Reply to this email directly, view it on GitHub <#149 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGGLXRWZ5MWSUTS7UOTOUYTWQHOKVANCNFSM6AAAAAASRGWNOQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the advice, but the documentation for Luarocks is a little technical, and I may have done something wrong during the process.
I get the same error, so I am out of time and luck at the moment.
I really hoped I could have used some of my vacation time playing with Djot, as I really wanted to. Instead I have lost hours trying to fix something that broke because I thought it was a good idea to update Djot.
I hope this installation gets easier and that djot and Pandoc will be easier to pair for the future.
When I got Djot working I was very happy, and I really was looking forward to write and use it as my primary format of choice here, but due to the technical issues I have faced I may need to pause this until it gets a little more user friendly to install.
I may have failed this since I tried installing Luarocks via Homebrew and that installed Lua as well.
I will try to look into this again later in 2023, since I **love** the ideas behind Djot and was hoping that I could start this year adopting it as my primary format for composing documents.
Thanks for your help, you or any other can share some light of why this upgrade broke so much on my system and especially how to fix this, I will much appreciate it.
I think the reader is the main issue, and strangely enough not the writer on my system.
Sendt fra min Mac Mini via Apple Mail
… Den 1. jan. 2023 kl. 21.10 skrev John MacFarlane ***@***.***>:
OK, then
luarocks install --local djot
This will put djot in your home directory. You'll need to make sure your LUA_PATH is set correctly. See the luarocks documentation.
luarocks path
will give you the commands you need to set it properly.
—
Reply to this email directly, view it on GitHub <#149 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGGLXRWJW43Q6WLWI23Z633WQHQFHANCNFSM6AAAAAASRGWNOQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
-
You can try my new JavaScript implementation at https://github.com/jgm/djot.js. |
Beta Was this translation helpful? Give feedback.
You'll need to install the djot package via luarocks:
from the djot repository should do this. Or, you can use djot-reader.lua in the djot source directory, and add to the top of djot-reader.lua
Note: the API is a bit unstable and it's possible that djot-reader.lua may stop working if I change the djot API. If that happens, remind me and I can fix it.