Exporting full blog to an epub book
-
June 13, 2020 at 12:10 pm #3044[anonymous]
Greetings. There many WordPress plugins which convert the blog into an epub ebook for offline reading. So there certainly is demand for download a website once and read forever even without internet. There is excellent search, font resizing, soothing page background colors, brightness settings, go to navigation, thumbnail navigation, table of contents, bookmarking, notes, etc. features in almost all ebook readers nowadays like iBooks, Google Play Books, etc. etc.
The epub format is also based on xml/html etc. So if any time in the near or far future if you can kindly add this awesome feature in Publii of exporting all the posts in a blog into its own epub ebook with the post titles showing in the epub TOC. It would blow all the ebook publishing softwares out of the water because in Publii we are getting a very pretty (many themes) static html seo-optimized website also as a very huge bonus.
So just write once in Publii and publish it as a fast website and a epub in one shot.
You could even charge for this Publii epub export as a premium feature which all of us who need it can pay for. I am also willing to donate to support the development of this epub export feature. Thanks.
June 16, 2020 at 7:15 am #3073[anonymous]Hi NitaaiKumar,
How good are you at programming? Such functionality can be easily created yourself: you query the “posts” table (in db.sqlite = sqlite3 database format, open and free) and dump it into some format of your liking. I programmed a VBA script which exports all my posts to individual PDF files. I guess something similar could be done for epub format.
Mathias
June 16, 2020 at 7:29 am #3076[anonymous]Wow Mathias. I can’t program at all. I would not know how to do it myself. Thanks for sharing. You are kind. Great to know. Plus I may be wrong but such scripts could be written for Publii on Windows but not on Macs?
From my side, why I preferred an epub over a pdf is because most pdfs are not optimized to be read on mobiles due to their A4 or similar sizes, whereas we know 80% of the world’s audience is on mobiles anyway. They need a lot of pinch and zoom in such a case. Plus having separate pdfs for each post would need them to save so many pdfs separately. Whereas epubs can easily go to 1000s of pages in very lightweight xml pages I think along with all the features I mentioned above, which are not possible in pdfs.
Wish Bob and Tomasz create a paid plugin for epub export too after the plugin functionality is live in Publii. People pay so much for buying epub and website creator softwares at the same time. So they will certainly buy this epub export plugin.
January 5, 2023 at 2:19 pm #9058[anonymous][anonymous] wrote:Hi NitaaiKumar,
How good are you at programming? Such functionality can be easily created yourself: you query the “posts” table (in db.sqlite = sqlite3 database format, open and free) and dump it into some format of your liking. I programmed a VBA script which exports all my posts to individual PDF files. I guess something similar could be done for epub format.
Mathias
Hello!
I am looking for a possibility to print out my blog. All plugins and tools I have tried so far failed (they all had problems with the pictures). Mathias, are you still here? If so, may I ask you to send me your script, so I can give it a try?
Regards!
ThomasJanuary 6, 2023 at 10:27 pm #9075[anonymous]Here you go (VBA for MS Access, posts table mapped – I built a query qry_posts1 to add in some additional columns):
—
Option Compare Database
Sub maakArchieven()
Dim dbs As DAO.Database
Dim rst As DAO.RecordsetDim map As String
Dim titel As String
Dim htm As String
Dim bestand As String
Dim info As StringDim WordApp As Object
Dim oField As Fieldmap = “C:\Users\mak\Sync\MVA\Volkskunde\Loenhout\Gezinsreconstructies\VoorRijksarchief\PDF\”
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(“qry_posts1”, dbOpenDynaset)
rst.MoveFirstWhile Not rst.EOF
titel = rst!Title
bestand = rst!slug
If Right(titel, 13) = “(OA Loenhout)” Then
htm = rst!Text
info = “<p>Archiefbewerking door ” & rst!Name & “.<br>”
info = info & “Document aangemaakt op ” & Date & “.<br>”
info = info & “De meest recente versie is te vinden op http://www.geschiedenisvanloenhout.net.<br>”
info = info & “Digitale verwerking door Mathias Van Aken.<br>”
info = info & “—————–</p>”
htm = “<html>” & info & htm & “</html>”
Open map & bestand & “.htm” For Output As #1
Print #1, htm
Close #1
Set WordApp = CreateObject(“word.Application”)
WordApp.Documents.Open map & bestand & “.htm”
WordApp.Visible = TrueWordApp.ActiveDocument.Fields.Unlink
WordApp.ActiveDocument.Range.Find.Execute Replace:=wdReplaceAll
With WordApp.Selection.Find
.Text = “| * |”
.Replacement.Text = “”
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
WordApp.Selection.Find.Execute Replace:=wdReplaceAll
WordApp.ActiveDocument.saveas FileName:=map & bestand & “.pdf”, FileFormat:=wdFormatPDF
WordApp.Quit SaveChanges:=0
Set WordApp = NothingEnd If
rst.MoveNext
Wendrst.Close
Set rst = NothingEnd Sub
Public Function ReplacePattern(ByRef iString As String, iSearchPattern As String, iReplaceWith As Variant)
‘—————————————————————————————
‘ Procedure : ReplacePattern
‘ Purpose : Searches a string by pattern and replaces the text with given value
‘ Returns : Replaced string.
‘—————————————————————————————
‘Dim RE As Object
Set RE = CreateObject(“VBScript.RegExp”)RE.ignorecase = True
RE.Global = TrueRE.Pattern = iSearchPattern
iString = RE.Replace(iString, iReplaceWith)
ReplacePattern = iStringOn Error Resume Next
Set RE = NothingEnd Function