Salta navigazione.

Navigazione

Login utente

Eventi

  • Nessun prossimo evento disponibile

Chi è online

Ci sono attualmente 0 utenti e 151 visitatori collegati.

Aggregatore notizie

Council Meeting Summary

Gentoo Linux News - 19 Marzo, 2010 - 23:59

What: Gentoo Council Meeting of 8 March 2010.

Voting by email

Ideas seemed to converge on how to vote by email but it was noted that this would constitute a change of GLEP39 which the council can't modify without an all-developers vote. Since there were already other changes planned or suggested to GLEP 39 it was decided that the council would work on a new text and submit it to a vote when ready. Calchan has volunteered to gather all ideas and work on the text.

Do we want a policy for changes in metadata.xml?

Adding such information to metadata.xml was considered a bad idea for two reasons: this information is of no use to the users and would bloat the file for no good reason, and it would be a technical answer to a mostly social problem. It was suggested that reducing territoriality could help. Ideas were proposed like making it official that after sending an email to the maintainers and waiting one week anybody could touch a package.

In the end it wasn't clear what exact problem was to be solved. So scarabeus volunteered to animate the discussions on the mailing list. The goal is to find out what the source of the problem is and what solution(s) we can apply.

For more information, read the summary or the complete IRC log.

Categorie: Gentoo

Chemnitz Linux Days 2010

Gentoo Linux News - 19 Marzo, 2010 - 23:59

Chemnitzer Linux-Tage 2010 is almost here, and Gentoo will be there!

This years Chemnitzer Linux-Tage on March 13th and 14th is another great chance to:

  • get in touch with Gentoo developers
  • buy Gentoo shirts (be quick, first come first serve)
  • chat, discuss, start with ebuilds and overlays, you name it

The "Chemnitz Linux Days" is a conference that deals with Linux and Open Source Software . It is open for everyone, novices and experts alike. This event is organized by IN Chemnitz, CLUG, Computing Center and Faculty of Computer Science of Chemnitz University of Technology, and many volunteers.

See you there!

Sebastian Pipping contributed to the draft for this announcement.

Categorie: Gentoo

Gentoo at SCALE 8x

Gentoo Linux News - 19 Marzo, 2010 - 23:59

SCALE 8x is almost here, and Gentoo will be there!

Southern California's premier open-source software event is just around the corner, running from Friday, February 19 through Sunday, February 21. Several Gentoo developers will be there; it will be our biggest showing since SCALE 5x.

We'll be showing off some nifty devices running Gentoo, and we'll be giving out installation media. Whether you're a developer, user, or simply curious, be sure and stop by booth #33. See you there!

Categorie: Gentoo

Gentoo on the Misa Digital Guitar

Gentoo Linux News - 19 Marzo, 2010 - 23:59

Gentoo has turned up in lots of interesting places before, but Michael from Misa Digital has put Gentoo to work in something entirely different: a unique instrument he invented, a MIDI guitar that uses a touchpad and digital keys instead of strings!

Behold the Misa Digital Guitar:

The Misa runs Gentoo Linux on an AMD Geode processor, using the Linux kernel version 2.6.31. It sports MIDI and Ethernet ports for connectivity.

I had the chance to ask Michael some questions about the guitar and his preferred choice of operating system:

Why Gentoo?

Since the guitar is an embedded system, I needed a really minimal distribution that would boot fast and had a small footprint. After investigating Linux From Scratch, I realised I did not have the time to invest in building a complete system. I was told that the minimal install of Gentoo is like Linux From Scratch with a package manager. I probably made you cringe with that simplistic analogy but essentially it was right for me. Once I had the install up it took me no time to recompile the kernel and streamline it as much as possible. I'm not a Linux expert though, so I reckon someone else could shrink it even more.

Yes, there are other solutions out there but they are surprisingly inaccessable. And the "live-CD" style distributions do not allow you to change the actual workings of the system. I figured it was best if I just used Gentoo because I have full control.

What were the two biggest challenges in crafting this instrument?

I would say the two biggest challenges are: 1) manufacturing and tooling the actual parts; and 2) sourcing components.

