How to expand markdown?


  • Plugin & Theme Dev

    I'm looking to expand markdown beyond the simple bold, italics, list, and whatnot to include the following:

    • Text alignment (left, right, center)
    • Underline
    • Strikeout
    • Table
    • Tooltip
    • Color

    I'd like to put these all into a single plugin, as a sort of "markdown expander" that expands on the current limited amount of choices that we have at the moment.

    I'm not able to do this on my own as still don't get Javascript but I'd love some help on the subject. Would anyone be willing to lend a hand with this project?



  • I'm pretty sure it already has the capabilities mentioned. After all, it's in use on Reddit. Seems like we just need a plugin to add the buttons to the composer. I'll have to check the Markdown docs though.

    I'm all for this!



  • Kind of defeats the point of markdown. It's the opposite of markup. Markdown is probably quite primitive if you're used to plain HTML or even BBCode(shudder).

    You could probably add that sort of thing by forking the youtube plugin, doing something like

    /*wildy oversimplified this, probably needs escaping properly*/
    var	underline = /[u]([\w\-_]+)[/u]/;  
    

    which is the bbcode variant of [u]text goes here[/u], then

    embed = '<span class="underlined">$1</span>';
    

    EDIT: Table can already be done.

    Tables Are Cool
    col 3 is right-aligned $1600
    col 2 is centered $12
    zebra stripes are neat $1


  • I don't think we need more Markdown functionality, but more features available in the composer, rather than syntax for thise new to Markdown.

    This would be a great plugin for those interested.


  • Admin

    Here's an example of a plugin that expands on the current markdown syntax: https://github.com/psychobunny/nodebb-plugin-spoilers

    Also shows you how to add new buttons to the composer.

    EDIT: This isn't the first, there is a plugin that extends markdown to allow one to change colour of text for example.

    EDIT2: Eh, I didn't realize that our markdown plugin supported tables. Cool! I guess it could use some CSS love though



  • @Tanner, I've got a working button to allow for Code insertion. I'll see what I can do about adding more buttons as requested.


Log in to reply
 

Suggested Topics

| |