Page 1 of 1

Plugin idea: text file import

Posted: Sat Nov 17, 2012 1:38 pm
by yellowled
So this might be another one of those ideas which not too many users might actually need or want. It might as well be already possible without me being aware of it. If so, don't hesitate to laugh at me. :wink:

I love Markdown. I'm not even sure whether I actually love Markdown or just iA Writer, but either way, they're a comfortable combo to write blog articles with. There are other markup languages like Textile or BBCode as well as tons of other popular editors and writing apps.

Also, to my knowledge there still is no comfortable blog editor for use with s9y available on most platforms. There probably never will be a specific “offline” editor for s9y anyway, so we might as well think about other options to “emulate” something like that.

So what I have in mind is a plugin which would check a dedicated directory in the s9y installation (i.e. templates_c/entries/ or something) for new text files periodically (Do we need cron for that? cron might not be available for most shared hosting users). If it finds new text files, it puts the contents of said files in new entries and publishes them. These files could contain any compatible markup – HTML, Markdown, Textile, BBCode, even plain text. They would probably need to have some kind of header to contain meta data like entry title, author, date, tags etc.

Users could write these text-based entries offline in their favourite text editor and upload them using their preferred or available method (ftp or ssh). Maybe (but this is a bit optimistic, I guess) the plugin could also be able to pull files from a Dropbox?

Is this feasible? Anyone up for it?

YL

Re: Plugin idea: text file import

Posted: Sat Nov 17, 2012 4:19 pm
by onli
Hi YL
I like the Dropbox-idea. They just extended their api in that direction. One should probably use dropbox more anyway, for example for the media library.

Apart from that, two remarks:
1. for reliably periodical checking we need cron. I simulated cron based on pageloads for the trackback-plugin, but that is not reliable (for not-high-traffic blogs), but if someone is willing to work on this, that could be of some help.
2. I was under the impression that Grischa put quite some work in the xmlrpc-plugin, so the premise that there is no comfortable blog-editor could be wrong. Though I don't know a specific one which is good and should work.

Re: Plugin idea: text file import

Posted: Sat Nov 17, 2012 9:48 pm
by yellowled
onli wrote:I was under the impression that Grischa put quite some work in the xmlrpc-plugin, so the premise that there is no comfortable blog-editor could be wrong. Though I don't know a specific one which is good and should work.
I remember testing a GTK-based on Linux a looong time ago, but that's about it. I always thought the xmlrpc-based solutions were not ideal because they were always supposed to be used with Moveable Type(?) and didn't support some s9y-specific features like tags at all. (I might be wrong here.)

Also, the flat file idea might not be ideal for blog with (a lot of) images. Or it would need some way to collect images from the dedicated folder as well and put them in the media db, but that might get very complicated in terms of adapting the path to said images …

YL

Re: Plugin idea: text file import

Posted: Mon Nov 19, 2012 9:04 am
by garvinhicking
Hi!

Actually, this is more like a simpler version of serendipity_event_popfetcher; instead of parsing an email, it could parse a textfile.

I think the plugin would not even need to parse markup, because it would leave that to the markup plugins by s9y (so that entries can be edited with specific markup after that, and not in HTML mode).

We could easily add a hook to the popfetcher plugin that would remove the dependency on a cronjob, and instead make it execute like delayed_trackbacks or tweetback checks every once in a while on the user side...

Regards,
Garvin

Re: Plugin idea: text file import

Posted: Mon Nov 19, 2012 11:35 am
by yellowled
garvinhicking wrote:I think the plugin would not even need to parse markup, because it would leave that to the markup plugins by s9y (so that entries can be edited with specific markup after that, and not in HTML mode).
Yup. It would also be more flexible since it could import Markdown as well as Textile etc. I only mentioned Markdown because it's everywhere these days. :wink:

YL

Re: Plugin idea: text file import

Posted: Mon Nov 19, 2012 9:52 pm
by robert
I would appreciate this sort of plugin :)

Sorry about to hear that Textile is not the winner of it all :( BTW: Chance to change a blog with hundreds of Textile "markuped" articles to markdown?

Re: Plugin idea: text file import

Posted: Tue Nov 20, 2012 5:57 am
by yellowled
robert wrote:Sorry about to hear that Textile is not the winner of it all :(
You are misunderstanding me. The plugin is supposed to be able to import any kind of text file and leave the markup conversion to our markup plugins. That means it will work just as well with Markdown as with Textile, even plain ASCII text or HTML (if the text files only contain the HTML needed for the entry).

YL

Re: Plugin idea: text file import

Posted: Tue Nov 20, 2012 10:14 am
by mattsches
robert wrote:BTW: Chance to change a blog with hundreds of Textile "markuped" articles to markdown?
Well, there is Pandoc, which is an universal markup converter. I've never used it so far, but if it lives up to its promise it might be the way to go. Of course, you would need a little script to batch convert your entries ...

Re: Plugin idea: text file import

Posted: Tue Nov 20, 2012 7:39 pm
by robert
@yellowled

Oh, no. I´ve understood it well :)

I was sorry, that Textile is not so supported by many software products like blogging clients...

Re: Plugin idea: text file import

Posted: Thu Jan 02, 2014 4:13 pm
by Macy
yellowled wrote:So this might be another one of those ideas which not too many users might actually need or want. It might as well be already possible without me being aware of it. If so, don't hesitate to laugh at me. :wink:

I love Markdown. I'm not even sure whether I actually love Markdown or just iA Writer, but either way, they're a comfortable combo to write blog articles with. There are other markup languages like Textile or BBCode as well as tons of other popular editors and writing apps.

Also, to my knowledge there still is no comfortable blog editor for use with s9y available on most platforms. There probably never will be a specific “offline” editor for s9y anyway, so we might as well think about other options to “emulate” something like that.

So what I have in mind is a plugin which would check a dedicated directory in the s9y installation (i.e. templates_c/entries/ or something) for new text files periodically (Do we need cron for that? cron might not be available for most shared hosting users). If it finds new text files, it puts the contents of said files in new entries and publishes them. These files could contain any compatible markup – HTML, Markdown, Textile, BBCode, even plain text. They would probably need to have some kind of header to contain meta data like entry title, author, date, tags etc.

Users could write these text-based entries offline in their favourite text editor and upload them using their preferred or available method (ftp or ssh). Maybe (but this is a bit optimistic, I guess) the plugin could also be able to pull files from a Dropbox?

Is this feasible? Anyone up for it?

YL
If you have any problem with the cron job settings, you may try http://www.easycron.com