When you are a lone developer with no company, trying to keep the idea "secret", no one wants to cooperate with you. For example if you need a particular electrical like a screen, ordering "one" of something is surprisingly difficult - and you can expect it in 4 to 6 weeks - really slow! And then when you get it, you realise it is not suitable, so you have to repeat the process. The only exception is a website called Digikey, which will have the parts at my doorstep in 1 week guaranteed. But they don't have everything.

Working with Gentoo was a breeze, the Linux community in general is extremely helpful.

What can you tell us about the hardware?

There is no signal processing, it outputs digital signals via a MIDI connection. I had toyed with having an onboard sound generator but ultimately you limit the sound possibilities. By using MIDI, you are guaranteed support with practically every sequencer, synthesizer etc on the market - it is a standard that has been around for over 20 years.

[The touchpad] is a 5 wire resistive touch sensor. These are the most durable screens available on the market. The LCD behind it is OEM and ordered from China.

What changes to Gentoo (as a distribution) would make it easier for you to run it on the guitar?

I thought Gentoo was a breeze to work with. And can I just say, the Gentoo x86 install handbook? BRILLIANT. I used it so much that I think I actually know it off by heart now.

What's in store for the future?

I'd just like to see these instruments hit TV :)

Thanks for your time, Michael, and for crafting such a unique instrument! Be sure to watch a demonstration video of the Misa Guitar in action.

Categorie: Gentoo

German Gentoo Book

Gentoo Linux News - 19 Marzo, 2010 - 23:59

A parting gift for the German Conspiracy,

Gunnar Wrobel recently acquired the rights for his own book about Gentoo, and it has now been published under a free license and is available for download. The latex source for the book is also included. Gunnar's intentions in publishing the latex source was to encourage translations... it would be neat if that really happens. Please take the time to thank Gunnar for all the excellent work he has done for Gentoo.

Stephanie J. Lockwood-Childs contributed to the draft for this announcement.

Categorie: Gentoo

26th Chaos Communication Congress

Gentoo Linux News - 19 Marzo, 2010 - 23:59

Yes, we will be there! Compiling all the way ... ,

Gentoo will be present at the 26th Chaos Communication Congress (26C3), from December 27th to 30th in Berlin, Germany. The annual conference of the Chaos Computer Club takes place at the Berliner Congress Center (bcc) in Berlin, Germany. Enjoy our ebuild hacking sessions, bug filing workshops, get some merchandise and use our local rsync/http mirror. You will find the Gentoo table on the upper floor.

Hope to see you there!

Robert Buchholz contributed to the draft for this announcement.

Categorie: Gentoo

Yes-No Vote on behalf of the Foundation

Gentoo Linux News - 19 Marzo, 2010 - 23:59

The Gentoo Foundation Inc. has been approached by a few large Gentoo users about purchasing advertising on the gentoo.org side bar. They are not in the IT industry so cannot support us in the traditional way, by donating their own product.

The trustees anticipate that more approaches of this nature will be received and view it as a sign of Gentoo maturing. Recognising that this would be a break with tradition, by allowing even major users to contribute to Gentoo in this way the trustees determined to put the question to a vote of Foundation members.

The recording date for the vote will be 29th November. Voting will be from 1 December to 11 December, to enable the result to be available for the next Trustee meeting on 13 December.

Important: To vote, your Foundation membership must be approved on or before that date.

Requirements:

Please refer to the Gentoo Foundation Bylaws, in particular 4. Article IV Members

The motion to be voted on will be:

Should major Gentoo users be permitted to purchase ads on the sidebar - Vote yes or No

If you have any questions please contact Trustees or on irc at #gentoo-trustees.

Categorie: Gentoo

Gentoo KDE3 Deprecation Notice

Gentoo Linux News - 19 Marzo, 2010 - 23:59

Please turn your KDE radio on, and make sure to increase the volume to its maximum level for this important message.

After multiple setbacks we have finally managed to stabilise KDE4 on both major desktop architectures (amd64 and x86), with other teams to follow.

For this and other reasons as discussed , those of you who still use KDE3 should be seriously considering an upgrade in the near future.

The KDE3 support is being deprecated with immediate effect. This means that ebuilds are dropping KDE3 support where they were broken, or clashing with KDE4.

