Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.2k views
in Q2A Core by
Im making a site for programmers to share and help with code.  Is there a code block that users can use when entering code examples so it stands out from the rest of the text?

1 Answer

0 votes
by
selected by
 
Best answer

There has been developed such a plugin a while ago... but I'm not sure if it is compatible anymore: https://www.question2answer.org/qa/37512

Anyway, I guess that what you actually need is just a CKEditor plugin that would allow you to highlight the code. There are many but it seems the official one would be this one and there is a tutorial here. The only Q2A-related thing that you should bare in mind is that you will have to enable the CKEditor plugin in the WYSIWYG editor. Here is a tutorial on how to do that.

by
I guess I could just use SCeditor and use the code tags to highlight the data.
by
The thing is that using HTML <code> tags just paints the text as monospaced. You will want it to be formatted and colored, if you're talking about a programming site
by
I just added SCeditor but both SCeditor and WYSIWYG Editor is both checked and I can not uncheck either, but WYSIWYG Editor is the default.  How can I change it to SCeditor.  Using verison 1.8.1 of q2a
by
@craigg , go to Admin > Posting > Default Editor for questions
change that to SCeditor and do the same for answers as well.
by
Gurjyot Singh, thanks!  That works.
by
I cant get the pictures inserted when I use SCeditor.  Has something changed with 1.8.1 version of q2a?
by
I don't think so but probably that's something you should check with the SCEditor plugin developer
by
On the default WYSIWYG editor, is there any other functions that can be added to the toolbar such as code brackets that users can use to highlight text?
by
If you read the links I have added to the answer you'll see that the linked CKEditor plugin adds  a new button to the toolbar to provide support for that
...