jmzambon / libreoffice-code-highlighter Goto Github PK
View Code? Open in Web Editor NEWCode snippet highlighter for LibreOffice.
Home Page: https://extensions.libreoffice.org/en/extensions/show/5814
License: Other
Code snippet highlighter for LibreOffice.
Home Page: https://extensions.libreoffice.org/en/extensions/show/5814
License: Other
When I try to highlight LLVM code, numeric labels which are followed by a same line comment are removed. This is problematic since a lot of generated LLVM code I've seen uses numeric labels and has comments to give the predecessor blocks.
Example:
define i32 @foobar(i32 %0) {
; this label is fine
start:
%1 = icmp eq i32 %1, i32 0
br i1 icmp, label %exit, label %10
; this label disappears
10: ; if a comment is here
%2 = add i32 %1, i32 1
br label %exit
; this label is fine
exit: ; even if a comment is here
%3 = phi i32 [ %1, %start ], [ %2, %10 ]
ret i32 %3
}
Or more realistically:
33: ; preds = %147, %4
%34 = load i32, ptr %7, align 4
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %150
Hey, I noticed that the input fields aren't really visible when dark theme is enabled (I believe the theme is taken from OS by default, so this might affect quite a few people).
I think adding white edges to the fields would fix this:
I can see the fields are visible with light mode, though (dark) edges for them would help here too, imo:
Hi, would it be possible to add a feature to pad line numbers with zeroes?
I think either to fixed number of digits or dynamically to the largest number of digits used would be fine, but the possibility of choosing between these two would be absolutely perfect.
Hey, would it be possible to modify the code to use Character styles instead of Direct styles?
I believe when using Direct styles and saving to .fodt, all Direct styles are assigned random unique names, which makes it much harder to properly version with git, whereas all usages of a Character style use the same name.
Hello,
I tried just now, to highlight a Python code I put as a plain text on my LibreOffice Writer.
The Redo the higlight and the cancel show me both an error, and the normal Highlight Code didn't show me any dialog box about the code I have to highligh.
Here's the actual configuration of LibreOffice
Version: 7.4.1.2 (x64) / LibreOffice Community
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: threaded
I use the Code Highlighter 2 version: 2.4.3, the latest I just dowloaded
My Windows Config:
Nom de l'appareil PC-CLEMENT
Processeur Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz 2.50 GHz
Mémoire RAM installée 6,00 Go (5,88 Go utilisable)
ID de périphérique B49A283B-7CCE-4920-859D-62D5BB92E3B6
ID de produit 00330-80000-00000-AA890
Type du système Système d’exploitation 64 bits, processeur x64
Stylet et fonction tactile La fonctionnalité d’entrée tactile ou avec un stylet n’est pas disponible sur cet écran
Édition Windows 10 Professionnel
Version 21H2
Installé le 08/10/2020
Build du système d’exploitation 19044.2006
Expérience Windows Feature Experience Pack 120.2212.4180.0
Thank you for the help
Merlode
Would it be possible to show preview of the Highlight Style (colors, mainly) somewhere? (There is noticeable empty space on the right)
I assume I must not be the only one who has no clue what the difference between borland
, lovelace
and vim
is, and just going through all the styles until I find one that is not terrible seems like uneffective usage of my time.
Having an option to modify the styles would be nice too, actually, since the style may be almost perfect, but perhaps might look nicer with strings highlighted in different color, or what have you.
Hi, sorry for not responding for a bit, I was really busy.
I updated the extension today through the LibreOffice's extension update tool, but the menu buttons unfortunately don't seem to work anymore, I no longer get the window when clicking the first one, nothing happens on either. I assume it does work for you, in which case it might be the fact I'm using LibreOffice 7.6, or perhaps it broke because of the update tool? Should I try to reinstall? But perhaps there might be some debug info if I ran LO from the console or something, not sure 😅
fyi https://github.com/pygments/pygments/releases/tag/2.13.0
Updated lexers:
StarOffice Basic (pygments/pygments#2170)Added styles:
StarOffice (pygments/pygments#2168)
See title, basically. The readme states that the highlighting happens via "Tools", but it is only from the screenshots that it can be seen that that seems to have moved to "Format".
Hi, I am trying to include some Juia Code on an Impress document. A first (julia) function works fine, but for the next one (shown below), highlighting is all over the place, and some (unicode) characters get mangled, like the italic t and the italic ig.
function Projection(tax_rate,
tax_credit_0,
cap_mkt::CapMvkt,
invs::InvPort,
liabs::LiabIns,
liabs_other::LiabOther,
dyn::Dynamic)
## 1. intialisation
proj = Projection(liabs, tax_rate, tax_credit_0)
## 2. boucle sur les années jusque horizon des passifs
for 𝑡 ∈ 1:liabs.dur
## 2.1 boucle dumy sur les couts fixes
for 𝑖𝑔 ∈ [:IGCash, :IGStock,:IGBond1]
proj.fixed_cost_gc[𝑡] +=
invs.igs[𝑖𝑔].cost.abs[𝑡] *
invs.igs[𝑖𝑔].cost.cum_infl_abs[𝑡] *
liabs.gc[𝑡]
end
end
##
## 3. traitement des dettes, going oncern etc
l_other = deepcopy(liabs_other) # 3.1 les dettes sub.
goingconcern!(l_other, liabs.Δgc) # 3.2 modifie l_other.sub,tq la dette s'mortisse en ligne avec liabs.gc
## 4. initialisation - fin
val0!(cap_mkt, invs, liabs, l_other, proj) # 5 val0! intialise tpg par itération sur les mp,puis dettes l_other
# et invest(la valeur) et le surplus ie différence
proj.cf[:,:gc] = liabs.Δgc * (proj.val_0[1,:invest] - # 6.initialisation proj.cf[:,:gc] avec valeur en [1]
proj.val_0[1,:tpg] -
proj.val_0[1,:l_other])
## --------------------- 7. la vraie boucle de projection du bilan
for 𝑡 = 1:liabs.dur
project_bs!(𝑡, cap_mkt, invs, liabs, l_other, dyn, proj) # 8 appelé une fois par année de projection ici p2.
end
## --------------------- 7. fin
## 9. post traitement de partage avec les assurés.
valbonus!(cap_mkt.rfr.x, proj) # 10 MAJ du champ (prov pour) bonus des dataframes p.val, p.val_0
valcostprov!(cap_mkt.rfr.x, invs, proj) # 11 MAJ du champ cost_prov des dataframes proj.cf , p.val, p.val_0
return proj
end
```
For the curious, the code is coming from this site https://github.com/mkriele/ValueOrientedRiskManagementInsurance.jl
And thank you for the extension!
Changing a style is an easy way to update a document without reprocessing the whole document. This is especially an issue with mixed coding language documents.
The office:automatic-styles are not accessible in the LibreOffice user interface. Pygments can support a css stylesheet.
Options:
See #7
Hello
I am using code highlighter for golang, but string doesn't detect
Golang has two types of strings
now string by backticks detection, but by double quotes don't detection
The user selects the lexer [language] manually, or Pygments can guess, but the lexer is not saved. It would be useful to save the lexer with the snippet and allow Code Highlighter 2 to read a tag associated with a snippet (eg similar to markdown tagging code blocks with language) :
Can the wiki be enabled for developer notes?
!
In Libreoffice 6.4.7.2 (Kubuntu 20.04 LTS), there are no "Highlight Code" options under the "Tools" section, even though the extension installs successfully.
Distro: Fedora 35 Workstation
Error message:
Error while installing extension Code Highlighter 2. The error message is: Cannot detect media-type: file:///tmp/STi7Zu_/NVcmI1_/b39f3a31-6a1e-41fc-bcdd-aee458de120f /builddir/build/BUILD/libreoffice-7.2.5.2/desktop/source/deployment/registry/dp_registry.cxx:481
The extension will not be installed.
Info:
Version: 7.2.5.2.0+
Build ID: 20(Build:2)
CPU threads: 4; OS: Linux 5.16; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
For now, I'm installing this from outside LO. Please do fix this so that it doesn't break for future updates.
I thought, maybe i needed that python script provider thing, but i couldn't find anything on my Mageia distro, and no information on what kind of files would be installed, if i had this or not.
I figured, i just find a verbose log option and see what happens, but libreoffice seems to fork after startup and logs seem to be disabled when compiling it...
Please help me, is there really no log to just see what happens when i click the hightlight menu item? and what kind of files/plugins/libraries should i have if that python provider thing is installed?
What changes does Code Highlighter 2
make to the Writer files? I assume it hard-formats the code color rather than applying styles. Please explain in README.md.
Code Colorizer Formatter as a comparison:
I use specific paragraph styles for my code examples. The currently supported paragraph styles are "_OOoComputerCode", "_OOoComputerCodeInTable", "_OOoComputerCodeLastLine", "_code", "_code_first_line", "_code_last_line", and "_code_one_line".
It looks like there is no style to match lo basic and a new style is needed:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.