If you wish to still use KDE3, and you want to help others with having KDE3 around, drop a mail to kde@gentoo.org, where we can give you commit access to the special overlay which will specifically contain only KDE3 packages.

This overlay (named kde-sunset) can be easily used via layman.

Sadly upstream is not supporting KDE3 anymore and we simply lack the manpower to keep support for both (as you might have noticed in the past few months KDE3 has become more and more rusty for which we humbly apologize).

Sorry to bring you the bad news and with hope that KDE4 will suit your needs,

Tomas Chvatal

KDE Teams substituting Lead

KUDOS to Nirbheek Chauhan and David Abbott for helping to put this announcement together and Alec Warner for proofreading it.

Categorie: Gentoo

Gentoo Ten Live DVD 10.1 Release

Gentoo Linux News - 19 Marzo, 2010 - 23:59

Attention Gentoo Community,

After numerous bug fixes and enhancements the Ten Team would like to encourage everyone to try out the 10.1 release.

A FAQ is available to assist you. We have also started a thread in our Forum. Please post any BUGS you encounter.

Please download the latest testing release for your architecture Gentoo Ten Live DVD 10.1 x86 | Gentoo Ten Live DVD 10.1 amd64.

Thanks for your continued support,

The Gentoo-Ten Project

David Abbott contributed to the draft for this announcement.

Categorie: Gentoo

2009 Gentoo 10 Screenshot Winners

Gentoo Linux News - 19 Marzo, 2010 - 23:59

Woot! Happy Birthday Gentoo. As part of the Birthday party today we announce the winning screenshots.

Thanks to everyone who entered the contest. There were 54 entries using 5 different window managers / desktop environments.

The Winners
  1. Quick23t Compiz Fusion
  2. ashtophet Fvwm 2.5.27
  3. Integer Fluxbox

For all the specifications and cool details please visit the winners page.

discuss this!

Categorie: Gentoo

Sebastian Pipping: This Saturday: Bumpday – fix your bump requests

Planet Gentoo - 19 Marzo, 2010 - 19:40

This Saturday is a great opportunity to give a try to a new concept: A day dedicated to fixing bump request bugs and therefore improving on the update-to-dateness and the bleeding-edgity of Gentoo while decreasing the pile of open bugs a bit more aggressively than on a usual Gentoo day.

I plan to announce winners after. A bumpday winner is someone who

  • fixes at least one bump request on the given day
  • has been fixing the most bugs among all participants
  • is technically detectable as a winner, i.e. all related bugs must:
    • have the word bump in the summary
    • have changed status to resolved/fixed between the bumpday’s date and the day after
    • still be resolved/fixed
    • be assigned to you (not someone else, not a herd)

It’s perfectly okay if you join in just for winning as long as you apply the necessary love and care to the bumps you do.

Another thing that should be noted: bump your packages only, otherwise check for permission first. No answer means no.

As I don’t have any bump request assigned currently (no, don’t even think about it!) I plan to spend the time writing a script to get performance result.

Now bump the **** out of your packages

Categorie: Gentoo

Sebastian Pipping: Gentoo accepted for Summer of Code 2010

Planet Gentoo - 18 Marzo, 2010 - 22:04

By now the list of projects accepted for Summer of Code has been published: Gentoo is in! Paaaaaaaartyyyyyyy!

If you’re a student and Gentoo user (you must not be a developer already) please check out the (extensible) list of ideas for Gentoo and consider applying with us.

For any questions the gentoo-soc mailing list is the right place. Hope to see you!

Categorie: Gentoo

Sebastian Pipping: Created with Free Software! A button to spread the word

Planet Gentoo - 18 Marzo, 2010 - 19:08

Last month I did a presentation on the concept of redundancy in a human factor related seminar at university. As most participants were non-IT people and using Windows I felt like promoting Free Software without making it “too loud”.

So I came up with the idea of putting a rubber stamp “Created with Free Software” onto the front slide. I found an Inkscape tutorial on rubber stamps to get me started.

This is the result:


On the the front slide:


To get the stamp appear at that very place can be a little tricky. Feel free to inspect the slide sources, particularly redundanz.tex.

By now there is optimized PNGs

  • in 4 colors (original/red, gray, white and black)
  • in 4 sizes (88×28/59, 120×38/81, 180×57/121 and 300×95/201)
  • rotated or not (0° and 25° counter-clockwise)

