libreoffice-code-highlighter
libreoffice-code-highlighter copied to clipboard
Support text selection in Impress & Calc OR Show a meaninful message box
The Add-On works great within LibreOffice Writer.
In Impress and Calc (I tried only both of them) it doesn't. After selecting a text and choosing the desired langue there comes the following error.
Screenshot from Windows 10
-
version information:
Win: Version: "Version: 6.1.2.1 (x64) Build-ID: 65905a128db06ba48db947242809d14d3f9a93fe CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; Gebietsschema: de-DE (de_DE); Calc: CL
-
Screenshot from Ubuntu 18.10,
- version information:
Version: 6.1.2.1 Build-ID: 1:6.1.2-0ubuntu1 CPU-Threads: 4; BS: Linux 4.18; UI-Render: Standard; VCL: gtk3; Gebietsschema: de-DE (de_DE.UTF-8); Calc: group threaded
-
This issue might be related to #31.
Hi, How did you use the HighLighter in Impress? The original way of highlighting a code snippet using this addon is as follows:
- Create a Text Box (Insert --> Text Box)
- Enter the Code into the text box
- Select the text box (not the text. Highlighting selected text is added by @medovina. This feature works only in writer)
- Choose the language in the Highlight menu You can see the detailed instruction with screenshots here
I tried this method in my LO 6.0.6.2 in Writer, Impress and Calc. All are working as expected. If you still encounter any issues, please do let me know. Thanks
运行 Python 脚本 vnd.sun.star.script:codehighlighter.oxt|python|highlight.py$highlight_py3tb_default?language=Python&location=user:uno_packages 时出现脚本框架错误。
消息: <class 'ImportError'>: No module named 'pygments' (or 'pygments.styles' is unknown)
File "/opt/libreoffice6.0/program/pythonscript.py", line 1024, in getScript
mod = self.provCtx.getModuleByUrl( fileUri )
File "/opt/libreoffice6.0/program/pythonscript.py", line 484, in getModuleByUrl
exec(code, entry.module.dict)
File "/home/newtekboy/.config/libreoffice/4/user/uno_packages/cache/uno_packages/lu16772kqkqk.tmp_/codehighlighter.oxt/python/highlight.py", line 19, in
Please check the latest release v1.5.
Highlighting text within a text box by clicking on the box works. Thanks for pointing out that feature.
Nevertheless the functionality implemented by @slgobinath for Writer would be nice to have for Impress, Calc, ...
A Scripting Framework error occurred while running the Python script vnd.sun.star.script:codehighlighter.oxt|python|highlight.py$highlight_cpp_default?language=Python&location=user:uno_packages.
Message: <class 'ImportError'>: No module named 'pygments' (or 'pygments.styles' is unknown)
File "/usr/lib/libreoffice/program/pythonscript.py", line 1024, in getScript
mod = self.provCtx.getModuleByUrl( fileUri )
File "/usr/lib/libreoffice/program/pythonscript.py", line 484, in getModuleByUrl
exec(code, entry.module.dict)
File "/home/viraj/.config/libreoffice/4/user/uno_packages/cache/uno_packages/lu27796ed10bk.tmp_/codehighlighter.oxt/python/highlight.py", line 19, in
I downloaded the v1.5 but i am getting above error
Did you solve the issue, I also have this issue on LO 6.1.2.1 (x64)... Mayby the 64 bit version is the root cause?