JackGruber / joplin-plugin-hotfolder

A plugin to Monitor a locale folder and import the files as a new note.
46 stars 4 forks source link

Cannot import .Rmd and .R files as text #24

Closed petzi53 closed 1 year ago

petzi53 commented 2 years ago

Thank you for your excellent plugin.

I imported as text files successfully .txt, .md and .html files. But did not succeed with .Rmd and .R files. I do not know what I did wrong. See my plugin configuration.

image


JackGruber commented 2 years ago

the files are imported as attachement?

petzi53 commented 2 years ago

Yes. Your plugin created a new note with the name of the .R file, and inside this new note, the file was imported as an attachment.

JackGruber commented 2 years ago

There is a small bug on mixed case file extentions.

JackGruber commented 2 years ago

Could you please test the attached Version.

  1. Downlaod io.github.jackgruber.hotfolder.zip
  2. Close Joplin
  3. Replace the the io.github.jackgruber.hotfolder.jpl in .config\joplin-desktop\plugins with the version from the Zip file
  4. Start Joplin
petzi53 commented 2 years ago

When I downloaded io.github.jackgruber.hotfolder.zip and unzipped it I got a folder with a manifest.json and an index.js file, but not a .jpl file, not io.github.jackgruber.hotfolder.jpl.

JackGruber commented 2 years ago

When you unzip the file there is a is a io.github.jackgruber.hotfolder.jpl file, when you untar the jpl file, then you would see a index.js and a manifest.json. Plz. don't untar the jpl.

petzi53 commented 2 years ago

Thank you for your help and patience. I didn't know that macOS automatically untars .zip files by default. I had to use The Unarchiver, a third-party tool, to get the .jpl file.

.Rmd and .R files are not attached anymore as PDFs but imported as text into Joplin! 👍

But there are two errors in the conversion process:

  1. Frontmatter in .Rmd files is not converted correctly. It displays wrongly in the Viewer, but also in the edit mode is a formatting error in the last line.
  2. The parameters for code snippets are not preserved.

I produced a screenshot and loaded it to Imgur so you can see it yourself. (Uploading into this GitHub post didn't work.)

JackGruber commented 2 years ago

Sorry, the file is imported as 1 to 1 as text, therefore also frontmatter would be imported as text. The hotfolder handles the text content as you copy paste it into a note.

petzi53 commented 2 years ago

Ok, thank you. That's fine with me!