Open Kabouik opened 1 year ago
The error vanishes if I hardcode the absolute path of the markdown-it
executable:
(use-package markdown-mode
:ensure t
:mode ("README\\.md\\'" . gfm-mode)
:init (setq markdown-command "/home/mat/.local/bin/markdown-it"))
But this is weird because $HOME/.local/bin
is in my $PATH
, so there is still something off.
Also, the export didn't actually work, but my CPU use got quite high. I don't know if this is a markdown-it
issue or because markdown-mode
was missing some arguments after the command.
Please check PATH
environment variable and exec-path
value on Emacs(M-: exec-path
, M-: (getenv "PATH")
etc).
If you don't launch Emacs from shell, Emacs doesn't inherit PATH value and you have to set PATH configurations in your init.el.
There are some tools to set PATH configuration from your shell configuration files like .bashrc
, .zshrc
Thanks, you're right, that was my issue because I launch emacs-daemon
from my sway
configuration, so it doesn't inherit my shell $PATH
.
I'm still experiencing the second issue though: using markdown-it
as my markdown-command
makes the export use a lot of CPU (and never end unless interrupted) like it is stalling, while running markdown-it somefile.md
in shell works immediately. Can markdown-mode
work with markdown-it
or does it expect a different command line syntax than COMMAND FILE.md
?
I cannot reproduce your high CPU usage issue by converting markdown file to HTML with markdown-it
and M-x markdown
. When does your issue happen ? Could you tell us how to reproduce your issue ?
Alright, good to know it does not happen on your end. The steps to reproduce are exactly what you did:
M-x markdown
or M-x markdown-export
So somehow it's on my end, but what I don't get is why markdown-it
outside of emacs and markdown-mode works fine. My emacs configuration related to markdown-mode is just the 4 lines of elisp written in the first post.
FYI markdown-mode
evaluates (shell-command-on-region (point-min) (point-max) "markdown-it" (get-buffer-create "*markdown-output*"))
to convert markdown file into a HTML file.
@Kabouik try setting markdown-command-needs-filename
to t
I am trying to use
markdown-it
as mymarkdown-command
butmarkdown-mode
returns "Markdown command markdown-it is not found". Yet, it is well available and working when I run it from my shell in a terminal.Expected Behavior
Markdown export to html should work.
markdown-it
works from the shell:Actual Behavior
I get the above error.
Steps to Reproduce
Evaluate the following and try a Markdown export in a Markdown buffer:
Software Versions