Closed (won't fix)
Project:
Advanced Help
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2008 at 04:22 UTC
Updated:
25 Mar 2015 at 07:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
beginner commentedThe advanced help output can be altered:
So if the maintainer won't implement it, at least we can create a little module which would filter the output with codefilter for automatic syntax highlighting. I haven't tried yet, but it looks fairly easy after all.
Comment #2
merlinofchaos commentedI would really like code filter output, myself, but I was leery of doing it since it is an external module and we obviously don't want a dependency on it.
That said, I think maybe a setting that turns on codefilter filtering IF codefilter module is enabled is a good idea. That won't fly in core, probably, the codefilter could use drupal_alter for that version. For contrib, though, I'm willing to make codefilter not do the dirty work unless the maintainer wants to do it.
Patches considered.
Comment #3
beginner commentedThere is the additional problem that codefilter uses the
<code>tags.The php block in the example above uses
<pre>tags.<code>tags without codefilter just won't do.<pre>tags with codefilter won't do either.Hmmm... I guess the module would have to use both sets of tags, so that it works both with and without codefilter.
Comment #4
merlinofchaos commentedIn theory we could apply .css to the code tag so that it works properly. I didn't try very hard to do it, though.
Comment #5
beginner commentedI tested a bit using the date.module (?q=help/date_api/form-elements) and the attached patch.
It doesn't work without patching date.module because the html contains
<?php ... ?>and not<?php ... ?>.If I patch date.module so that it has the proper php tags, codefilter works, but then without it the page is unreadable!
Comment #6
beginner commentedThis patch is a bit of a hack, but it works without patching date.module.
Since the help pages are supposed to be only html, it should be ok to check for php code this way and replace the html tags into real php tags to be filtered.
Comment #7
beginner commentedI noticed Karen of this thread:
#343072: syntax highlighting for advanced help.
Comment #8
helior commented#1649588: Support Input Filters might also interest you for achieving syntax highlighting via input filters. If this approach makes more sense for the feature request on this issue, please mark this issue as a duplicate.
Comment #9
gisleI don't want to create an dependency on Codefilter. Having it optional will mean that people who don't have Codefilter installed will see nothing (or garbage) instead of markup on advanced help-pages. This is not desired behaviour.
I plan to implement filtering by Markdown as an option for README.md (see #1405734: Output READMEs as parsed Markdown). This will allow the use of backquotes, indentation to mark inline code and code blocks. Markdown is designed to degrade nicely for people who don't have Markdown installed.