Closed DryIce1 closed 8 months ago
Hello, so the script is run in node.js, which needs to be run from the command prompt. You can install both node.js and npm here. Afterwards, you should be able to open up command prompt and type in npm -v to see the version for installation confirmation.
To run the script, open up command prompt and navigate to the script folder. Then, you can type npm install
. This installs all of the dependencies for the script. Then, you can run npm link
. This links the script so you can run ankify
anywhere later on.
Thank you, that was really well explained and I think the script has been properly installed.
I have summarised the installation process so that perhaps novices like myself may be able to walk themselves through the installation a bit more efficiently than I did.
npm -v
and node -v
cd
command (e.g. cd C:\Users\"User...."\....\Ankify-master
). Then type npm install
. Then type npm link
. This allows the script to be run from anywhere when you open the command prompt.ankify
. The script will copy new media files into the selected Anki Profile media collection and an html file in your MarkDown directory is created/updated with the new flashcards which can then be imported into Anki (using ctrl + shift + i
). Despite my successes above with installation, the script doesn't create any .html output file.
In the command line, I am getting a few errors. I wonder if you could take a look at it for me. How do you think I could troubleshoot this?
I have attached the env and script output as text files
Hey so I found fixed some of the code. It should work now in making the html code in the current folder. Also, for the anki profile folder, default is "Anki2\User 1\collection.media". You just change the User 1 part to your profile name.
Thanks for your support @kangruixiang. I will fix my anki profile name in .env
I unlinked and uninstalled the ankify script, and then re-downloaded and installed it.
It hasn't worked successfully yet, but perhaps we are closer?
I know this is just a hobby, but if you are able to please assist at your convenience, Best Tom :)
Hello, thanks for trying. I rewrote the entire script with a different parser that should work more robust with less problems. Before you redownload the script, run npm unlink
so you uninstall the previous version.
Let me know if this works or not. If not, we could set up a time for me to look at your screen. I've done that with 2 other people and helped them getting things to work. Otherwise, you can wait a few weeks for a version with interface to come out so you won't have to deal with command lines.
Hi @kangruixiang! Perhaps we are getting closer....?
Command line output is Creating Anki card
and it does 2 of the 3 things that your README file says it should do:
thanks
ps: I would be happy to do a screenshare session. I am available this weekend. My timezone is GMT+10, if that helps! How would you like to connect?
tom
That sounds like the script worked but didn't find any MD files. Yeah I'm eastern time. Email me kangruixiang@gmail.com, and we can setup a time tomorrow.
That sounds like the script worked but didn't find any MD files.
Yes, you're right I changed the ROOT_DIR to a folder which actually does contain a few MD files and it produced the Ankify html!
However, it is still not running properly. It doesn't recognise the MD files contained within deeper folders in the directory. You're doing well - almost there haha! Thanks :)
If you change line 68 of index.js
let files = glob.sync(path.resolve(rootDir, "*.md"));
to this:
let files = glob.sync(path.resolve(rootDir, "**/*.md"));
That should work.
Thanks, I have it working well, and I can feel the workflow will be quite quick when going through my existing notes.
It is important to remember to use the ~
sign when importing!
What Text Expander software do you use on Windows? thanks
Yeah once set up it's really fast. I don't have to tailor my notes to making cards. I just add cards when I feel it's useful. I've been using espanso. It requires some setup but is rather simple.
Hello,
thank you for your work, I have been wanting to incorporate this into my workflow since December last year and I have adopted Obsidian as my markdown writer recently.
I wonder if you could walk me through how to run your script? I am using Windows and have downloaded the Ankify package.
I don't know how to run "npm install" and nor run "npm link".
In the next step to run the script, do I open the command prompt and type "ankify"?
Thanks in advance. Tom