can this module highlight php(or else) code in block form?? if no, than which module can do this? i need syntax highlight exactly in admin block page(for easy wrote and understand code), and not in rendered block content.

CommentFileSizeAuthor
#4 administration-hilighting.png44.23 KBANDiTKO

Comments

mattyoung’s picture

This module can highlight anything on the page. You just have to mark it up properly. See the Syntax Highlighter Javascript site for details. Basically you just need to do this to you code:

<pre class="brush: yOuR-language;and-other-options">
paste you code here, be sure to escape < to &lt;
</pre>

That it.
ANDiTKO’s picture

I also want to use syntax highlighting on my Node and Block edit forms. It seems pretty strange that Drupal dose not have any module that provides nice code hilighting for Administration pages.

I don't want to copy/paste the code into my Desktop editor (Aptana Studio or Dreamweaver) then paste it back to drupal. And i don't want WYSIWYG module. I want to code with syntax highlighting.

So the question is how can we make the "Syntax highlighter" module work with Node and Block administration? Currently drupal create a "textarea" tag to write text in nodes and blocks. So do we make the "Syntax highlighter" hilight the textarea tag or we change the drupal output. But as far as i know you cant write text insde a code tag. The code tag is to show "ready" pre-formated code. Not to write in it.

Any ideas?

mattyoung’s picture

>work with Node and Block administration?

Can you explain what do you mean by this?

Are you looking for ways to highlight code within a textarea edit form element? If this is the case, then I don't think this can be done with this module. It can only highlight code with the properly marked-up <pre> elements on the page.

ANDiTKO’s picture

StatusFileSize
new44.23 KB

I mean that it would be very helpful if we can have syntax highlighting inside administration text areas.
So we can write code in our node body field Like so:

mattyoung’s picture

What you are asking is not possible with this module.

You can take a look at http://drupal.org/project/wysiwyg_codemirror

I believe it does what you want

ANDiTKO’s picture

Yes it dose but its for Drupal 6. Ive used http://drupal.org/project/wysiwyg_codemagic on some other sites. But it depends on WYSIWYG +TinyMCE and i dont want no WYSIWYG. And you must click on the HTML button to see the highlighting.

Cant we make "Syntax highlighter" to have an option to work with "text area tag" within administration pages?

- Thanks
ANDiTKO

fizk’s picture

Assigned: b8x » Unassigned
Status: Active » Closed (fixed)

ANDiTKO,

I'm the maintainer of wysiwyg_codemagic (and now this module as well) - I highly recommend following #274431: Add editor: CodeMirror because that's exactly what they are trying to do.