reddit / emacs

New package: Lookup Wiktionary entries in Emacs

ilemming · 2022-12-25 03:31
https://github.com/agzam/wiktionary-bro.el [demo](https://i.imgur.com/K1tLmNL.mp4) It doesn't do much yet, just a bit more convenient way to browse Wiktionary entries. It lets you quickly send a request and see an entry without TOC and edit buttons. I'd like to add more features later.
CorysInTheHouse69 · 2022-12-25 07:38
I made some eww wrapper function for this, but it was pretty iffy. Happy to see this made
deaddyfreddy · 2022-12-25 11:04
A kind of related project https://github.com/chenyanming/shrface
github-alphapapa · 2022-12-25 17:15
This looks pretty cool. I wonder if the idea (rendering parts of Web pages using `shr`, ala `eww` but selectively) could be generalized to make it easier to write wrappers to view useful parts of Web pages in Emacs.
ilemming · 2022-12-25 21:13
Well, honestly, [right now] it's probably not much different from what you had. But as I said, I'm hoping to improve this and make it much nicer. I've been using a few packages for my polylingual needs, but somehow I rarely made use of Wiktionary. Recently decided to learn Spanish and now I'm constantly getting fascinated by how different words shaped seemingly dissimilar languages. Wiktionary is a great resource to explore etymologies.
ilemming · 2022-12-25 21:17
Nice. Thank you. I do remember seeing it once, but didn't have an immediate need for it, and I quickly forgot about it.
ilemming · 2022-12-25 21:19
I kinda get what you mean, but I'm feeling dumb and can't expand it in my head. Could you provide an example use case?
CorysInTheHouse69 · 2022-12-25 21:45
I’m studying Russian at my university right now. A few weeks ago I had a massive project to compose a glossary for a text. In a glossary all the words must in either infinitive (verb) or nominative (noun/adjective) form. Wiktionary is a great resource for looking up a word to find the best definition in English and for finding the nominative case. Porting wiktionary to emacs helped me to a task that may have taken a month into two days
ilemming · 2022-12-25 22:31
That sounds wonderful. If you can share some ideas on how to make this little thing better and more practical, please do. I'd appreciate any feedback.
CorysInTheHouse69 · 2022-12-25 22:38
I’ll look over it later and see if it needs anything that I needed
github-alphapapa · 2022-12-26 22:54
Well, any Web site that could be useful to view in Emacs but has extraneous content that isn't useful to show in Emacs (headers, menus, etc).
ilemming · 2022-12-26 23:09
You know about `(eww-readable)`, do you? It's not great though. Would be nice to have something even better.
deaddyfreddy · 2022-12-27 12:13
Well, `w3m.el` had filters, though they were pretty simple (regex based replacements, AIR). These days I would prefer to use a more robust, probably selector-like (think of Clojure library `enlive` or CSS selectors) solution. P.S. So, I'm talking something like, say if we want to render a post vote counter only (`shr-` functions are imaginary ones): (thread-first html (shr-select "#vote-arrows-t3_zupne5") (shr-render-string))
github-alphapapa · 2022-12-28 19:50
Yes, `org-web-tools` makes use of it. Its algorithm works pretty well, but it's not suitable for every site.
github-alphapapa · 2022-12-28 19:51
Some Elisp libraries already exist that implement CSS/XPath-style selectors. I catalogued some at https://github.com/alphapapa/emacs-package-dev-handbook