and SVGs respectively. In case you need PDFs: Inkscape converts well on the commandline:

inkscape --export-pdf=out.pdf in.svg

To see them all please visit the “Created with Free Software” page of the FSFE. Please make use of this stamp whereever you see fits. If you have photos or screenshots of the button in action please comment here.

Please join promoting Free Software!

[EDIT]: The button sources (SVG) are licensed under the Creative Commons Attribution-Share Alike 3.0 license (unlike this blog post itself, see box below). The PNG versions are licensed even more liberally under the Creative Commons Zero 1.0 Universal license. The idea is to keep derivatives “in the pool” while allowing to use the PNGs without even attribution.

Categorie: Gentoo

Ben de Groot: Refocussing my responsibilities within Gentoo

Planet Gentoo - 18 Marzo, 2010 - 17:19

Today I removed myself from most of the herds and projects within Gentoo that I was (more or less) involved in. I can’t pretend I am really an active maintainer in all those herds and lately I have been noticing I am spreading myself too thin. I regularly get “pinged” or mailed concerning packages that I only tangentially am interested in or know of. In an attempt to prevent burn-out and demotivation, I have decided to refocus my activities and responsibilities within Gentoo on those things I am really interested in: Qt and related non-KDE packages, and a few miscellaneous ones (most importantly openbox and poppler).

This also means I stepped down as lead developer of the LXDE project within Gentoo, and have appointed Victor Ostorga, who has been doing some excellent work, as my successor. I am happy to have brought this lightweight desktop to my favorite distro, and I’m sure Victor will manage just fine without me (hopefully with some help from others).

All in all I should have some time freed up to do a few other things. Once again I am trying to find a position as English language teacher in China, and I want to take some time to learn a bit of Mandarin Chinese. I’ve also been bitching about KDE bloat for long enough now, and complaining there is no lighter Qt4 alternative, so I want to see what I can do about that, taking the opportunity to delve deeper into programming.

Categorie: Gentoo

Diego E. Pettenò: Motivating users and teaching them good practises

Planet Gentoo - 16 Marzo, 2010 - 23:27

I’m quite sure that some of the possible voices stirred by my previous posts, and about my less-than-happy comments on Sunrise, is that I dislike or look down on user contributions. All the opposite, I actually think that user contributions are the heart and blood of Gentoo. But I have some particular views about them.

One of the most common approaches for user contributions in Gentoo when I joined was never to do the work in place of the users: get them to fix their ebuild, point out what needs to be worked on, and leave to them to submit an updated ebuild. I shared this sentiment for a while, but nowadays I don’t think it’s the best approach. Since, as I already expressed, there is no good documentation for Gentoo development, it’s difficult for the users to provide good ebuilds by themselves. And sincerely, there is too much old cruft in the tree that shows just a bunch of bad examples.

This works only to a point: those most interested in the inner workings on Gentoo might pick up the opportunity to improve their ebuilds; many others might just feel turned down and will stop caring about their ebuilds; or about Gentoo as a whole! This post by Stephan Gallagher points at something similar.

Now, most of us will agree on the point that the situation where the user stop caring about the ebuild, or decide to keep it in his or her overlay is not good for Gentoo as a whole, but there are two approaches on how to solve this. The one that I openly dislike, and attack, and is followed by the one developer I kept criticising, is to take the ebuild, even though “suboptimal” and commit it to the tree as the user contributed it. I think it is easy to see how that can be a problem.

My favourite approach, instead, is to fix the ebuild; try it out, get it polished, if needed contact upstream to fix possible issues… it might take extra work, even for something you don’t use or care much about, but it gets results handy. To take an example from the past months: Pavel contacted me about gearmand and drizzle; while I’m using neither and I wouldn’t have had time nor interest to write ebuilds for them out of thin air, I gave him a few pointers, and he got back to me with updated ebuilds; they weren’t perfect but they were a good starting point. I polished the ebuilds a bit further, sent upstream a few patches, and now Pavel is still maintaining them, and they seem quite fit for the job to me.

