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

One-Click Quick Create Project and Export #102

Closed mnelson4 closed 5 years ago

mnelson4 commented 6 years ago

Short story: I'd like to have a one-click option to dynamically create a project, add all the site's blog posts to it, order them by date published, then export to a PDF. I'm thinking that, at least initially, this would probably best start as a separate plugin that piggy-backs on Anthologize, but it could later be merged into the main plugin.

I'm creating an issue here to see if there's any suggestions on how to do this.

Background: there seem to be quite a few low-tech bloggers interested in printing off their entire blogroll as a means of preserving it (eg see https://www.retirementreflections.com/how-will-you-preserve-your-blog/). They're wanting it as a physical backup which they can store in an attic or vault somewhere, and people can still read it in 50 years, by which time their WordPress website may have been taken down and it may even be hard to read a database backup. They're mostly just interested in a simple one-click solution. At least initially, they're probably not interested in too many options. (And if they do become interested in customizing it, etc, that's when they should use the regular project manager and exporter.)

boonebgorges commented 6 years ago

Thanks for your patience as I got around to giving this ticket some thought :)

Anthologize may be overkill for what you want to do here. Anthologize puts a bunch of infrastructure between WordPress and TCPDF (in addition to other export formats, but you're just interested in PDF). From a technical point of view, the easiest thing is probably to use TCPDF directly. You can crib a lot of the process from https://github.com/chnm/anthologize/blob/master/templates/pdf/class-pdf-anthologizer.php.

If you want to build on top of Anthologize so that you can gradually add features in the future, the best way is probably to generate an 'anth_project' programatically, then add 'anth_part' and 'anth_library_item' items as needed, and send the whole thing to the PDF exporter. See https://github.com/chnm/anthologize/blob/master/templates/pdf/base.php;

mnelson4 commented 6 years ago

Thanks for your patience as I got around to giving this ticket some thought :)

No worries, I realize I can't expect overnight turnaround for free!

I bet some folks will want other export formats than PDF, so it would be nice to piggy back on Anthologize for that.

I think I'll try creating an anth_project etc. I'll update this ticket with a link to the repo once I have one :slightly_smiling_face:

mnelson4 commented 5 years ago

FYI so far, I ended up taking your advice that Anthologize might be overkill, and I’ve ended up making a separate plugin: https://github.com/mnelson4/printmyblog It just sends the admin to a front end page, shows a “preparing blog for printing...” message, uses the rest api to load all the blog’s posts in the background, and then provides a button to print the page (uses some print css so the print button isn’t in the printed page). I realized that, for my use-case, even PDF wasn’t necessary! I just want to facilitate exporting a digital blog to a physical copy (print). So, I think my scope is much narrower than Anthologize’s. If anyone ever uses the plugin. and they start asking for all the same features as Anthologize, my plan is to just refer them here. I blogged some initial plans about it here: https://cmljnelson.wordpress.com/2018/10/09/how-to-print-your-blog So I think that will satisfy my need, so, for now, closing this issue. Thanks for the tips @boonebgorges!

boonebgorges commented 5 years ago

Awesome, this is a nice clean implementation! Thanks for sharing your work back - I may leverage what you've built in future projects, as one-click printability is something that lots of clients ask for.

mnelson4 commented 5 years ago

🤩