Syntax Highlight doesn't carry to Printer-friendly link.

Comments

soxofaan’s picture

Status: Active » Closed (works as designed)

Please provide more information. your description is a bit shortish.

I tried printer-friendly pages and it appears that that module does not include any external CSS style sheets, which is by design, I guess. If external CSS style sheet mode is enabled in the GeSHi filter settings, you won't get syntax highlighting by consequence.

If you use the inline CSS mode of GeSHi filter, you'll keep syntax highlighting, however.

denislabonkink’s picture

Yep, your assumption is correct.

The issue I would like to report is printer-friendly pages doesn't include external CSS style sheets.

If Printer-friendly pages were to change their design, does geshifilter have to dump CSS location info somewhere so that Printer-friendly pages can use them?

soxofaan’s picture

Well, this is a feature that you have to propose to the developers of printer-friendly pages. I'm not familiar with the module and I don't use it.

But note that an important aspect of Drupal modules is that there shouldn't be obscure, unneeded dependencies/links between modules. So I think the GeSHi filter module should be agnostic about the printer-friendly pages module and vice versa.

What about the workaround with the "inline css mode" in GeSHi filter?

denislabonkink’s picture

What about the workaround with the "inline css mode" in GeSHi filter?

I don't like "inline css mode" as it outputs too much code on the webpage. Anyway, it is a minor issue.

I notice that switching between modes doesn't give the same color. Is this a bug in geshifilter or in geshi?

soxofaan’s picture

I notice that switching between modes doesn't give the same color. Is this a bug in geshifilter or in geshi?

That was an issue of version 5.x-2.0 and should be solved in 5.x-2.2.
Can you give more information on how to reproduce: which language, the code snippet, other settings maybe?

denislabonkink’s picture

After further investigation, the issue happens when I change "Download method" from Public to Private and set "File system path:" to use an absolute path(/app/files). When webpages are generated, the geshi css's location is not set correctly. It adds double forward slashed to the root directory(/app) of my absolute path as follows:

<style type="text/css" media="all">@import "//app/files/geshifilter/geshifilter-languages-2e35a989.css";</style>
<style type="text/css" media="all">@import "/modules/geshifilter/geshifilter.css";</style>
soxofaan’s picture

Using private download method with external GeSHi filter CSS style sheets won't work.
The GeSHi filter style sheet is generated automaticly based on the enabled languages, and is saved under your files directory.
If that directory has no public access, you can't include the style sheet in Drupal.
The function drupal_add_css(), which is used to add a stylesheet to the page, requires a (public) path (relative to your drupal install) to the stylesheet, while with private download method you only have a protected url.

I should remove the option of working with an external style sheet if private download method is set.

With the color module happens the same thing (e.g. with the garland theme): if download method is private, you can't change the colors of the theme, because the custom generated CSS will not be available as a public file.