Loomio
November 14th, 2012 05:24

Making markdown opt-in rather than default

Benjamin Knight
Benjamin Knight Public Seen by 48

I've seen some cases where markdown has badly messed up the formatting of the discussion context panel, particularly when people cut and paste text in from other places.

I think markdown is awesomely useful when people know how to use it, but that's a small minority of our users. Would be super keen to switch it to opt-in. I'm suggesting this as a short-term quick fix - ideally it would be awesome to have a basic formatting GUI like Gmail, so ability to format text isn't limited to the tech-literate.

Thoughts?

Jon Lemmon

Jon Lemmon November 14th, 2012 06:24

Agreed. Can we think of a user-friendly way to do this? So this would apply to both comments and the context panel?

Paul Smith

Paul Smith November 14th, 2012 23:17

Would it work if we just added a small tick box next to the save button for the context panel?

Jon Lemmon

Jon Lemmon November 14th, 2012 23:20

Yeah, not a bad idea... maybe something like "Enable improved formatting for this post (see more)"?

See more could be a link to our markdown guide...

Scott Lemmon

Scott Lemmon November 15th, 2012 00:05

I really like the way the Stack Exchange sites do it. There is a preview pane of your post and a really formatting bar for basic controls such as bold, italic, quote and such.

I found a ruby gem the other day for markdown preview that should plug in to the post comment area pretty easily.

If we had this functionality it would not only allow people to preview their posts to make sure the formatting isn't messed up, but also would encourage the use of markdown... which can really serve to make a post much more readable.

In other words, I think instead of disabling the functionality and then making it have to be enabled manually, we should make it easier to use and learn about, and then perhaps have a "disable improved formatting" button instead. I definitely feel that by default formatting should be on, not off, to encourage good formatting and better posts.

I really think the way to go is to emulate the Stack Exchange sites.

Paul Smith

Paul Smith November 15th, 2012 00:23

Scott makes a really good point. One of the reasons I thought red carpet was a good choice initially was there's this:

http://markitup.jaysalvat.com/examples/markdown/

Which is a library that fancifies your text area (wysiwyg) and comes with out of the box markdown preview support.

Would a WYSIWYG with preview and a help button be enough to solve most of the issues?

Benjamin Knight

Benjamin Knight November 15th, 2012 00:38

Awesome ideas!

I'm suggesting making markdown opt-in as a short-term quick fix - ideally it would be awesome to have a basic formatting GUI like Gmail, so ability to format text isn't limited to the tech-literate.

Jon Lemmon

Jon Lemmon November 15th, 2012 10:10

Indeed, Scotty and Paul bring up good points.

However, I do also hear what Ben is saying that maybe we should make it opt-in for now until an elegant, dummy-proof solution is implemented.

The problem is that we've got a lot of non-tech-literate people who are starting to use Loomio and get really confused when their comments look like this for some odd reason. And it could take a while before we craft a really nice solution that is opt-out worthy. It would need to be uber clear. The thing is that the majority of stackoverflow users are programmers, whereas we have people using Loomio who are the type that get apprehensive just about using a computer to check their email.

Jon Lemmon

Jon Lemmon November 15th, 2012 10:12

I also think if we had the ability to edit comments it'd could make it less necessary to make it opt-in...

Richard D. Bartlett

Richard D. Bartlett November 16th, 2012 01:27

I agree with everything!

Right now it's fair to say it is doing more harm than good, so I'd switch over to opt-in, and just put the option on your settings page, unless someone can think of a really unobtrusive way to display it on the various text input forms.

Jon Lemmon

Jon Lemmon November 16th, 2012 01:44

I think a check-box next to "Post comment" might not be unobtrusive as long as it had a link and/or tooltip explaining in more detail. It would also help to educate users (e.g. "ooh, i want improved formatting! what's this?"). And it would also be a bit of a nag to us to think of a better way to do it long-term.

My gut tells me it would be weird putting it in the user's setting page (from a feature design perspective).

Richard D. Bartlett

Richard D. Bartlett November 16th, 2012 04:41

Maybe you're right.

Like a checkbox labeled "Enable markdown" with a tooltip that says "Loomio uses Github flavoured Markdown to add formatting to your comments and proposals. Here's a quick introduction to writing Markdown."

Scott Lemmon

Scott Lemmon November 19th, 2012 01:00

This all sounds good and reasonable. Jon makes a really good point out the user-base being quite a bit broader than just the tech literate. One thing is, could there be a way that we could have markdown be default for those of us that use it a lot?

Is the thought that this "Enable Markdown" checkbox would reset back to unchecked every time you post, or that it would keep it's state between posts and sessions?

I definitely vote for the latter, unless there is a good reason that it should reset back to unchecked.

Jon Lemmon

Jon Lemmon November 19th, 2012 01:28

Yeah nah, it would remember what your preference was. Probably a boolean like user.prefers_markdown.

Each comment will then also need a comment.use_markdown boolean (same goes for discussion description).

@Rich - yeah I think not using the phrase markdown in the text might be better: "Enable improved comment formatting".

Jon Lemmon

Jon Lemmon November 19th, 2012 02:16

Made a trello card here: https://trello.com/c/ryW0DsJ9

Richard D. Bartlett

Richard D. Bartlett December 4th, 2012 19:40

Here's a quick mockup of what this might look like.

Matthew Bartlett

Matthew Bartlett December 4th, 2012 20:33

@richardd.bartlett — that link gives me a 404 (though it worked 10 mins ago). My comment on the mockup:

Too annoying to be presented with that option every single time one makes a comment.

I think it should be in loomio.org/settings/ — technically advanced users will look at their settings page.

Richard D. Bartlett

Richard D. Bartlett December 4th, 2012 20:34

Matthew Bartlett

Matthew Bartlett December 4th, 2012 20:45

@richardd.bartlett — 'Sorry. You're not authorized to view this page. Try logging in below or clearing your cookies.' How does one get a login?

Richard D. Bartlett

Richard D. Bartlett December 4th, 2012 20:56

Soz still learning balsamiq permissions. I think it is public now. Not the best ux :(

Aaron Thornton

Aaron Thornton December 5th, 2012 08:31

@richardd.bartlett I like your idea of presenting it like the privacy icon where you can set it in the settings page but you can also toggle it on/off by clicking the icon.

mix irving

mix irving January 7th, 2013 10:16

i'm having a go at implementing the dumb version of this.
just drilling in to try and find out how you've implemented markdown...

rich your balsamiq ain't public or is gone?

mix irving

mix irving January 7th, 2013 12:11

ok getting there.

  • with the db migrations, shall I assume the default (as set in db migration file) for comments and discussions is :uses_markdown, :boolean, default = true ?
    (to preserve existing markdown use)
    nb - in future, forms will have a tickbox whose default position is set by the @user.wants_markdown boolean

  • i note in searches that motions use markdown too... presume implement here too

aside - noticed that when you click edit discussion then hit 'cancel', you get an ugly view : http://i.imgur.com/979Cp.png
repeating this sequence cycles the help message away again

Richard D. Bartlett

Richard D. Bartlett January 7th, 2013 22:56

@johnirving this link should work. Note the comments on that thread for suggestions of how to improve my mockup. Feel free to edit :)

As a general process thing, I think we want to maintain the 'Features' group as a place for discussing mockups and behaviour. Once the mockups are approved more-or-less then any technical 'behind-the-scenes' questions are probably better dealt with elsewhere, e.g. in the 'Code' group. The intention is to keep this group as accessible as possible, to encourage non-developers to participate in feature design.

Re: aside = that's a known bug

Jon Lemmon

Jon Lemmon January 8th, 2013 02:39

@johnirving that all sounds pretty good. I think we'll need to be careful about the way the user preferences for markdown are implemented on the context panel.

E.g.: if someone doesn't tick "use improved formatting" for the context (so user.wants_markdown == false), and then someone else goes to edit the context who has user.wants_markdown == true, then the markdown box will be unchecked. However, when they submit the edit we don't want the change to edit their user.wants_markdown preference to false. You see what I'm getting at?

@richarddbartlett hmm... I wonder about that process. It means that every feature will have two separate discussions. Could it not just be distinct phases where the first phase is accessible, and the second one isn't? I think eventually what you're saying will make total sense, but I wonder if it's a bit premature to implement it now.

Richard D. Bartlett

Richard D. Bartlett January 8th, 2013 02:43

@jonlemmon fair enough; let's try to keep the phases distinct though eh? i.e. try to keep techno speak out of the equation until after the mockup is agreed. I'll stop cluttering up this thread now because it's getting pretty inaccessible :P

Jon Lemmon

Jon Lemmon January 8th, 2013 03:07

@johnirving a few of us had a discussion about how to design this. let me know when you have a minute to discuss on skype.

Jon Lemmon

Jon Lemmon January 8th, 2013 03:07

by design i mean like "which button goes where".

Josef Davies-Coates

Josef Davies-Coates July 9th, 2013 04:13

this makes sense, but I guess has been done now with the little A in the right hand corning below the comment box? Or is that still turned on by default? (I can't remember if it was on or off when I first signed up).

Makes me think of something else though... how to archive or close a discussion? which is related to https://www.loomio.org/discussions/1106

Richard D. Bartlett

Richard D. Bartlett July 9th, 2013 04:29

@josefdaviescoates unless there's something funny going on, Markdown should be off by default for new users.

Personally, I'd like to move beyond Markdown relatively soon as part of an overall upgrade of the comment box: easy formatting, drag-and-drop images, preview-before-post, attachments, link preview, etc.

I reckon this is a RoR gem waiting to happen :)

Rob Guthrie

Rob Guthrie July 9th, 2013 05:55

Richard how would you feel about a editor like the following but with dnd image/file support?

http://samwillis.co.uk/pagedown-bootstrap/demo/browser/demo.html

Josef Davies-Coates

Josef Davies-Coates July 9th, 2013 07:54

having some formatting buttons makes sense to me @robertguthrie

I'm assuming dnd image/file support means drag and drop image/file? Personally I tend to have app windows maximised and taking up the whole screen and so have never really made use of that where it exists (don't find it speeds up my work at all), but I guess others like it.

I don't like the second editor in the example you link to - don't like what it does to links and can't work out how the 'also' in the last sentence is italic!? :)