Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-07-15 20:03:26

stephan
Plugin Author
From: Bochum, Germany
Registered: 2004-07-26
Posts: 196
Website

[textile] Marked: Textile in any editor for Mac OS X

Marked is a cool new app I ran across today and it will bring Textile (or other markup) to any editor on your system. Maybe it is interesting to you:

Introducing Marked. Marked opens MultiMarkdown, Markdown, Text or HTML files and previews them as HTML documents. It watches the file for changes, updating the preview any time the file is saved. With a full set of preview styles, Marked adds an ideal “live” Markdown preview to any text editor. Plus… copy HTML with a keystroke, save to PDF or Print, or export to HTML in seconds.

If you wish to try it out yourself check out this article: http://brettterpstra.com/using-textile-in-marked/

Last edited by stephan (2011-07-15 20:21:11)


Yoko for Textpattern – A free blog themeMinimum Theme – If all you want to do is write.
Note: I am currently not actively using Textpattern, so I am not in the forums very often

Offline

#2 2012-03-10 17:39:10

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

Wow, Marked is really cool.

I wonder if there’s some way to turn this into a collaborative authoring process for Textpattern. Kind of like how people have taken to editing templates, styles and forms outside of the CMS, but do the same with the articles too using this tool so that people could contribute to drafts under versioning. I wouldn’t know the first step to putting it together, but I like the idea of making Textpattern more suited to real editorial workflows (besides just design and development workflows). Improve the editorial collaboration process and Textpattern becomes a lot more interesting for more people in publishing.

Offline

#3 2012-04-17 12:36:29

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

Can netcarver’s Textile development be used as a converter for Marked? (I’m an idiot with this code stuff.) Instead of, say, the Redcloth version?

I’d rather use Steve’s, if possible, just to ensure the Textile I use is right for porting to Txp later.

Offline

#4 2012-04-17 13:25:30

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

No, not directly (as it’s now). You would at least need a CLI wrapper for the Textile’s PHP versions that returns Textile markup to the standard output. The current PHP implementation isn’t for CLI use. And you would also have to have PHP installed, of course.

Doable? Probably sure.

Offline

#5 2012-04-17 14:52:41

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

Hmm… too bad. Thanks Jukka.

A

I have this “vision” of being able to use whatever text editor I want on my laptop, in tandem with Marked (to see my Textile changes rendered as I write/draft), so that when the time comes I just copy/paste my final draft into Txp article. (Even better if that is a collaborative process somehow, like via Dropbox, etc. but that’s a different extension.)

B

Taking the vision even further… the copy/paste part isn’t that at all, but rather a direct “save/update” via some mechanism similar to how folks are editing templates and CSS outside of Txp too… even if it was via xml-rpc or whatever.

—-

If we could give authors the power to write articles in the editor of their choice, AND see those Textile edits rendered near simultaneously with something like Marked (A), and make those efforts link directly to a Txp article (B); even if you had to start an empty article first to create the link… that would be huge, and a very unique selling feature for Txp.

—-

Alternatively, we start seeing some very slick and usable admin-side themes that make the native authoring process a LOT more enjoyable, which in turn relies on changing the underlying structure of the admin-side so that people can create new admin-side themes that really have any value.
O_o

Offline

#6 2012-04-17 15:05:26

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

That might be nearly possible already.

Jukka has this interesting unreleased plugin called rah_flat that can be used to update different txp tables from a flat file and in theory that could also be made to apply to the textpattern table that holds txp articles. Some text editors, such as “Espresso” for the mac will auto-upload on saving, or you can use your own editor (such as marked) in conjunction with a program that auto-syncs a folder with an online folder such as Folderwatch (again for the mac).

There’s an as yet unfinished piece to the puzzle, and that is to make it update the textiled versions of the articles which are created when the article is saved from the write tab, but Jukka has already made a provision for that.


TXP Builders – finely-crafted code, design and txp

Offline

#7 2012-04-17 15:22:53

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

I would gladly use Espresso (meaning to anyway) to take Txp article editing to the next level.

When you guys figure this out, you let me know, because this is a full on tutorial piece for the magazine. Seriously.

Offline

#8 2012-04-17 16:07:06

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 535

Re: [textile] Marked: Textile in any editor for Mac OS X

Destry wrote:

Taking the vision even further… the copy/paste part isn’t that at all, but rather a direct “save/update” via some mechanism similar to how folks are editing templates and CSS outside of Txp too… even if it was via xml-rpc or whatever.

If we could give authors the power to write articles in the editor of their choice, AND see those Textile edits rendered near simultaneously with something like Marked (A), and make those efforts link directly to a Txp article (B); even if you had to start an empty article first to create the link… that would be huge, and a very unique selling feature for Txp.

jakob wrote:

Jukka has this interesting unreleased plugin called rah_flat that can be used to update different txp tables from a flat file and in theory that could also be made to apply to the textpattern table that holds txp articles.