Saying that Pavel’s original ebuilds weren’t fit for the tree, and weren’t good enough, is not the same as insulting Pavel; I’m quite sure he agrees that they weren’t perfect; I’m also quite sure that his next ebuilds “out of thin air” will be better than them, since he has been able to see how some of the things were to be done. Something that, lacking a good documentation, is impossible for users to do without developers’ help.

Sometimes, it’s also easier to go upstream and fix some of the troublesome build systems before going on further with the ebuild, as Enrico will probably remember from the Gource work. But again, you shouldn’t be confusing showing users (and other developers, or developers from other projects) how to do the right thing, and criticising them.

The perfect is the enemy of the done.

Categorie: Gentoo

Diego E. Pettenò: QA, a “popular” task? Really?

Planet Gentoo - 16 Marzo, 2010 - 22:31

In the recent past, after my rant about lack of QA from some developers but not sure if entirely related, I’ve been accused by some people of being more interested in creating “followers” than in the wellness of Gentoo. This really did make me unhappy; not only it’s definitely not the case, but as an atheist, being compared to a cultist is something that hits my very nerves.

Given that my main concern is with quality, I’d say that this is the exact opposite of what they are accusing me to do: QA is one of the most unpopular tasks, and it wouldn’t be effective if it was popular. This does not mean that QA people have to be assholes: while I’m pretty sure I don’t have the most likeable attitude on a technical basis, I’m also always careful to criticise the technical level and not get on the personal level. But it is true that QA needs to take harsh decisions sometimes, be it to remove software that might be bad for the distribution quality, or to remove developers who are harming the project (on a technical, rather than interpersonal, level; the latter is handled by devrel; more to that later).

Saying that I’m not looking to make followers is of course not the same thing than saying I don’t care about thanks, and tokens which would be definitely hypocrite to say. I don’t make a mystery that I’m happy to receive something from time to time, and I don’t avoid thanking when that happens (by the way, thanks Maxim!). I don’t think this is evil to say or write, since it’s in the human nature not to be entirely selfless. Which means that what I do, while being Free in nature, is often subordinated by having something back; it might be intended in the very broad sense of using Free Software and giving back to Free Software, or it might be more tangible, but still there is something for it.

Back on topic. As I said, I think the QA team should be the one deciding whether a developer is a technical liability to the project. This is crucial for the quality to be kept in check: having a “motivated” developer that makes a mess around the tree is not something we’re very happy about; while we strive to motivate people to help out, doing so recklessly is not good. But nobody expects the QA team to be good at judging the interpersonal skills of developers, which is why I said that devrel should do that. On the other hand, it seems like the Developers Relations team wants to take care of that as well. It would be all fine and dandy if the members of that team were to be chosen for their technical skills but … well, that’s not the case for most of them I’m sorry to say, and I don’t think that they’ll be saying otherwise here. The rebuttal we read about that has been that “some of you can join devrel” but the whole point is to keep separated and different the HR team from the technical QA team. They both have their different jobs to attend to.

And by the way, doing the reckless stuff of bumping lots of packages without testing them for the sake of the “bleeders” is probably going to be much much more popular, than turning down packages and ebuilds because they are not good enough (“suboptimal”). While I totally agree that “The perfect is enemy of the good” (or, as I’d phrase it “The perfect is enemy of the done” – Duke Nukem Forever anyone?), it doesn’t take an unreasonable time to get something “good enough”, as you might notice with my recent pam-pgsql or fcron work: neither was perfect the first time around, but they improved from the previous versions and kept going further and further. Now you have two very good ebuilds at your service.

Categorie: Gentoo

Ben de Groot: Qt 4.7 live ebuilds

Planet Gentoo - 16 Marzo, 2010 - 20:12

Recently a new branch was formed in the Qt source repository for the upcoming Qt 4.7 release. The release is expected “mid 2010”. It will carry some exciting new technologies, especially the Qt Declarative UI, using QML (the new Qt Meta-object Language) and Qt Quick (Qt User Interface Creation Kit), as well as some improvements in the multimedia module.

If you want to test the “live” code of this new version in development on Gentoo, we now have ebuilds available in our qting-edge overlay. (Just keep in mind Qt 4.7 is currently incompatible with KDE4, if you happen to use that.) And we also have updated ebuilds for the upcoming Qt Creator 2.0 version.

