Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[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 theme • Minimum 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
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
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
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
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
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
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: 553
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
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
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
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
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