Do you have any idea how giddy and excited this makes me feel? Currently I used Byword (bywordapp.com) to write all my articles in Markdown. I then use Byword’s Preview feature to copy the text to the clipboard as HTML which I paste into a Textpattern article. If there was a way for me to upload the article upon save (even if it meant me switching to Espresso) I’d be ecstatic.

One question about the plugin, if you get it working for the textpattern table will it allow you to modify the section, categories, custom fields, posted, expired, article image, status etc for the article?

Last edited by Algaris (2012-04-17 16:14:43)

Offline

#9 2012-04-17 20:26:37

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

Algaris wrote:

One question about the plugin, if you get it working for the textpattern table will it allow you to modify the section, categories, custom fields, posted, expired, article image, status etc for the article?

No and yes. Rah_flat just imports flat XML or plain text files to database. Plugin’s configuration itself even happens with XML files. The plugin doesn’t have a graphical interface or anything like that.

The plugin doesn’t exactly do any automated jobs or actions apart from importing, and it has no specific features for any specific database table. Only thing it does is that it read a file, parses it if it’s XML, associates file contents/XML nodes with DB fields and tries to insert the resulting data to DB.

What the plugin does have, are callbacks and API for taking actions and modifying imported contents. So, it is in theory it possible to Textile an article field, or automatically create some information (statuses, sections etc). Doing that would need a PHP developer I suppose tho.

But. Using that system isn’t necessarily easy and one of the problems you will have is detecting which article should be imported/edited. The plugin is primarily designed to work by matching file’s name with primary database field, which in case of Textpattern is numeric ID that shouldn’t be set by hand.

Offline

#10 2012-04-17 20:39:23

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

If there was a way for me to upload the article upon save (even if it meant me switching to Espresso) I’d be ecstatic

None of this is dependent on Espresso. It just happens to be the editor I use most, and you can associate your project with one or more online repos via (s)ftp and set it to save locally and upload simultaneously when you press Command-S. Coda works similarly, except that you save locally and then upload in a batch. i’m sure other editors have similar functionality. Folderwatch simply syncs anything you save to a folder to an online directory, so works with any program.

One question about the plugin, if you get it working for the textpattern table will it allow you to modify the section, categories, custom fields, posted, expired, article image, status etc for the article?

Jukka’s going to have to fill in the blanks about the plugin, particularly with regard to adding data that is updated only on saving and that you don’t see when using the textpattern admin pane (e.g. the pre-textiled versions of body, excerpt and title). So to be honest, I don’t think it’s very feasible as a total replacement for the write pane. Maybe an xml_rpc-based approach program such as marsedit would be better for that.

Back to your question, Jukka has two kinds of templates: “flat text” like this form template and “xml” like this section template. If you need a mixture of a text field and settings (e.g. sections, categories etc.) Jukka suggested using a combination of two files. So in short, I don’t think this makes textpattern totally editable with flat files, but for the situation Destry described earlier where the main text copy of a pre-existing article is edited communally via dropbox, it might be feasible…

The plugin itself requires a bit of manual setting up at first and has no actual page on the textpattern admin. It also doesn’t export the existing forms and pages like cnk_versioning does. But otherwise it just works reliably in the background. The config.xml file describes how the plugin recognises template files and what parts of it are to be updated to which fields of the database. And when you’re ready to hand over the site, just set the global enabled switch at the top of the config.xml file to 0 and the presentation tab is re-enabled and the site owner can take over from there.


TXP Builders – finely-crafted code, design and txp

Offline

#11 2012-04-17 21:32:05

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

Jakob, thank you for your great explanation. I like.

And when you’re ready to hand over the site, just set the global enabled switch at the top of the config.xml file to 0 and the presentation tab is re-enabled and the site owner can take over from there.

That works. Better in terms of performance would be to add a line to Textpattern’s config file, /textpattern/config.php, that disables the importing and XML parsing altogether. That’s done using the same (erm, undocumented) constant, rah_flat_cfg, that normally, can be used to change the configuration file’s location. Setting the constant to false disables rah_flat.

define('rah_flat_cfg', false);

While the property in the XML config works the exact same way as the constant placed to config.php, getting the property involves parsing the XML config file.

Last edited by Gocom (2012-04-17 21:35:22)

Offline

#12 2012-04-18 10:21:19

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: [textile] Marked: Textile in any editor for Mac OS X

I’m not sure to have understand all the discussion.

BUT
If the back office of Textpattern does not provide a good writing comfort, why look for external solutions rather than seeking to improve Textpattern (with plugins eg.) To achieve what you want.

- A powerful text editor for textile directly into the back office (I add Ace_editor in write tab with full screen, and it really changes the comfort of writing).
- A solution of collaborative writing directly in textpattern.

have you tested Escrito ?, it uses Ace_editor and Textile. that’s something interesting to have a plugin for Textpattern.

Offline

Board footer

Powered by FluxBB