pelican-plugins
pelican-plugins copied to clipboard
[org_reader] Plugin not working?
Hello,
I am using spacemacs
(develop branch) and pelican 3.7.1
.
I am trying to use the org_reader
plugin but it doesn't seem to work I get the following error:
ERROR: Could not process org/pelican_and_org.org
| CalledProcessError: Command '['/usr/bin/emacs', '-Q', '--batch', '-l', '<pelican path>/pelican-plugins/org_reader/org_reader.el', '--eval', '(org->pelican "<data path>/pelican_and_org.org" \'html)']' returned non-zero exit status 255.
Please install htmlize from https://github.com/hniksic/emacs-htmlize
I have tried to execute the same command on the shell with the same error. Unfortunately I know nothing of lisp.
Any ideas please? Thanks.
Did you try what the error says?
Please install htmlize from https://github.com/hniksic/emacs-htmlize
I am using spacemacs which comes already with htmlize. I also tried to install it to make sure, and no, it didn't work. In fact that error is with htmlize installed, I should have said that before, my apologies.
OK, just making sure :).
@vonpupp This should be fixed here #1066 - it has been working for me.
I still get the same error @kwpav.
Could you please post your pip/pipenv freeze file?
#1066 didn't work for me either. I had to modify the beginning of org_reader.el
so it looked like the following:
(require 'json)
(require 'org)
(require 'ox)
(require 'package)
;; htmlize is needed for SRC blocks
(setq package-archives
'(("melpa" . "http://melpa.milkbox.net/packages/")))
(setq package-load-list '((htmlize t)))
(package-initialize)
(package-install 'htmlize)
Then it works for me. I don't think this is the optimal solution (I get lots of Setting 'package-selected-packages' temporarily since "emacs -q" would overwrite customizations
and 'htmlize' is already installed
messages when I create the html files), but if it is, I can open a PR.
I feel some good progress in this issue, and I thank you both.
@billbrod, I got similar results from you. During your tests, your org files were actually processed? Mine do not seem to be. It says Package ‘htmlize-’ is unavailable
. Did you get the same message? Unfortunately I don't know lisp, so I have no clue on how to solve this.
ERROR: Could not process org/pelican_and_org.org
| CalledProcessError: Command '['/usr/bin/emacs', '-Q', '--batch', '-l', '/home/av/repos/static-doc.project/data/build-pelican/pelican-plugins/org_reader/org_reader.el', '--eval', '(org->pelican "/
home/av/repos/static-doc.project/data/build-pelican/content/org/pelican_and_org.org" \'html)']' returned non-zero exit status 255.
WARNING: Locale could not be set. Check the LOCALE setting, ensuring it is valid and available on your system.
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Package ‘htmlize-’ is unavailable
I have used the code as you said, herewith:
... requires ...
(require 'package)
;; htmlize is needed for SRC blocks
(setq package-archives
'(("melpa" . "http://melpa.milkbox.net/packages/")))
(setq package-load-list '((htmlize t)))
(package-initialize)
(package-install 'htmlize)
(defun org->pelican (filename backend)
... funciton body ...
I don't see any difference from the code on your post.
Thank you very much!
@vonpupp Once I added that bit of code I posted, my org files were processed. The lines
(package-initialize)
(package-install 'htmlize)
should install htmlize
, so that if you run (require 'htmlize)
afterwards, it shouldn't give you that Package htmlize- is unavailable
error. Your code there looks good to me. Have you tried removing the .elc
file with the same name as that (i.e., /home/av/repos/static-doc.project/data/build-pelican/pelican-plugins/org_reader/org_reader.elc
). I don't know how too much lisp either, but my understanding is that the .elc
file has been compiled, so if it's there, emacs will use that instead of recompiling the .el
file you just modified.
I tried the code posted above, it still works on my end, looks like my setup is pulling melpa packages even with emacs -q
for some reason, but yours aren't.
@vonpupp this might work for you? It uses the melpa-stable repo:
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
Thank you all for your help and sorry for the delay,
I tried that and I am getting the same error:
[localhost] local: pelican -s pelicanconf.py
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Package ‘htmlize-’ is unavailable
ERROR: Could not process org/pelican_and_org.org
| CalledProcessError: Command '['/usr/bin/emacs', '-Q', '--batch', '-l', '/home/av/repos/static-doc.project/data/build-pelican/pelican-plugins/org_reader/org_reader.el', '--eval', '(org->pelican "/home/av/repos/static-doc.project/data/build-pelican/content/org/pelican_and_org.org" \'html)']' returned non-zero exit status 255.
I tried to manually assemble the command like this to double check the error:
/usr/bin/emacs -Q --batch -l /home/av/repos/static-doc.project/data/build-pelican/pelican-plugins/org_reader/org_reader.el --eval "(org->pelican '/home/av/repos/static-doc.project/data/build-pelican/content/org/pelican_and_org.org' 'html)"
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
Package ‘htmlize-’ is unavailable
The weird thing to me (with my little knowledge about emacs) is the htmlize-
(notice the dash at the end).
Herewith my modified version of org-reader as you proposed, and the content of pelican_and_org.org file.
To be honest I don't know how to proceed so I would propose for you to please try to run that command alone on the shell with both of the same files linked bellow and post your output if possible.
Thank you very much!
@vonpupp I'm also sorry for the delay! I've been looking into this and I cannot reproduce it, but I believe you are right about the package name, htmlize-
, having a dash at the end because you aren't getting the Please install htmlize
error anymore. I can't see anywhere in the code you posted that could be causing that though.
At this point I'm thinking its a difference in our setup, i.e. OS, Emacs version, etc.
I am using Emacs 26.1 on Linux (Arch Linux).
I'll look into it a bit more, but if we can't find a solution, you could try using one of the other org mode plugins for pelican.
Thank you very much @kwpav.
I am using also Emacs 26.1 (spacemacs on the develop branch) on Arch Linux. Herewith my Pipfile:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
"fabric3" = "*"
pelican = "==3.7.1"
ipdb = "*"
pip = "==18.0"
"beautifulsoup4" = "*"
markdown = "*"
pelican-youtube = "*"
pycrypto = "*"
pysword = "*"
python-scriptures = "*"
sphinx = "*"
sphinx-rtd-theme = "*"
sphinx-autobuild = "*"
orgco = "*"
[dev-packages]
[requires]
python_version = "3"
Could you please post your frozen versions? Thanks in advance!
I had this similar issue on debian-10, I sorted it out but using this melpa repo:
https://melpa.org/packages/