chnm / anthologize

Anthologize is a free, open-source, WordPress-based platform for publishing. Grab posts from your WordPress blog, pull in feeds from external sites, or create new content directly in Anthologize. Then outline, order, and edit your work, crafting it into a coherent volume for export in several formats, including PDF, EPUB, and TEI.
http://anthologize.org
GNU General Public License v3.0
174 stars 28 forks source link

Include post dates in export? #100

Closed mnelson4 closed 5 years ago

mnelson4 commented 6 years ago

In my case, I thought I might like to include the post dates for each item in the export. I created my blog first, and am just wanting to easily make a PDF backup of it that I can print and put in a vault somewhere. So, I'm really wanting a PDF version of my blog, along with information like when the blog posts were created. So it might be good to add this as an option to the export page. Thoughts? Suggestions on how to implement?

boonebgorges commented 6 years ago

I like the idea. As a rule, when including new data in the export, you have to do a couple things:

  1. Ensure the new data is being populated into the TEI layer. See eg https://github.com/chnm/anthologize/blob/42233eb0577d8edbde14a6989551aa949776c8f2/includes/class-tei-dom.php#L50
  2. Add a getter to the TEI API: https://github.com/chnm/anthologize/blob/0.7.x/includes/class-tei-api.php
  3. Put into each of the output formats
mnelson4 commented 6 years ago

thanks for the pointers! I think this might be a good ticket to get more started. I think we'd want this to be optional, because I can see some folks not wanting dates at all.

boonebgorges commented 6 years ago

I've got a client request to do this, in addition to some other data, like authors, tags, categories. See also #62. I was thinking that maybe we can come up with a new option for the export panels that looks something like this:

Item metadata           [ ] Author name 
to include in export    [ ] Tags
                                  [ ] Post date

etc. If you end up having a look at this ticket before I do, be sure you work against the 0.8.x branch. If you can't get to it, it looks like I'll be finding some time myself in October.

mnelson4 commented 6 years ago

yeah I'd like having checkboxes giving basic control over this. I bet some folks will want more control though, but in that case there's a template file they can overwrite right? Yeah I'll update this ticket once I manage to look into this some more.

boonebgorges commented 6 years ago

There's no template file to overwrite, because TCPDF is used. This library makes it very hard to control output.

I've started work on implementing this and #62. It's technically complex because of the TEI middleware, but I think I have it working in a way that mostly makes sense. Here's what the admin panel looks like during export:

screenshot_2018-09-26_21-23-35

and then here's an example from the export itself:

screenshot_2018-09-26_21-24-19

I've chosen to combine these items onto a single line, centered, just below the title. This is not flexible, but it matches the conventions we've currently got.

Tags/categories are not currently included. For historical reasons, Anthologize collapses the two into "subjects", and IMO it'd be weird to show a "subjects" section here when there's no "subjects" in the original post. If there's a huge push for taxonomy support, which I doubt, we could add it later on.

@mnelson4 what do you think? @amandafrench Better late than never?

mnelson4 commented 6 years ago

If there's a huge push for taxonomy support, which I doubt, we could add it later on.

Yeah, I say let's add it later.

I think this is a good general layout in the document.

One question: why is this only for PDFs? This seems like an option that should be available for all formats, no?

boonebgorges commented 6 years ago

Thanks for the thoughts!

One question: why is this only for PDFs? This seems like an option that should be available for all formats, no?

Because it's the only one I built. The output formats are all totally independent of each other, and I prototyped with PDF. If this looks good, I can see what would go into implementing across the formats.

mnelson4 commented 6 years ago

If this looks good, I can see what would go into implementing across the formats.

No worries. Personally, I'm primarily interested in PDF exports too anyway (they seem the most widely used). So I wouldn't be distraught if this only works for PDFs.

(It would be interesting to know how much the other formats are actually used. If they're very rarely used, we might consider having them exist as add-ons to keep Anthologize core a little leaner...)

boonebgorges commented 6 years ago

I'm going to move forward on this for PDF in order to get something out there.

boonebgorges commented 6 years ago

Merged as part of #105. I'll open a separate ticket for implementing in different export formats.

mnelson4 commented 6 years ago

:+1:

boonebgorges commented 5 years ago

Let's continue the conversation at #110.