Andrew Shell posted a note to the mail list yesterday saying he wanted to use the Handlebars template system inside MWE.
To do so, he's replacing a core routine, multipleReplaceAll. This is too good a routine to give up to such a cause, so I created a shell in v0.65 for him to replace.
The shell is called getRenderedText, and it basically calls multipleReplaceAll. Andrew please use this instead.
If the idea of other templating systems catches on, we'll need to formalize this a bit more.
New in MyWord Editor v0.64.
There's a new config.json element, config.startupCode.
After MWE has finished booting up, it runs this through the built-in eval function.
The default value is a console.log call that basically says Hello World.
There's a new folder in the repository called editor. If you want to use a different editor, say TinyMCE, Dante, medium.js, the editor in Ghost, or whatever you like, just replace the three routines in scripts.js in your fork. Having this off in a separate folder gives you space to build functionality you may need.
I wrote a bunch more about it on my MyWord blog, with pointers to blog posts with thinking about the editor.
You can include Disqus comments in a MyWord Editor site, starting with v0.62.
To enable or disable the feature, visit the CMS tab in Settings. You can turn comments off (they're on by default), or specify a Disqus group. If you want to get email notification of comments on your site, you must change the group.
Comments are provided for in the default and plain templates. If you're writing your own template, you can include comments with the [%disquscomments%] macro.
Here's an example of a page with comments. Feel free to party in the comments section.
This is not an April Fool joke.
New in MyWord Editor v0.60 -- templates.
A quick tour of how they work for writers.
There's a new menu in MyWord Editor with the names of all the templates that are available. When you publish a page, we use the template you've chosen.
There's a default template. You can change it in the new CMS panel of Settings.
The sysop can change the contents of the templates popup in config.json.
There's much more info about the feature on this page, which uses the Plain template.
A template consists of a name and the URL of an HTML file containing the page template.
The Plain template is a good place to start if you want to see how templates are made.
Where you see macros, in this [%syntax%], we substitute a value from the pagetable.
Items that have ID attributes, like idEssayText and idVersionNumber, are set by the startup script. Your choice. Static substitution, or set by script at read-time. Or elements could be fully dynamic, even AJAXy. I wanted to have the full power of scripting available in the template platform.
You can override everything. That's a basic principle. (Maybe not an absolute.)
This is the central feature to the blogging software. In a sense everything is peripheral to the way content flows from author through the templates to the web. If it's done well, at the point of connections, designers can have the maximum power. And we want sysops to have the max flexibility, and make it as easy as possible to host and maintain templates.
There will certainly be breakage from this point. This is the first place where users and designers get involved in the template process, and this is new software, so it's flexible. Things can change now without breaking an installed base. We're going to take advantage of that.
I do too. Post them here as comments or on the mail list. Even better, write a blog post, and post a link.
The notes below are important to understand what's been released and how you can use it.
The default template that I provide is still wired to the versions of these files on myword.io.
You can modify the default template for your installation in any way you like. That's the point of having a template, so that people can change the appearance of rendered pages without modifying the CMS software.
As part of those modifications, you can point to different versions of the JS and CSS files.
Or you can still point to my copies, and override any style or script you want with your own versions.
I hope to have more template-related features before too long.
The files are in the templates folder in the repository.
In MyWord Editor v0.58 there's a new History menu.
When you choose an item in the menu, its title, description, image URL and body text appear in the dialog. You can edit them, publish, whatever.
If you change the title of a post, or add a new one, the History menu automatically updates.
The Open file command is no longer needed, so it was removed.
One feature, three fixes in MyWord Editor v0.55.
Each post now has a sidebar, which you can access by clicking on the hamburger icon in the upper left corner of the page. When you open it, you'll see a list of recent posts. The current post is displayed bold. Click on any other post to view it. This list is generated from the RSS feed for the user's blog. Here's a post that illustrates.
Fixed a CSS problem that had list line-height fixed in some cases. All paragraphs in the body should now have a height of 145%.
When generating <description> elements in the feed for the blog, we pass it through a markdown interpreter, since the assumption is that all text in MWE is markdown. If it's markdown text, we also generate a <source:markdown> element that contains the original text, so if the RSS reader app can understand markdown it could do something special with it.
Modified the default template so it includes the title, description and body text in the page elements, not just in the pagetable. This should guarantee that the text is picked up by the search engines. Let's watch for this and see if it does.
We now have an easy way to host your myword.io blog on another server. This will expand, get simpler and easier, and less buggy, I promise. But for now this is how you do it.
In MyWord Editor, choose Switch server in the Editor menu.
Enter the URL of one of my servers,
Important: It must be in exactly that form, no trailing blanks, the final slash must be present.
Click OK. You should be redirected to Twitter with a page asking you to authorize noteblog.io. Authorize it.
You should be brought back to the editor. Fill in the form with a new post, click Publish, then OK to visit the page.
That's it. You should now have a post on noteblog.io. Here's an example. Please test this and report back via the mail list or a comment here.
You should now have an essay on noteblog.io, which is a spare nodeStorage server I had. It's a plain vanilla server, installed from the nodeStorage source on GitHub.
If you have your own nodeStorage server, you should be able to substitute your domain for mine, and repeat the process. Just remember, it must be in the form of a URL, or it won't work. (See #3 above.)
You will be able to put a JSON file in the same directory as your copy of MWE that says where your server is, so the user doesn't have to do anything special to set it up, and you don't have to modify the MWE source to start your own hosting service.
I am announcing this on the server-snacks mail list for testing with people who have nodeStorage servers set up, and on the myword-editor mail list for people who are testing the editor. I'm doing this before opening MWE to the public, so on Day One there may be a number of servers they can use, not just mine. At least we will have tested it's silo-freeness, and been sure that it works.
I will also release the full source for MWE in a GitHub repository. This should allow compatible experimentation and innovation in editors.
Here's a Scripting News blog post explaining the philosophy.
One new feature, a couple of fixes.
If you want to open a file you created previously, choose Open File from the Editor menu. Make changes, publish, everything should work.
Autosave is now more conservative, only saving after a second of idleness. So if you want to save, just let up on the keyboard as you type. In the upper right corner of the screen next to the version is a SAVED indicator. It flashes while MWE is saving.
There was a bug where blank lines would accumulate at the end of the document. This has been fixed.
Leave a comment below with your Twitter ID.
If you have problems use the mail list.
Don't forget how to ask for help with software.
MyWord Editor is a simple browser-based editor that publishes to the web.
Here's an example of the kind of document it produces.
To create a new document, just load the MyWord Editor page, if a document is already present, choose the New command in the Editor menu. The fields of the form clear. Enter a title, description and body for the post.
The text is automatically saved as you type.
When you want to publish your essay, choose Publish from the Publish menu. To view the published page, click OK on the confirmation dialog that appears.
In the Publish menu, choose View story to view the published page.
In the Editor menu, choose View RSS feed to view the feed containing your essays.
Choose Get JSON backup to view an data file (in JSON) containing all your posts, so you can transfer them to another account or application, or to serve as a backup.
You can use Markdown in a limited form, but you have to turn it on first.
Choose the Settings command from the system menu (it's at the right edge of the menu bar, the menu with your username as its title).
In the Publish panel, click the checkbox for "Use the Markdown processor."
There are limits to our Markdown support.
Markdown works within paragraphs, so if you put asterisks around some text, you'll get italic text. And you can put pound signs in front of a headline to get it properly boldened and enlarged.
But any Markdown construct that spans more than one paragraph is ignored. The Markdown model says they don't look inside paragraphs, a good policy. So there's a little bit of Markdown support in here, not full support.
If you have questions post them here as a comment, or on the support mail list.