I’m curious what new Qt application development this will spur.

Categorie: Gentoo

Christian Faulhammer: Automount of LUKS-encrypted partitions

Planet Gentoo - 16 Marzo, 2010 - 18:44

Something I would like to share, because it caused a bad headache for me. There are two external USB hard drives which I wanted to encrypt, one for not really essential data and one for backups. After following a German guide (there is an English version, which seems to be equivalent), one of the drives (brand new) got automounted, asking me for my passphrase, creating the device mapper node and mounting it as it should be. The other one worked by doing the manual steps on the command-line, but udev and Hal did not recognise it properly as LUKS-encrypted. So after some investigation I found the culprit in the cryptsetup udev rules, where the blkid program failed to identify the encrypted partition. After some head scratching, I stumbled upon a blog post by a util-linux hacker, which described the wipefs tool, introduced in util-linux 2.17. It wipes some faulty left-overs of mkfs, which confuses some programs like blkid. Now everything is fine for both external drives.

Categorie: Gentoo

Gentoo News: Council Meeting Summary

Planet Gentoo - 16 Marzo, 2010 - 17:02

What: Gentoo Council Meeting of 8 March 2010.

Voting by email

Ideas seemed to converge on how to vote by email but it was noted that this would constitute a change of GLEP39 which the council can't modify without an all-developers vote. Since there were already other changes planned or suggested to GLEP 39 it was decided that the council would work on a new text and submit it to a vote when ready. Calchan has volunteered to gather all ideas and work on the text.

Do we want a policy for changes in metadata.xml?

Adding such information to metadata.xml was considered a bad idea for two reasons: this information is of no use to the users and would bloat the file for no good reason, and it would be a technical answer to a mostly social problem. It was suggested that reducing territoriality could help. Ideas were proposed like making it official that after sending an email to the maintainers and waiting one week anybody could touch a package.

In the end it wasn't clear what exact problem was to be solved. So scarabeus volunteered to animate the discussions on the mailing list. The goal is to find out what the source of the problem is and what solution(s) we can apply.

For more information, read the summary or the complete IRC log.

Categorie: Gentoo

Damien Krotkine: Syntax Highlighting in Typepad

Planet Gentoo - 15 Marzo, 2010 - 15:37

Code Snippets, Syntax Highlighting, Source examples, Verbatim text, etc...I'm sure I'm not the only one to need to display nice clean and compatible code snippets, source code examples, and similar stuff. I'm using Typepad as blog engine, but what I'll explain here should work with MovableType as well (as the former is a professional version of the open source latter one).

First of all, the needs :

  • I need a tool to display code snippets, examples,
  • It has to be easy to use,
  • It has to be nice
  • It should have syntax highlighting and coloring
  • It has to support Perl, Javascript, and ruby syntax
  • It has to allow download and view as text
  • It has to degrade properly, so that it works in RSS clients

The solution is of course SyntaxHighlighter, the well known tool by Alex Gorbatchev. This tool is used widely and some people have already written on including it in Movable Type, or even in Typepad.

But I thought I would write on it as well, because there are some subtleties, and both SyntaxHighlighter and Typepad evolved since these entries were created.

So, if you don't know this too yet, or are too lazy to check its description page, SyntaxHighlighter is a pure JavaScript + CSS tool that finds and renders content, from a specific standard HTML tag you specify. 

Example

# Some Perl code
my $var = 42;
my @array = map { reverse }
grep { length }
@strings;

sub my_function {
my ($a, $b) = @_;
return ($a * $b);
}

Download

First of all, you don't want to download SyntaxHighlighter from it "official" google code home, because it's hosted by Google (sorry, just kidding) because only the version 1.5 is available there. What we want is version 2.0, which has more features, and includes a Perl syntax brush by default (so no need to get it from elsewhere).

Download SyntaxHighlighter from this page. I downloaded version 2.1.364 (local copy here in case the site is down)

Upload to your TypePad AccountNext, you need to upload the files to your TypePad File Manager. You'll find it in the Library Tab.

 

Then create a directory (I created mine as syntaxhighlighter at the root), and upload the following files. This list is the bare minimum to have it working, but you can (you should) add more brushes to support more languages highlighting, and also upload the icons (the .png files). You could as well upload all the languages brushes. And you can also use a different theme (I'll try the Emacs one, as I'm an Emacs addict).

 

