-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
light formatting of candidates #393
Comments
There's currently nothing that supports faces in bibex-completion. There was recently an issue about this about, but (I think) but there was no proposal for a clean (and easy to configure and maintain) solution. I think the Emacs ecosystem is in desperate need of an api for formatting tables. It's so silly that a million of helm sources (also mu4e, etc.) have to solve this problem over and over again but there is no general solution for that. |
ok. Thanks for the update. I have hacked something that supports org-syntax in bibtex-completion-display-formats. It is not super fancy, and doesn't really support colors, but gets me bold, italics and underlining. That is pretty lightweight. I guess two other options could include html formatting (I am not sure how these would be fontified exactly), or maybe with ansi color codes? With a little work, I could get this format (not sure the ansi codes will show right)
to look like this with the ivy-transformer (guess it could be pushed in to bibtex-completions if you were interested in it. I did have to hack |
Neat! But Ansi color codes is perhaps not something that the average user is familiar with. |
That is fair, I was just looking for some options. Here is another approach that I am not sure is better with an ivy-transformer. The format of the entry is a list of pieces and properties that get put together.
this ends up like this: this works well on ~3K bibtex entries. It still needs some work, but seems to have some potential perhaps. |
This looks really nice! I think the current system for configuring the presentation has served us pretty well so far but it's reaching its limits. I think we need some way to configure the presentation that's more idiomatic in Elisp and that doesn't rely on a custom DSL. Not saying that I will work on this anytime soon, but this issue here is really helpful in developing some ideas. |
I am converging on a good way to do this I think. Here I use the shr library to render html in the format strings.
renders like this It is still not perfect, e.g. you can't conditionally add a comma at the end if there are keywords, but not if there are not. Also it seems to do the wrapping for you, I guess that could be changed perhaps. Maybe there are some alignment issues to work out. I guess getting it "just so" will require some kind of DSL though. |
Good idea to use shr. Some DSL that could also be used elsewhere would be nice. |
#375 is likely relevant. |
Is there a way to add faces to parts of the candidates, e.g. make the authors be italicized, or add colors to the journal name, etc. this could make it easier to see different parts of the candidates.
update: I have used an ivy transformer to fontify optional org-syntax in bibtex-completion-display-formats. I guess you could also do something similar with html markup in these. This can be handled outside of bibtex-completion, but I still wonder if you have any ideas other than these.
The text was updated successfully, but these errors were encountered: