girzel / ebdb

An EIEIO port of BBDB, Emacs' contact-management package
67 stars 11 forks source link

Develop `ebdb-print` or similar replacement for `bbdb-print` #68

Open swflint opened 6 years ago

swflint commented 6 years ago

Feature request. Let me know how I can help -- I'm more than willing.

girzel commented 6 years ago

That would make a tex/latex version of the records for conversion to PDF, right?

The framework for that is already in place, though in EBDB it's referred to as "formatting" -- you "format" records as text, csv, HTML, LaTeX, etc.

I haven't gone and written formatters for HTML or LaTeX because 1) there are still some complications with the formatting process that I'd like to simplify, namely I want to drop the distinction between formatting a record "header" and record "body", and just have one function for the whole record; and 2) I don't know how to hit the right level of customizability. You could write a LaTeX formatter for EBDB right now, using the existing tools, and it would be wonderful and cleanly abstracted and non-hacky, but it would be an enormous amount of code, and you'd basically have to design the entire process yourself: what person records would look like, what organization records would look like, how each field type would be formatted, etc. Each of these aspects would require you to write a generic function to output the text.

That's an awful lot of work, and not something I would expect users to go through. On the other hand, if I provide a default output, users are obviously going to want to tweak that output, and how do we design something that can be easily tweaked rather than requiring users to throw away the default and start all over again?

So I guess my question to you is, what kind of template would you like to see, and how customizable should it be? How would you like to be able to tweak the output?

Once I've fixed the header/body separation, I would be ready to start writing some default formatters for HTML and LaTeX, but the question of tweaking still remains...

girzel commented 6 years ago

I guess my main question is, should I try to use the customize route to give users ways of altering the output, or is it reasonable to ask them to to write generic functions (given sufficient documentation, of course)?

swflint commented 6 years ago

Honestly, I'd say use the template that bbdb-print uses. It's fairly compact, and it includes a fair amount of information.

girzel commented 6 years ago

Okay, I'll take a look at the output of that, and do something similar for EBDB, and then we can go from there.

girzel commented 5 years ago

Some work done on this in eec63c8b39fb0d7d57391fcc1d82c3dd1d3c001c...