Make sure your upload works by trying to access one of the file (of course replace your real site host name) :

http://YOURSITE.COM/syntaxhighlighter/shCore.js

If you can see or download the file, it means the files are properly uploaded.

Add some magic

For SyntaxHighlighter to work, you need to include some Javascript and CSS to the pages that will contain things you want to highlight. The best is to include it on every pages, as the tool is smart enough to find and apply styling only on what you specify to be highlighted.

Now, how do you add CSS and Javascript to your TypePad blog? There are two cases :

  • Either you are using a simple TypePad design
  • Or you are using an advanced TypePad design

All blog entries I've seen on this topic only handles the case of advanced design, because it's easier to do. But, people using advanced design don't need a tutorial to include SyntaxHighlighter on their blog, they are, you know, advanced enough to do it on their own... So I thought it would be more useful to describe how to do with a simple design.

With a simple design on TypePad, you don't have access to the templates of the pages, but luckily, you can add a module that allows you to add any HTML code in your page. So the idea is to this module to your design content, and add the needed javascript and CSS reference to it. Here is how you can do it.

  • From your TypePad dashboard, go to Design -> Content
  • Add a new module, called "Embed your own HTML" (see picture)
  • Give it a name (it's not used in the page, it's just to see what this module is here for).
  • Be sure that you move the module to be on the lowest part of your blog content (to be loaded last)

 

The content of the module will be used to load SyntaxHighlighter. Here is what I input in the module :

<!-- Include required JS files -->
<script type="text/javascript" src="http://YOURSITE.com
/syntaxhighlighter/shCore.js"></script>

<!-- At least one brush, here we choose Perl.-->
<!-- You need to include a brush for every language you want to highlight -->
<script type="text/javascript" src="http://YOURSITE.com
/syntaxhighlighter/shBrushPerl.js"></script>

<!-- Include *at least* the core style and default theme -->
<!-- You can choose a different theme -->
<link href="http://YOURSITE.com/syntaxhighlighter/shCore.css" rel="stylesheet" type="text/css" />
<link href="http://YOURSITE.com/syntaxhighlighter/shThemeDefault.css" rel="stylesheet" type="text/css" />

<!-- Important options, and finally the main call -->
<script type="text/javascript">
SyntaxHighlighter.config.tagName = "code" // use <code> tags
SyntaxHighlighter.config.stripBrs = true  // disregard trailing <br>
SyntaxHighlighter.all()
</script>

The Options

As you can see, there are 2 options set at the end. These options are to make SyntaxHighlighter more compatible with the TypePad graphical editor. By default, SyntaxHighlighter looks for <pre> tags. But these are rebuilt each time you modify an entry in the graphical editor. So one of the option is to be able to use <code> tags, that are left untouched by TypePad. Well, almost untouched, TypePad tends to add <br> tags at the end of line, which is why the seconde option is there.

Include your code snippet in TypePad

Now that everything is setup, all there is to do to have a nice code example into TypePad is to create a new Post, write the text using the "Rich Text" view of the editor. Then when you want to include a code snippet, switch to the "HTML" view, and add this :

<code class="brush: perl"><br>
# Your code example goes here. For instance, some Perl :<br>
my %hash = { foo => 'bar' };<br>
</code>

Which will output on your blog page as :

# Your code example goes here. For instance, some Perl :
my %hash = { foo => 'bar' };

And inside the TypePad graphical editor, this is what you will see. Most of the Atom / RSS feeds client (like Google Reader) will also have it like this :

 

Which is in my opinion, not too bad !

Conclusion

So here it is : a nice, free and open source syntax highlighter in your TypePad posts, easily included, wich themes, colors, a lot of languages supported, and which degrades nicely for feeds readers. There is more customization possible, I suggest you go look at the SyntaxHighlighter documentation.

I have tried to make this post / tutorial as easy as I possible, but please let me know if you think I should clear ups things, or add more screenshots. If you try to do it on your TypePad account and it works, let me know in the comment. If it doesn't work, I'll try to help.

Categorie: Gentoo
123456789successiva >ultima »