Allowing Syntax Highlighting in Comments

I have installed the SyntaxHighlighter Evolved plugin to allow me to post snippets of code to my blog.  However (as far as I can tell) it does not natively support allowing syntax highlighting in comments.  As I was reviewing the old posts pulled in from my Drupal site, and in particular the comments that I had made to update some of the older posts, I realised that I had quoted code in them which would be useful to also highlight.  I decided that I would try and add the facility for syntax highlighting to be added to comments in a simple way as possible.

I noticed that that way highlighting seemed to work is that it adds a construct to the <pre> tags that delineate the code that should be highlighted of “class=brush:lang;” where lang is the particular language we are highlighting for.  I felt this was a little complex for comments to include in their “semi” html markup,  but that it should be simple enough for them to add <pre lang=”lang”> as a construct.

Continue reading “Allowing Syntax Highlighting in Comments”

Integrating Gitweb output into a WordPress page

One of my known stumbling blocks to converting my site to WordPress was how was I going to manage to incorporate gitweb so that its output appears within the middle of a page, formatted to at least look like a normal page. The problem occurs because gitweb takes over managing the output and writes an html page complete with headers and footer. You are allowed to provide your own site_header.html and site_footer.html files, but these are inserted just after the opening tag and just before the closing tag. There is no way you can add to the header.

One approach to this, and the one I took on my previous version of this site, was to embed gitweb within an <iframe>. Effectively gitweb’s output is sandboxed within the <iframe> context. Unfortunately, despite some javascript trying to detect it, when the quantity of output changed the size of the iframe needed to change and it didn’t seem to do that automatically. I often found the output was chopped off (with a scroll bar provided) even when my full page was nowhere near full screen.

I have taken a different approach this time. In outline I have created a holding page with permalink “/software/” to hold the repository code and then created a special template for my site theme which when called embeds output from gitweb into the page. There are a few tweaks to the header is moved to the correct place and that links within the output are correct.  Down to the detail.

Continue reading “Integrating Gitweb output into a WordPress page”

WordPress – Creating my own menu

Introduction

As part of the introduction of WordPress as the primary engine for my site, I have had to set up a template.  However, WordPress is not the only element of my site, and I expect to also have to include (at minimum) the following:-

  • An instance of GitWeb – to display my software repositories
  • Demonstrations of my applications
  • An issue tracking system (possibly combined with a discussion forum)

Each of these elements will want to take charge of the Content of the Web Pages they are controlling, but I expect all of them to exhibit the same look and feel for the basic web page.  As with WordPress, the way I achieve this is via a site template.

However, this template system is not quite the same the approach in WordPress.  It uses the following approach.

Continue reading “WordPress – Creating my own menu”

Switching to WordPress

As will shortly become apparent as this blog goes live (I am currently editing posts on my test system, but intend to include the posts I am making whilst I am setting things up), I have switched my personal web site from Drupal to WordPress.  I thought I would explain why.

Over the years I have tried a number of different platforms for my web site.  My last but one implementation was WordPress, but I decided on my previous implementation to use Drupal.  My decision then was based on the fact that I had decided that wanted something more complex than a simple blog and Drupal looked to allow that possibility.  So I did set about building the site and managed to achieve a passable result.  However I didn’t find I was updating the site all that much with new ideas.

Continue reading “Switching to WordPress”