Matt's Dev Log

Hey @matt@writing.exchange, this is a message for you.


Get future updates via RSS and ActivityPub: @devlog@matt.writefreely.dev.

Can we use String.replace() instead of String.replaceAll()? This means the script finally works in Chrome <85, but I don’t know if it gives us the same functionality we want.!!!!

#testing #test #wysiwyg


Get future updates via RSS and ActivityPub: @devlog@matt.writefreely.dev.

This is where you learn about an introduction. And then you will want to read more.

Read more...

Our WYSIWYG editor is nearly ready to be merged. So I’m testing it out a bit here.

It would be nice to have code blocks; this doesn’t exist.

I hoped em dashes would only be inserted as double-hyphens — are they? (no, they’re still magic hyphens)

Finally, we’ll publish with Ctrl+Enter.

#WriteFreely


Get future updates via RSS and ActivityPub: @devlog@matt.writefreely.dev.

This is some text.

Bold some text. New line and funky spacing ksjfdwkl

#WriteFreely #test


Get future updates via RSS and ActivityPub: @devlog@matt.writefreely.dev.

This is some text.

Bold some text.\ New line\ and funky spacing ksjdf

#WriteFreely #test


Get future updates via RSS and ActivityPub: @devlog@matt.writefreely.dev.

In #WriteFreely we support not only following blogs from the fediverse, but also #hashtags and @-mentions.

Hashtagged posts will show up in searches from the fediverse (when someone on your instance follows your blog), and you can @-mention someone to send them a notification and continue the conversation.

Comments? Let me know @matt@writing.exchange.


Get future updates via RSS and ActivityPub: @devlog@matt.writefreely.dev.

I’ve just updated this instance to the wysiwyg branch of WriteFreely, where we have a new what you see is what you get editor to choose from. Work on this editor is in progress on #383.

I’m now writing with that editor. (You can view the raw output here.)

It’s built on ProseMirror, and gives you a more classic writing experience while converting everything to Markdown (as WriteFreely understands) behind the scenes.

It also auto-saves, just like any other standard editor that comes with WF. I’ve refreshed the page a few times (saving everything to the clipboard first) and it’s always sucessfully loaded. This is the most basic requirement for our editors, so that’s great!

Some issues

It does seem to insert magic quotes in the editor ( instead of “), which is not what we want — that happens automatically on the rendering side, which is good (it seems to do it for em-dashes too).

I’m not sure if our shortcodes will work, like <!—more—> — especially with the auto-em-dash stuff.

Also, the scroll bar is right next to the text instead of outside the text area padding, which is un-ideal, but fine.

Poetry\ probably\ b r e a k s\ (It doesn’t completely! But the spaces before “breaks” gets removed when going back into the editor to update the post.)

Ctrl+K should add a link to the selected text. Also “Target” in that modal is confusing even to me. Hopefully we can fix that.

The editor doesn’t render HTML.

The editor inserts a backslash on the following before the first # symbol, preventing the hashtag from activating.

#WriteFreely #wfdev


Get future updates via RSS and ActivityPub: @devlog@matt.writefreely.dev.

WriteFreely allows instance admins to choose the writing experience their users enjoy. This guide will walk you through building and integrating a new editor.

Read more...

To import posts into WriteFreely from an outside platform, it is ideal to get all articles into a JSON document that looks like the following, where each object in the array is a complete article:

[
  {
    "title": "Optional Post Title",
    "slug": "optional-post-title",
    "body": "Entire post content, in Markdown or HTML, including any images and #hashtags.\n\nNote: newlines should be preserved in this field, even when using HTML.",
    "font": "serif",
    "lang": "en",
    "rtl": false,
    "created": "2006-01-02T15:04:05Z"
  }
]

These field names map directly to the API — you can read details in the API documentation. Otherwise, a few notes:

  • The slug should contain only alphanumerics and hypens. Any invalid characters will be automatically converted.

  • The body property should include all original markup (HTML) and Markdown, with newlines (WriteFreely respects and requires newline literals). Note: Getting as close to Markdown / plain text as possible here is ideal, as it provides the best editing and data export experience. But WF will render HTML.

  • Include any categories or tags as #hashtags, inline in the body. To make it look nice, you might append any to the end of the post, separated from the post body by \n\n.

  • Supply a created time, in the RFC3339 format (shown above) and converted to the UTC timezone, to preserve original publish date and time.

In this format, we can trivially loop through the array of objects and POST each one directly to the WriteFreely API — creating either drafts or blog posts.

#WriteFreely #import #dataMigration


Get future updates via RSS and ActivityPub: @devlog@matt.writefreely.dev.