mnelson4 / printmyblog Goto Github PK
View Code? Open in Web Editor NEWWordPress Plugin that simplifies printing your entire blog
License: GNU General Public License v3.0
WordPress Plugin that simplifies printing your entire blog
License: GNU General Public License v3.0
Yes users can already press “back” in their browser, but they don’t know if that will break something (in some other services it does) so it’s probably a good addition.
See https://wordpress.org/support/topic/works-great-if-site-supports-what-it-needs/
It seems a recent update in Foo Gallery made it so their galleries don't appear in print pages. They're just an empty div, and there's a Javascript error.
I work for developer teams. I talk them into using the following zero-coverage tests in CI:
It makes your code robust without writing a single test.
Please consider introducing all three.
A user had an embedded sound cloud page in a post, and so when they chose to print their blog and remove images the images in the embedded sound cloud page were left intact.
I don't think I can control the HTML in embedded pages. So I think the best alternative would be to allow users to remove embedded content (iframes) altogether.
Hyperlinks aren’t very helpful in a paper copy. It would be better to use book-style page references for internal links and footnotes saying the links caption and url. This will probably require printing with prince. See https://www.smashingmagazine.com/2015/01/designing-for-print-with-css/
Copying from @mjluser 's comment on #27 (comment)
Hi Mike! I did not see an issue regarding the plugin's hanging because the REST API had no jason, so I am writing this here. My main site is PhysicsSpot.com, which worked fine. The problem was on the staging (clone) site I had created using the WP Staging plugin. Apparently whatever made your plugin hang was something done by WP Staging. I think you might find what you need in its documentation. As I mentioned, your plugin hung on the "Initializing" display and thus probably never got to the error-display section of your code. Thanks again for the great plugin!
(P.S. I forgot to mention that it only printed the alternate text and the caption for each image. It did not print any images.)
If you prepare a printout and include each posts' URL, and use dotEpub, only the content from one post gets included. Somehow that extra URL psychs dotEpub out.
I think it would be nice if you could create a menu, optionally display it, and then PMB would fetch those posts/pages in the same order as in the menu.
It would be a ton of UI I wouldn’t need to build... I’m not sure if it would be very intuitive to most users though. They would probably rather make the book first (like in Anthologize) then optionally make a menu from that.
On furniturebank.org, they use Avia codeblocks on some pages, which work fine on the web view, but just look like a shortcode in the printout. Eg https://www.furniturebank.org/8049-2/ looks fine, but in the printout for the site, that page has the content [avia_codeblock_placeholder uid="0"]
in it.
That's what's in the REST API response from http://www.furniturebank.org/wp-json/wp/v2/pages/3239, ie
"</div></div></div><!-- close content main div --></div></div><div id='av_section_1' class='avia-section header_color avia-section-default avia-no-border-styling avia-bg-style-scroll av-arrow-down-section container_wrap fullsize' style = 'background-color: #ffffff; background-image: ' ><div class='container' ><div class='template-page content av-content-full alpha units'><div class='post-entry post-entry-type-page post-entry-3239'><div class='entry-content-wrapper clearfix'>\n<div class=\"flex_column av_one_full flex_column_div first \" ><p><div style='height:30px' class='hr hr-invisible '><span class='hr-inner ' ><span class='hr-inner-style'></span></span></div><br />\n<span class=\"av_font_icon avia_animate_when_visible av-icon-style- avia-icon-pos-center \" style=\"color:#e83778; border-color:#e83778;\"><span class='av-icon-char' style='font-size:50px;line-height:50px;' aria-hidden='true' data-av_icon='\ue806' data-av_iconfont='entypo-fontello' ></span></span><br />\n<section class=\"av_textblock_section \" itemscope=\"itemscope\" itemtype=\"https://schema.org/CreativeWork\" ><div class='avia_textblock ' itemprop=\"text\" ><p><a name=\"Donate\"></a></p>\n</div></section><br />\n<div style='padding-bottom:10px; color:#3a3a3a;font-size:35px;' class='av-special-heading av-special-heading-h3 custom-color-heading blockquote modern-quote modern-centered av-inherit-size '><h3 class='av-special-heading-tag ' itemprop=\"headline\" >HELP FURNISH HOPE</h3><div class ='av-subheading av-subheading_below av_custom_color ' style='font-size:25px;'><p>You have the power to transform lives.</p>\n</div><div class='special-heading-border'><div class='special-heading-inner-border' style='border-color:#3a3a3a'></div></div></div></p></div><div class=\"flex_column av_one_full flex_column_div av-zero-column-padding first \" style='border-radius:0px; '><p><div style='height:19px' class='hr hr-invisible '><span class='hr-inner ' ><span class='hr-inner-style'></span></span></div><br />\n<section class=\"avia_codeblock_section avia_code_block_0\" itemscope=\"itemscope\" itemtype=\"https://schema.org/CreativeWork\" ><div class='avia_codeblock ' itemprop=\"text\" > [avia_codeblock_placeholder uid=\"0\"] </div></section></p></div><div style='height:40px' class='hr hr-invisible '><span class='hr-inner ' ><span class='hr-inner-style'></span></span></div>\n<section class=\"av_textblock_section \" itemscope=\"itemscope\" itemtype=\"https://schema.org/CreativeWork\" ><div class='avia_textblock ' style='font-size:20px; ' itemprop=\"text\" ><p style=\"text-align: center;\">Alternatively, if you would like to pay by mail, please download and fill out this <span style=\"text-decoration: underline;\"><strong><a href=\"http://www.furniturebank.org/wp-content/uploads/2015-Donation-Form1.pdf\">Donation Form</a></strong></span>.</p>\n</div></section>\n<div style='height:50px' class='hr hr-invisible '><span class='hr-inner ' ><span class='hr-inner-style'></span></span></div>\n\n"
I was suspicious it was just because there was related Javascript which wasn't getting loaded, but I don't think that's the whole story. When I load the page without javascript, the pretty donation form isn't there, but nor is that shortcode. So there's something more going on here than just missing Javascript, but that's certainly a big part of it.
I suspect this issue goes beyond just Avia, it probably affects any blocks or shortcodes that depend on JS or CSS.
Ideally, the WP REST responses would include what JS and CSS are needed to display them properly, so the JS could include them dynamically. It sounds like something similar happened on WordPress/gutenberg#9734 and https://core.trac.wordpress.org/ticket/46138
The "print page" just uses the site's index, plus some key query parameters. This has worked fine but has a couple downsides:
It would be better to instead use the same idea as I saw another print plugin use: use the post's URL and tack on "/print" to it.
Or maybe even rewrite the URL (I think that's a newfandangled feature of browsers...)
This was requested on #57 and https://wordpress.org/support/topic/print-pdf-code-to-add-to-specific-pages/
Optionally show custom field values (like those created with ACF) like categories etc.
It’s possible this should be in a separate add-on, because the code won’t benefit most users, I think.
See https://wordpress.org/support/topic/advanced-custom-fields-support-10/
Probably add a select2 input so you can choose which categories or terms to print. This will be a little trickier with wp rest api proxy, but doable.
Mentioned on https://www.reddit.com/r/Wordpress/comments/es1plc/easiest_way_to_export_edit_and_print_hundreds_of/
When you embed an open street map, it's blank. I think its Javascript isn't loading.
(Although onauraitdu.com is often actually using the embedded iframe from OSM
When content has big images that we try to not separate, it can become difficult to tell when a new post starts, even if they always start on new pages. Dan Kershaw suggested
a 10% shade of grey above the content with the post id, url and title makes sifting through 500 pages much easier (when you see a grey bar you have a new post/page
It would be nice to allow folks to save their settings. Maybe even have projects.
Please clean up merged branches
https://github.com/mnelson4/printmyblog/branches/all
There are few with +1 or +2 commits...
The browser extension/javascript bookmarklet dotepub (from https://dotepub.com/) should take care of converting a web page into an ePub or mobi file for e-readers (like requested on https://wordpress.org/support/topic/epub-printing/). But it's got issues...
It only includes the first "article", and is missing a lot of h1 h2 h3 tags etc.
Not to mention it gets angry at having more than a dozen images.
Right now, if non-JSON gets into the REST API JSON responses, everything stops working. It would be nice if, instead, we just ignored the non-JSON part. I believe I saw WooCommerce was doing this once.
Eg, it seems WPTouch was echoing out a script before the REST API response on http://siliconvalley.sla1.org. While it's true they shouldn't be doing that, it would also be nice if we could just live with it, because it's bound to happen.
It would be good to be able to only print posts in a date range,
Some servers, like mentioned on https://wordpress.org/support/topic/feature-request-print-posts-in-specific-category-or-tag/#post-11291402, are refusing REST API requests sent through REST API proxy.
So far, it seems to be because of the user agent and possibly not accepting cookies.
On my blog, a user suggested they'd like to use Print My Blog to print individual posts, preferably with a link so site visitors could print them.
Doing so would require:
This would move Print My Blog into competition with other plugins like Print Friendly. While its a bigger market, it's not exactly following the plugin's mission (preserve blogs). Also, users of that feature will want other features and it will complicate other things; so I don't want to do it unless it somehow forward the plugin's mission.
I've been doing some comparisons to the most popular print plugin, Print Friendly, and it really does quite a satisfactory job, in my opinion. (One exception: when you put images into columns, it only shows the first column's image. I bet there are other issues with it.)
We’d like to have sections for each category. Like suggested here: https://wordpress.org/support/topic/excelente-1937/#post-12541963
Right now, dates are shown in luxon's default format. Lea requested (on https://wordpress.org/support/topic/option-to-print-comments-too/) that they be in the site's format, and that comments include the time format.
I doubt many people realize the Gutenberg block exists. That should be documented somewhere
Rather than asking users to activate dotEpub etc, why not include its Javascript, like in the dotEpub plugin? (Should probably double-check Xavier wouldn't mind, but it's technically OK)
Foogallery has an option to lazy-load images. So does JetPack. These are good ideas for web view, but annoying in a printout, because you need to manually scroll through the entire page.
I previously asked FooGallery support about this (see https://wordpress.org/support/topic/printing-responsive-galleries/), but they seemed to start talking about a different problem and then concluded it wasn't possible.
I think I just need to programmatically invoke whatever function they use to load the images, or scroll through the page automatically, or at very least warn users that if they have lazy-loaded images, they need to scroll through the entire printout before pressing print.
Some folks may be confused when they requested a page to have a page break between posts, but don't see one in the browser "preview" (print page).
We could either have a notice at the top of the page saying "The preview below doesn't show page breaks; but don't worry, the actual printout will have them."
or, after each post, have a big white space, possibly with some greyed-out text saying "page break here."
I'm using a lot of images at medium size, which fit side-by-side on my blog on one line.
However when I print using the plugin, every image is on a separate line even though there are no line breaks in the source code of my blog between those pictures.
I'm using the Twenty-Twelve Theme and I am using FooBox plugin, but the plugin generally only affects when you click on an image, not the medium size in the post itself.
Dan Kershaw suggested
Beneath a photo/image include the URL to the Media asset – out media space is equally messy!
I wonder if instead being able to list media post types (as opposed to just posts and pages) would also fulfill this need?
Hi Mike,
very exiting plugin. Just a got a request from a customer to print certain posts from my blog: https://digitales-fuer-einsteiger.de/das-ideale-smartphone-fuer-einsteiger/
So I installed your plugin and in generals it shows perfect results.
The only request I would have is to place the print/PDF button below the post and not above. Is there an option for?
Regards, Uwe
When I try to print, I get a single page that says "Printout of https://brooksidepress.org/cartmell, generated on December 21, 2018 using "Print My Blog" plugin. " None of the other several hundred pages on the site are printed.
I just downloaded it and installed it a few minutes ago.
Website: https://brooksidepress.org/cartmell
MacOS Mojave 10.14.1
Chrome and Firefox both gave the same results.
I'd really like this to work. Can you help?
Hello
I've traveled a lot and have a wordpress site with many picrutres using FooGallery.
Is there any possibility to get the FooGallery running with print my blog?
In the PDF it shows the code for the Gallery - for Example:
[foogallery id="123"]
Cheers
Fabio
Some folks might want different print options per post. So having a meta box on post editor, or a Gutenberg block, would be nice.
See https://wordpress.org/support/topic/how-to-print-only-one-page/#post-12421626
Thanks for Print My Blog. We are shortly closing down six years of blog posts by several authors. I have created a PDF for each year but they don't show authors. Also, would really like to create a PDF for each author. Any chance? Thanks.
All the options for the print page are in the querystring. That's convenient, but some servers think that's a security issue and so will refuse requests (see https://wordpress.org/support/topic/this-page-isnt-working-18/).
It would be nice if we could instead use a POST, save the settings to the session or something.
It would be great to have a table of contents, showing page numbers of posts or something. It’s doable with CSS, but not all browsers support it. See https://alistapart.com/article/boom
With a form to easily signup. Like this:
<!-- Begin Mailchimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own Mailchimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="https://blog.us19.list-manage.com/subscribe/post?u=5881790528ea076edfc10d859&id=32ccd044c3" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<div class="mc-field-group">
<label for="mce-FNAME">First Name </label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address </label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_5881790528ea076edfc10d859_32ccd044c3" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
<!--End mc_embed_signup-->
I see PressBooks recently added support for MathJax. It seems like a fairly important feature for academia, so it may be nice to add.
I have 3222 blog posts. I've tried Safari and Chrome to export as a PDF and Print and both don't work. It would be nice if I could select a date range, this would help keep the file size down.
When users decide to make images smaller so they don't take up the full width, they all turn left-aligned and look a little ugly. Maybe centering them and/or padding them would help.
I'd need to be careful though to not break image galleries or images that are small enough to fit side-by-side normally.
On the print page, it asks “what do you think?” With 3 different smiley faces. And depending on their reply, we suggest the user either donate, review, or report an issue. That should probably be optional
Right now, the Javascript is using arrow functions which aren't compatible with older browsers. But if I were to use babelJS, it would transpile my code so it can be used by older browsers.
This may be of help: https://make.wordpress.org/core/2019/03/25/building-javascript/
Instead of only including specific categories og posts, I'd like to exclude specific categories
Similar to #6, except have a select2 for finding an author, and then add that as a filter on the printout page. Probably just an hour or two of development.
It seems dotepub doesn’t work well with print my blog. I may need to convert to ePub and mobi files myself. Here is a short tutorial on how to do that: https://www.lifewire.com/create-epub-file-from-html-and-xml-3467282
Right now, the print page defaults to ordering from oldest to newest; whereas some folks (eg https://wordpress.org/support/topic/very-impressive-69/#post-11632786) may want it the other way around.
Embedded YouTube videos in posts can look pretty bad (solid black for me, horrible on ink). It would be nice to automatically replace them with a screenshot from the video, and a link to view it
Would you welcome a feature that deploys printmyblog to WP.org when * Version: 2.1.3
changes in the main plugin file?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.