• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
proprietary tags in text for parsing and converting to html tags

#11
[eluser]treenef[/eluser]
Christ you're absolutely right, scribe has terrible documentation.

Let me see what I can come up with if you wish to use bbcode.

#12
[eluser]Andy UK[/eluser]
Hey treenef,

After you gave me something to go on with the term bbcode, i started to get more results on Google. bbcode is one of various Lightweight Markup Languages, with markdown being the one i chose. I was loath to use a wysywig editor because of all the rubbish html they insert, such as divs instead of paragraphs, brs and a whole load of unnecessary stuff that messes up the design.

Markdown allows me to give my users some control like adding titles, lists, etc with very simple markup and there is a nice quick parser called Parsedown which i dropped into my Applications/Libraries folder and am calling from my controller. Also, i can include raw html mixed in with the markdown text and have it work fine for times when i want a finer control. Obviously this wouldn't be a good idea for public access, but since this is an intranet solution, no problem there.

As for storage, parsing, etc. I decided to store both the markdown and the html conversion in the database in two different fields, both of which are updated when the markdown is edited and saved, parsing one and leaving the other as is. This way the information doesn't have to be parsed with every page view.

I hope that helps anyone else who may be interested in doing something like this. Scribe looks like a great wysiwyg editor, but the installation is way too complicated for the average user, especially without shell access on the server.

Cheers!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.