-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add parsebib-clean-TeX-markup #21
Conversation
... along with the associated parsebib-TeX-markup-replace-alist, though converted to a defvar, since this isn't a user-facing package. Close joostkremers#19
JSYK, The ebib version of this function and associated variables changed a bit recently -- you might prefer to copy/alter that version (or you might not 🤷). |
OMG; that was a total oversight on my part; I wasn't paying attention to getting the current version. Seems it changed more than "a bit" though!! Edit: I guess a lot of that was test code though. I'll let @joostkremers weigh on on what he wants to do. |
Heh, good question. Ideally, this stuff should only be implemented once, of course. So if we want AFAICT it would be possible to simply move The question is just what to do with Normally, I'd want to keep it a user option, which means duplicating it in Ebib and However, in this particular case, perhaps we don't need to do so. I mean, even though So I would move I would like to have some customisability, though, so perhaps we can introduce an option Another question is the integration of this new The actual clean-up should be done in |
I support @bdarcus original motivation for including this function in parsebib (as opposed to ebib). I'm less sure about the stuff quoted above. Parsebib is a parsing library -- it's principle function is to get information written in a structured file and return it in a structured lisp object. And the information in the file has the markup in it, not the cleaned up text. joostkremers/ebib#238 and joostkremers/ebib#248 were intended to make presenting that data prettier. I'm worried that including cosmetic functionality in the parsing functions might might make it harder to access downstream. This is a long winded way of saying that if there's a boolean option to clean up when parsing, it should be off by default. |
But parsebib already includes functionality to make the data more presentable: Returning entries for display. This is basically just an extension of that. Ebib doesn't use any of this cleanup functionality, because it needs the exact contents of the
Well, it's up to the caller to decide which kind of cleanup parsebib should do, if any. Obviously, when Ebib opens a |
Exactly. For context, here's the original citar issue that led to this emacs-citar/citar#535. The sequence is:
So it naturally seems the best place to put this code here, so that each project should rely on the same function, rather than reimplement. But as you can tell, I didn't realize the additional complexity :-) PS - I should also note emacs-citar/citar#532, on name-parsing and formatting. Not sure where that would have to happen to work correctly, but probably here. BTW, I find parsebib really useful, since I don't have to worry about low-level formatting details, and just call fields to display. |
Also, we currently have a |
I don't think it's that complex. I started implementing it, should have something testable in a few days.
It would at least be in line with the "prettify for display" functionality that parsebib already has. For JSON name fields there is already something similar: https://github.com/joostkremers/parsebib#parsebib-json-name-field-template. |
I just mean for someone not familiar with the codebase :-)
Great! In that case, I'll close this.
A difference, however, is CSL JSON name representation is a structured object, while bibtex is a string. |
... along with the associated parsebib-TeX-markup-replace-alist, though
converted to a defvar, since this isn't a user-facing package.
Close #19
I didn't touch ebib; figure you can remove that independently, as you wish.