Giter Site home page Giter Site logo

Editor about flaskbb HOT 8 CLOSED

flaskbb avatar flaskbb commented on May 17, 2024
Editor

from flaskbb.

Comments (8)

hbrls avatar hbrls commented on May 17, 2024

I support the idea that Markdown Only rather than WYSIWYG. I'm a frontend. What can I do for you?

from flaskbb.

sh4nks avatar sh4nks commented on May 17, 2024

I would like to have both (bbcode and markdown) options. So the admin can choose when creating the forum which markup language he wants to use. What do you think about that?

from flaskbb.

hbrls avatar hbrls commented on May 17, 2024

I'm blueprinting a forum for tech/geek, so I'd like to force the users to use markdown only. Having options is always better suiting general purpose forums.
But I'm still going nowhere, can not decide which is the best markdown editor. WYSIWYG is so proven. Markdown is relatively new.

from flaskbb.

manistal avatar manistal commented on May 17, 2024

I really like SCEditor. In order to pick that up the python side would have to include a bbcode parser as well (since SCEditor doesn't parse BBCode client side). I'm thinking all you'd have to do is update the assets for their CSS/JS, add in the JQuery constructor for the editor, add the data-attribute to the form, and parse the content after POST (bbcode.render_html(self.content.data)) and make sure the escaping is done properly on display.

I'll create a pull request if I get a chance to play with this more, for reference here's the libs I was thinking:

http://www.sceditor.com/documentation/getting-started/
https://pypi.python.org/pypi/bbcode/1.0.19

from flaskbb.

sh4nks avatar sh4nks commented on May 17, 2024

Ok, keep me updated on this. :)

from flaskbb.

manistal avatar manistal commented on May 17, 2024

Took a quick crack at implementing it, here's what I have so far:

https://github.com/manistal/flaskbb/tree/editor

A couple issues I ran into:
-- Wasn't sure where to stick the JS/CSS includes, looks like most of them are in layout.html which exists once for each theme and the default so I updated all of them
-- Wasn't sure where to stick the JS constructor so I added it to topic.js and added topic.js to any template rendering the text area
-- I couldn't get the icons to center properly on the toolbar, but I suck at CSS, I'm probably missing something simple

Quick notes about the serverside bbcode parsing:
-- The bbcode parser escapes HTML strings that are passed in with the editor content so I removed the |markup out of the Jinja template assuming that everythings coming from the editor (may be a bad assumption?)
-- The bbcode parser might not support all the tags that come on that editor, two options, one is limit the toolbar to only show tags supported by default, or can add the tags as custom tags to the parser (i.e. import the parser into some util and add the tags you and import the modified parser into the forms)

from flaskbb.

sh4nks avatar sh4nks commented on May 17, 2024

We are already using a bbcode parser btw (postmarkup) and the markup rendering thing is done here: https://github.com/sh4nks/flaskbb/blob/master/flaskbb/utils/helpers.py#L284-L293

and maybe it would be better to just add the static files (css/js) for the editor to just those files where it is needed :)

-- The bbcode parser might not support all the tags that come on that editor, two options, one is limit the toolbar to only show tags supported by default, or can add the tags as custom tags to the parser (i.e. import the parser into some util and add the tags you and import the modified parser into the forms)

i think removing the tags from the editor is the best idea.

btw, i suck at css and js too, thats way i have never implemented this

from flaskbb.

manistal avatar manistal commented on May 17, 2024

Haven't had a chance to clean everything up yet, but thanks for the heads up on the bbcode parser! I didn't even look through the utils like I should've. I'll try and clean everything up and get you a solid branch of the fork to take a look at and decide if you like how the editor fits.

from flaskbb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.