Giter Club home page Giter Club logo

Comments (5)

ag91 avatar ag91 commented on August 23, 2024 1

Hi, is this the string you saw?

Unable to test Pandoc! Please report this bug! (include the output of "pandoc --dump-args --no-wrap")

If you give the output of that pandoc command as well it will give some other useful information to solve this.

from org-web-tools.

alphapapa avatar alphapapa commented on August 23, 2024

Hi there,

Hi, thanks a lot for the very nice tool. I started playing with it for my web clipping activities.

Glad you like it. :)

However, somehow by letting pandoc run in the terminal, the function of org-web-tools-read-url-as-org worked. It stopped working when i tried to stop pandoc running in the terminal.

That is very strange! I have no idea why it would work that way.

Is there anything I need to change in the environment or emacs configuration file for it to work properly without needing to have the terminal running with the pandoc command?

I don't use Mac OS, and I don't know much about using Emacs with it. I have heard that there can be issues with finding programs in the environment PATH. I think it depends on how you launch Emacs, how it's installed, etc. I'm pretty sure that you should be able to find the answer if you google around, check emacswiki, /r/emacs, Emacs.SE, etc.

I did have this (when (memq window-system '(mac ns x)) (exec-path-from-shell-initialize)) in the .emacs file after googling about the problems of emacs running in macOS not being able to use executable files in usr/local/bin.

I can't find the function exec-path-from-shell-initialize in my Emacs, so I'm guessing this is something external, but it sounds like it might help. :)

Basically, the problem is probably that Emacs is not being run in an environment where PATH is set to what you get in a terminal. So if you were to start Emacs from a terminal, it would probably work. So if you can get exec-path-from-shell-initialize working, whatever that is, I guess it will fix it for you.

But like @ag91 said, please do give the output of that command. Try it in a terminal outside of Emacs, and then run it from a terminal inside Emacs (e.g. M-x ansi-term).

Thanks again for the nice tool and also the helm-org-rifle tool, I love both of them a lot.

Thanks, glad you like it. BTW, just curious, do you ever use the helm-org-rifle-occur commands? Sometimes I wonder if anyone has ever noticed them. :)

from org-web-tools.

fjell-dev avatar fjell-dev commented on August 23, 2024

Thank you all for the responses. I have not really had a time to investigate further to the issue but I just found out that whenever I restart emacs, I just need to call pandoc in the terminal for one time and kill it, the function of org-web-tools works again in that session. I guess there is something to do with the environment of my MacOS settings.
Anyway, I like the tool a lot, it really solves my problem of web clipping activities. I have tried different solutions in the past years, including Evernote web clipping function (excellent tool but lately I don't want to have my knowledge-base trapped in Evernote without any easy ways to transfer in case they close down their service), then tagspace webclipping tool (it only output the rich text HTML, which is fine on desktop but barely readable on many mobile apps, also the file tends to be bigger with all of the rich markup). By the way, do you think it would be possible to extend the tool a bit by adding a function to convert the org file to markdown right after that (by calling pandoc again for example)? I like org files but markdown files are supported widely by mobile apps.
I tried the helm-org-rifle-occur, it's pretty neat. Also @alphapapa, could you let me know what the differences between helm-org-rifle with helm swoop?

from org-web-tools.

alphapapa avatar alphapapa commented on August 23, 2024

I guess there is something to do with the environment of my MacOS settings.

I guess so. Sorry I can't be more help here. Let me know if you ever figure out exactly what it is, and I'll add a note to the readme.

Evernote web clipping function (excellent tool but lately I don't want to have my knowledge-base trapped in Evernote without any easy ways to transfer in case they close down their service)

Agreed. I started using Evernote a long time ago, but I gradually stopped using it. They've basically ruined it.

do you think it would be possible to extend the tool a bit by adding a function to convert the org file to markdown right after that (by calling pandoc again for example)? I like org files but markdown files are supported widely by mobile apps.

You can do this fairly easily by copying the functions and changing the output format argument to pandoc. Here:

(defun org-web-tools--url-as-readable-md (&optional url)
  "Return string containing Markdown of URL's web page content.
Content is processed with `eww-readable' and Pandoc."
  (-let* ((url (or url (org-web-tools--get-first-url)))
          (html (org-web-tools--get-url url))
          ((title . readable) (org-web-tools--eww-readable html))
          (title (org-web-tools--cleanup-title (or title "")))
          (converted (org-web-tools--html-to-md-with-pandoc readable)))
    converted))

(defun org-web-tools--html-to-md-with-pandoc (html)
  "Return string of HTML converted to Markdown with Pandoc."
  (with-temp-buffer
    (insert html)
    (unless (zerop (call-process-region (point-min) (point-max) "pandoc"
                                        t t nil
                                        (org-web-tools--pandoc-no-wrap-option)
                                        "-f" "html" "-t" "md"))
      (error "Pandoc failed"))
    (org-web-tools--clean-pandoc-output)
    (buffer-string)))

could you let me know what the differences between helm-org-rifle with helm swoop?

They are completely different. helm-swoop is line-based and rather slow. helm-org-rifle is specific to Org mode, much faster, and has a lot of features.

from org-web-tools.

alphapapa avatar alphapapa commented on August 23, 2024

Going to close this now. Let me know if you need anything else.

from org-web-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.