vim-asciidoctor
vim-asciidoctor copied to clipboard
E666: compiler not supported: asciidoctor-pdf
Hi. not sure if this is the correct place to post this. I am still a bit learning all these things
I am using vim as editor with the following in my vimrc :
Plug 'habamax/vim-asciidoctor'
I have the following config :
"below is for Haba asciidoctor
let g:asciidoctor_executable = 'asciidoctor'
let g:asciidoctor_extensions = ['asciidoctor-diagram', 'asciidoctor-rouge']
let g:asciidoctor_pdf_executable = 'asciidoctor-pdf'
let g:asciidoctor_pdf_extensions = ['asciidoctor-diagram']
let g:asciidoctor_pandoc_executable = 'pandoc'
let g:asciidoctor_pandoc_data_dir = '~/Documents/.pandoc'
let g:asciidoctor_pandoc_other_params = '--toc'
let g:asciidoctor_syntax_conceal = 0
let g:asciidoctor_syntax_indented = 1
let g:assciidoctor_fenced_languages = ['python', 'c', 'bash', 'console' ]
let g:asciidoctor_img_paste_command = 'xclip -selection clipboard -t image/png -o > %s%s'
let g:asciidoctor_img_paste_pattern = 'img_%s_%s.png'
function! AsciidoctorMappings()
nnoremap <buffer> <leader>oo :AsciidoctorOpenRaw<CR>
nnoremap <buffer> <leader>op :AsciidoctorOpenPDF<CR>
nnoremap <buffer> <leader>oh :AsciidoctorOpenHTML<CR>
nnoremap <buffer> <leader>ox :AsciidoctorOpenDOCX<CR>
nnoremap <buffer> <leader>ch :Asciidoctor2HTML<CR>
nnoremap <buffer> <leader>cp :Asciidoctor2PDF<CR>
nnoremap <buffer> <leader>cx :Asciidoctor2DOCX<CR>
nnoremap <buffer> <leader>p :AsciidoctorPasteImage<CR>
":make will build PDF's
compiler asciidoctor-pdf
endfunction
"Call AsciidoctorMappings for all adoc type files.
augroup asciidoctor
autocmd!
autocmd BufEnter *.adoc,*.asciidoc call AsciidoctorMappings()
augroup END
when i open to edit a adoc file , i get the following error :E666: compiler not supported: asciidoctor-pdf.
I am using the following :
Debian GNU/Linux 11 (bullseye)
VIM - Vi IMproved 8.2
asciidoc 9.0.0rc2
Asciidoctor 2.0.12 [https://asciidoctor.org]
Runtime Environment (ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
Asciidoctor PDF 2.3.9 using Asciidoctor 2.0.12 [https://asciidoctor.org]
Runtime Environment (ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
Any idea why I would get the error : E666: compiler not supported: asciidoctor-pdf ?
Might be due to vim8.2 -- I don't have it at hand to check it out, unfortunately.
Tx man, tell. Me could this be the reason why, when I generate docs(pdf, html, docx) I don't see the Admonitions. However the same doc displays them when I preview it using the asciidoctor.js live preview plugin.
Tx man, tell. Me could this be the reason why, when I generate docs(pdf, html, docx) I don't see the Admonitions. However the same doc displays them when I preview it using the asciidoctor.js live preview plugin.
Hi again Haba, so I managed to get my admonitions working. It was not this plugin, but my entire ruby and asciidoctor-pdf setup... the guys over at asciidoctor-pdf helped me quite a bit, so now I still get the compiler warning, but I get all the admonitions etc. and the output PDF is correct.
Here is the link to the Zulip thread if anyone else stumbles on this, and it may be useful if they're also having a similar challenge as a newb. : Zulip link
EDIT: Okay, finally cleared the compiler error warning message as well. I basically just had to delete the compiler name line, as per my vimrc I posted above.
So, this line : compiler asciidoctor-pdf
was deleted.
All seems to work well now after the above (link to Zulip and the minor vimrc change). It's just my DOCX generating without any admonitions, but I guess I can use other tools like LibreOffice headless to change a PDF to DOCX.
Oh, I then did an echo to add to bash profile, so my terminals always start up with this gemset :
echo "rvm gemset use myasciidoctorgemset" >> ~/.bash_profile
exit the terminal and start a new terminal session or source the bash profile.
So after applying all the Ruby stuff as per the Zulip link and things above, this seems to work :
- Now I can edit an adoc file in vim and use the mappings as per vimrc details in this thread above and doing for example
:cp
and:op
creates and opens the PDF respectively (same for HTML using:ch
&:oh
) . - Since my DOCX is admonitionless if I use
:cx
and:co
, again to create and open the DOCX respectively, I will use something like this below after creating a PDF initially as per above bullet :$ libreoffice --invisible --infilter="writer_pdf_import" --convert-to docx:"MS Word 2007 XML" 'my_vim_asciidoc.pdf'
Again, thanks a mill..