Configuring markitup editor for markdown

edited November 2012 in Feature Requests
Hey there,

I've always used CKeditor but I've recently thought I'd like to give markitup ( + markdown) a go.
How can I configure markitup properly for FuelCMS?
What I'm trying to do is define what ends up in the markitup toolbar etc...
Inside MY_fuel.php I only see the options for ckeditor, what about markitup?

Cheers!

Comments

  • edited 6:49AM
    There actually aren't any settings to speak of in which you can set in the MY_fuel.php file. However, there are settings that could be changed below:
    fuel/modules/fuel/assets/js/editors/markitup/jquery.markitup.set.js

    I also suppose, in 1.0 you could use a "js" parameter for a form field to manipulate the "myMarkItUpSettings" object.
  • edited November 2012
    Also of note, 1.0 just recently had a new feature named “formatters” added to models which automatically applies functions to field values. The 1.0 user guide talks a little more about it. So you could do the following to automatically apply the markdown function to your record's field results:
    // examples $record->content_markdown $record->content_formatted $record->content_stripped $record->content_parsed $record->content_wrap $record->url_path $record->image_path $record->image_filesize $record->image_serverpath

    Additionally, you’ll be able to pass parameters by calling the function version:
    $record->content_wrap(50)

    To apply multiple you can use the new “format” method like so:
    $record->format(‘content’, ‘stripped|formatted’)

    You also can easily map your own functions to suffix values.
  • edited 6:49AM
    That's pretty exciting news. Can't wait to finally have time to fiddle with 1.0
  • edited 6:49AM
    Sorry again,
    but how do I tell markitup to use markdown syntax in 0.9 ?
  • edited 6:49AM
    You may need to do some tweaking of the markitup.set file:
    fuel/modules/fuel/assets/js/editors/markitup/jquery.markitup.set.js

    Below is a link to an example on their website:
    http://markitup.jaysalvat.com/examples/markdown/
  • edited 6:49AM
    Or, you can append a value to FUEL's "fuel_javascript" config parameter to overwrite parts of the "myMarkItUpSettings" object:
    $config['fuel_javascript'][] = 'my_custom_js';
Sign In or Register to comment.