Posted on Dec 19, 2010

RelaxNG, Entities, and Namespaces

I ran into a couple of roadblocks in trying to use entities with Mallard recently, and thought I would share how I worked around them in case anyone else needed to do the same thing. Although my examples deal with Mallard, what I note here will also work for entities in DocBook 5 documents, or any other RelaxNG-based XML documents.

Entities?

Before I start, though, if anyone is wondering what I’m talking about when I say, “entities,” they are a handy variable-like feature of XML and a couple of other markup languages. For example, they allow you to type something like &exaile; into your document, and then have it magically parsed as:

<guiseq><gui>Applications</gui><gui>Multimedia</gui><gui>Exaile</gui><guiseq>

The final, rendered result would be a familiar GUI click-path like, "Click Applications > Multimedia > Exaile." While entities have their limitations and are not ideal for all use-cases, they serve a purpose. This web page gives a good overview of entities and how to use them.

Using Entities in Mallard / RelaxNG documents

To set up and use entities in your XML-based document, you basically need three things. You need a file that contains the entities you want to use*, you need to declare where those entities are tracked, and you need to actually use the entities in your document.

The Entities File

Previously, step one was very easy. You would just create a file that contained values like this:

<?xml version="1.0" encoding="UTF-8"?>
<!-- MENUS -->
<!ENTITY abiword '<guiseq><gui>Applications</gui><gui>Office</gui>
<gui>AbiWord</gui></guiseq>'>
<!ENTITY about-me '<guiseq><gui>Applications</gui><gui>System</gui>
<gui>Users and Groups</gui></guiseq>'>

However a somewhat recent change in libxml** prevents these entities from being parsed as they used to be, making things slightly more involved. (If you’ve been bitten by this bug, libxml will throw up a, “Namespace default prefix was not found” error message.) To resolve this, you need to include the relevant XML namespace in the entity. For Mallard-based documents, the resulting changes look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!-- MENUS -->
<!ENTITY abiword '<guiseq xmlns="http://projectmallard.org/1.0/"><gui>Applications</gui>
<gui>Office</gui><gui>AbiWord</gui></guiseq>'>
<!ENTITY about-me '<guiseq xmlns="http://projectmallard.org/1.0/"><gui>Applications</gui>
<gui>System</gui><gui>Users and Groups</gui></guiseq>'>

Out of the Woods

Once you make it past step one, the rest is a walk in the park.

Step two is to declare your entities in the start of your documentation files. I modified a DocBook 5 example to come up with this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page [
<!ENTITY % entities-xubuntu SYSTEM "libs/xubuntu.ent">
%entities-xubuntu;
]>
<page xmlns="http://projectmallard.org/1.0/"
      type="topic" style="task"
      id="music">

Wrapping Things Up

Step three, using your entities in your documents, is no different than what you would have done with DocBook 4 or any other XML-based syntax. For example, typing &abiword; will be parsed as:

<guiseq><gui>Applications</gui><gui>Office</gui><gui>AbiWord</gui></guiseq>

and will cause “Application > Office > Abiword,” to magically appear in your rendered documentation.

If you have any questions, corrections, or suggestions (as I’m sure you’re all keen to be chatting about XML entities), feel free to leave me a note in the comments.

* I’m using external entities, which requires a separate file, but you can also use named or charater entities.
** Apparently the namespace of the parent node is no longer inherited by the entities, so you need to declare the namespace in the entity itself.

Posted on Nov 22, 2010

Flourish Open Source Conference – Call for Speakers

The University of Illinois at Chicago is once again planning to host their Flourish Open Source conference, and have put out a call for speakers.  The event will be held April 1-3, 2011, on the university’s campus on the near Northwest side of Chicago.

Though the conference is run by student volunteers, you wouldn’t know it judging by how well it is run.  This will be its fifth year, and each event has been well-organized, informative and fun.

For those who are interested in speaking:

Presentations are typically an hour long (including Q&A) and discuss
open-source-related matters of technical, community, or industry importance.
Past presentations have tackled a diverse array of topics – from kernel hacking and programming languages, to community/project management and women in open-source. If they get several proposals around a particular topic, they may opt to build a panel discussion.

Workshops are usually three hours long, and explore a particular topic in an
intensive, hands-on environment. In the past, Flourish has offered workshops
on Android, Websphere, Erlang, Processing, Plone and Drupal. The organizers
provide all necessary connectivity.

The organizers will be accepting proposals via their speaker proposal page up through the Christmas holiday.

Posted on Nov 7, 2010

Xfce 4.8pre1 is released

Today the Xfce team released the first official pre-release build of what will later become Xfce version 4.8.

From the release announcement:

This release incorporates major changes to the core of the Xfce desktop
environment and hopefully succeeds in fulfilling a number of long time
requests. Among the most notable updates is that we have ported the
entire Xfce core (Thunar, xfdesktop and thunar-volman in particular)
from ThunarVFS to GIO, bringing remote filesystems to the Xfce desktop.
The panel has been rewritten from scratch and provides better launcher
management and improved multi-head support. The list of new panel
features is too long to mention in its entirety here. Thanks to the new
menu library garcon (formerly known as libxfce4menu, but rewritten once
again) we now support menu editing via a third-party menu editor such as
Alacarte (we do not ship our own yet). Our core libraries have been
streamlined a bit, a good examplle being the newly introduced libxfce4ui
library which is meant to replace libxfcegui4.

Perhaps the most important achievement we will accomplish with Xfce 4.8
is that, despite suffering from the small size of the development team
from time to time, the core of the desktop environment has been aligned
with today’s desktop technologies such as GIO, ConsoleKit, PolicyKit,
udev and many more. A lot of old cruft has been stripped from the
core as well, as has happened with HAL and ThunarVFS (which is still
around for compatibility reasons).

There will be several additional pre-releases prior to the final release in January.  Read the full release announcement (best viewed in Firefox) for more information about this particular pre-release build.

Posted on Oct 26, 2010

Project News & Status Updates

Here’s a somewhat quick run-down of some projects with-which I’ll be participating, and some other projects that, while I might not be a direct participant, I am curious to watch develop.

Xfce Updates

I see the LXDE project get a good amount of attention lately, in large part (I think) because it uses somewhat less memory than Xfce.  Xfce is still going on strong, though, and plans are in the words for the eventual release of Xfce 4.8.

Jérôme Guelfucci recently provided a brief update on what’s going on with Xfce, and one of the big things is a push for updated documentation.  I’ll be contributing to that, and will likely be borrowing some of the user-help topic “stubs” that have been put-together by the GNOME Documentation team.  I’ll be sure to share any relevant topic stubs with them, too.

Jannis Pohlman has also started the process of forming an Xfce foundation.  Jannis notes that this would make Xfce a legal entity with a board of directors, and that it would help to raise funds through sponsors and other contributors for hackfests and other events.

My Documentation Projects

Lately I have been continuing work on gedit documentation and have also done some initial work on updating the Ubuntu Packaging Guide.  I should have the gedit docs well-drafted within another week or so, but I welcome suggestions and contributions with regards to the Packaging Guide.

Thus far, I’ve drafted the Packaging Guide in Mallard, and although Mallard is XML-based, it is much simpler than DocBook.  It is not difficult to learn, and you can draft-up a nice-looking, topic-focused documentation set with it rather quickly. I also know that there was a UDS session about the Packaging Guide today, so I welcome any feedback that resulted from that session, too.

Other Documentation Projects of Note

In non-Linux-help news, there are a couple of interesting DITA-related projects that I’ve been wanting to mention. If you haven’t heard of it before, DITA* stands for the Darwin Information Typing Architecture, an XML-based syntax originally developed (and later open-sourced) by IBM. The toolkit that processes the syntax, the DITA Open Toolkit, is Java-based, though, which I think has somewhat slowed its adoption in the Linux community. (Currently, only OpenSUSE packages DITA and the DITA Open Toolkit, but their implementation is a bit broken, perhaps due to an outdated version of Saxon in the OpenSUSE repositories.)

When people ask me what the big deal is about DITA**, I like to point them to this white paper (PDF).  It seems to provide a pretty clear picture of what DITA can help you do, even if it does make it look easier to implement than it is in real life.

There are a couple of DITA tools on the horizon that look to make it a bit easier to work with, though.  A group of Drupal developers are working with DITA developers to build a Drupal-based DITA authoring platform.  From what I can tell, it will be released under an open-source license.  They are just in the planning stages now, but I’ve relayed the Ubuntu Documentation / Ubuntu Manual / Ubuntu Learning Team’s requirements from what we talked about this past summer when considering the Ubuntu Learning Center.

Also, Don Day, the chair of the OASIS DITA Technical Committee, has put together a Free-as-in-Freedom web-based DITA platform.  It’s in its early stages, too, but you can get a look at it here. You can log in as a guest, and then select topic tools from the bottom of the page to have a go at editing the document.

A Docs Conference?  In Ohio?

Finally, there is word on the street about the possibility of a docs conference in Cincinnati during the first weekend in June.  I’ve expressed interest in helping with planning and organizing that conference.  For now I will keep my calendar open, and will post more news here as conference plans solidify.

*Whenever you do a Google search for DITA, it’s typically a good idea to exclude the phrase “Von Teese” from your search query.  That is, unless you want your documentation searches to also include results for a fabulous burlesque dancer / entertainer. If you do want dancer / entertainer results in your documentation search queries, then make sure to include the phrase “Von Teese” in your queries.

** Generally, people do not ask me about DITA.

Posted on Aug 29, 2010

Duck, Duck, Gnu: Mallard and DocBook 5 support in Emacs

Edit: I recommend checking out Paul Frields’ post about Emacs and nXML mode, and also looking at the Fedora wiki page that he created.  I think his approach is a bit simpler and cleaner than what I’ve provided below.  Feel free to peruse what I’ve written, though, as some of my links to “getting started” references should still be helpful.


I’ve been doing some documentation work with Mallard and DocBook 5 recently, and have been looking for software that supports them well.  The trick is that both Mallard and DocBook 5 are based on RelaxNG schemas, and while there are many XML tools out there, there are few that are open source, and fewer still that support RelaxNG.

http://www.flickr.com/photos/tsmall/4226883729/sizes/s/

From flickr user tsmall. Attribution-ShareAlike 2.0 Generic license

After perusing my options, I decided to try Emacs with nXML-mode.  Emacs’ nXML-mode provides real-time validation for RelaxNG-based documents, something which no other open source authoring tool provides. But while nXML-mode can validate XML documents on-the-fly, the default installation is not set up to validate against the recently-developed Mallard and DocBook 5 schemas.

Thus, to take full advantage of the latest in duck-based documentation technologies, I needed to modify my .emacs file and the nxml-mode files themselves.  What follows is an overview of exactly what I did in the hopes that others can make use of the same changes, too.

An nXML-mode foundation

Before we get started, though, you should know that much of what follows is derived from information on this website.  I encourage you to visit the site, as it provides an introduction to how nXML-mode is configured, and enough of an introduction to using nXML-mode to make you at least modestly productive right away.

Part One: Setting up your .emacs file

The first step in setting up nXML-mode for Mallard and DocBook 5 is to make a few changes to your .emacs file.  If you are new to Emacs, your .emacs file sits in your home directory, and serves as a personalized Emacs configuration file.  You may need to create the .emacs file if it doesn’t already exist.

;; /usr/share/emacs/site-lisp/tcc-nxml-emacs:  Add these lines
;;      to your .emacs to use nxml-mode.  For documentation of
;;      this mode, see http://www.nmt.edu/tcc/help/pubs/nxml/
;;--
;; Add the nxml files to emacs's search path for loading:
;;--
(setq load-path
      (append load-path
              '("/usr/share/emacs/site-lisp/nxml/")))
;;--
;; Make sure nxml-mode can autoload
;;--
(load "/usr/share/emacs/site-lisp/nxml/rng-auto.el")

;;--
;; Load nxml-mode for files ending in .xml, .xsl, .rng, .xhtml .page
;;--
(setq auto-mode-alist
      (cons '("\.\(xml\|xsl\|rng\|xhtml\|page\)\'" . nxml-mode)
            auto-mode-alist))

The above .emacs configuration tells Emacs where to look for detailed XML processing instructions, and also causes Emacs to automatically use nXML-mode for XML-related files.  (Did I tell you that Emacs might have a bit of a learning curve?  Yeah, that’s true.)

Part Two: Modifying the nXML-mode configuration files

The second step is to modify the nXML-mode configuration files themselves. This will add the appropriate nXML-mode secret sauce to handle Mallard and DocBook 5 documents.

Fortunately for you, I grabbed the latest nXML-mode source files from the nXML-mode website, and made the appropriate modifications myself.  You can download my customized nXML-mode files from this archive.

Here’s what I changed from the default setup:

  • I added the docbookxi.rnc and mallard-1.0.rnc schemas to the schemas directory
  • I modified the schemas.xml file, thus including the docbookxi.rnc and mallard-1.0.rnc schemas as part of the XML-validation process.

Note that I have used the DocBook 5 “docbookxi.rnc” schema which allows for xinclude functionality.  If you want to use the schema that does not allow for use of xinclude features, you’ll need to adjust the files accordingly.  The current DocBook 5 schemas are available here.

Part Three: Copy your nXML-mode files to the proper location
The final step is to copy the nXML-mode files to the proper location on your file system.  As indicated in our .emacs file, that location is:  /usr/share/emacs/site-lisp/nxml/.  Thus, you should copy all of the files in the downloaded “nxml” folder into that directory.  You will need administrative privileges (using root or sudo) to do this.

Wrapping up

That’s it, though.  You should now have a functioning nXML-mode environment that will allow you to fire-up Emacs and start writing Relax-NG-based documents, getting all of the real-time-validation features that Emacs provides. If you can think of any ways in which I could improve my approach, please let me know.  Otherwise, I encourage you to head-on over to the nXML-mode website, and view some of the nXML-mode information and resources that are available as you get started.

Posted on Aug 21, 2010

Upcoming FLOSS-related Events in the Midwest

Here’s a quick rundown of some upcoming Free and Open-Source software events in the Chicagoland / greater-midwest area.

Saturday and Sunday, August 21 and 22, 2010: Barcamp Chicago

  • Running all day and night this Saturday and Sunday
  • 215 E. Ohio Street in downtown Chicago
  • Numerous presentations, and a “BarCompany” startup hackathon

Sunday, August 29: Ubuntu Chicago’s Ubuntu Global Jam

  • Socialize and work with the team on bug-triaging and fixing, documentation, and more!

Friday through Sunday, September 10th through 12th: Ohio Linux Fest

  • Keynote presentations by Stormy Peters, Executive Director of the GNOME Foundation, and Christopher “Monty” Montgomery, creator of the open-source audio format Ogg Vorbis
  • Tracks dedicated to getting started in Free and Open-Source software, Linux security, and so much more.
  • For Ubuntu users, there will be an “Ubucon” during the morning and mid-afternoon hours on Friday.

Saturday and Sunday, October 2nd and 3rd: Barcamp Milwaukee

  • A wide range of sessions relating to Free and Open Source software and general geekery.
  • Like Barcamp Chicago, this event will run throughout the entire weekend, including overnight activities between Saturday and Sunday.

Saturday and Sunday, October 22nd and 23rd: Erlang Camp, Chicago

  • A weekend devoted to learning how to confidently put Erlang code into production for your company, group, or individual project.

Events at the Chicago hacker space, Pumping Station One

  • Check their calendar for their ongoing list of events and activities

Posted on Aug 16, 2010

Thanks, Debian!

Today is Debian’s 17th birthday*, and with that comes Debian Appreciation day!  Do you want to give them some thanks for the super work that they do?  Just head over to thank.debian.net, and leave them a few words to express your gratitude.

You can even search for your favorite package, team, or packaging team, and thank them directly!   (Don’t we all want to thank the XML/SGML Group, though?)

*I’m sure that Debian is looking forward to next year when it will turn 18, and (at least in the U.S.) be able to vote and smoke cigarettes.

Posted on Jul 13, 2010

Updating the Ubuntu Packaging Guide

We’d like to get your input on where to focus documentation efforts on the Ubuntu Packaging Guide. There are all kinds of topics that need to be written, updated, or improved — so where should we start? What do you need most?

Give your input via the this Google Docs Survey. I’ve provided some direction by asking you to focus on tasks, concepts, and terminology that can be best documented in the Packaging Guide, but you’ll no doubt have other ideas.

If you’re interested in writing on a particular topic, please be sure to note that in the survey comments (and include your name and email address!).  I’ll be sure to ping you once we get the new guide outlined and stubbed out.

Also, if you have any suggestions for the packaging guide that aren’t encompassed in the survey, please feel free to leave a comment here.

Thanks!

P.S.  Oh, and wouldn’t you know that the Mozilla documentation team is updating their Mozilla Developer Network documentation, too? Janet Swisher from their docs team published a note seeking developer input on how their docs can be improved.  She publishes her blog content under a CC by SA 3.0 license, so I’ve “borrowed” some of her phrasing.  Hi, Janet!

Posted on Jan 28, 2010

Dear Yahoo!

Dear Yahoo!

Welcome to Ubuntu! As a regular contributor to the Ubuntu project, I think it’s great that you are partnering with Canonical.  Because of the agreement you signed, Canonical will be able to hire more people to work on Free software.  Also, your contributions will help Ubuntu continue offering their OS at no cost to users.  These are great things.

As things get going, though, there is one big thing (or a set of big things centered around one request) that you need to do to make the Ubuntu-Yahoo! user experience better.  In short, you need to index the crap out of Ubuntu- and Linux-related sites.  For example, if I do a Yahoo! search for launchpad bug 387765, I need the first link that comes up to be a link to the actual bug page for Launchpad bug #387765.  As it stands now, a Yahoo! search for that phrase brings up two results, neither of which are relevant.  The first of the two results is a link to the Debian Bugs page on Launchpad.  As a contributor, this is not what I need.

For comparison, the same search on Google brings up 273 results, with the first result being a direct link to the bug report on Launchpad (which is now closed, thanks to the efforts of Fabien Tassin and the other Chromium packagers and hackers)).  Google’s results not only link me directly to the bug that I am inquiring about, but also link me to a large number of pages that may be relevant to that bug report.

The example that I provide above concerns search results that are beneficial for contributors and developers, but what about regular users?  When I search Yahoo! for “Dual boot Windows 7 and Ubuntu,” the first page in the search results is for the Ubuntu 8.04 “Dual Booting,” official documentation page.  This page is out of date, especially given our migration to Grub2 in the 9.10 release.

These are just two examples, and my searches are likely not representative of the multitudes of search requests made daily on your site for Ubuntu-related tasks.  Moreover, I won’t pretend to understand how incredibly complex indexing the web can be.  I’m just writing to note that there is room for improvement, and I would like to see improvement so that our users can use your service to get relevant search results.

After all, improving Linux-related searches would be a win-win for us and for you.  Ubuntu developers and users would get their work done, and problems solved, more quickly and effectively, and you would get more regular users performing their searches on Yahoo!  This sounds pretty good to me.  Here’s to hoping it can happen.

Posted on Jan 9, 2010

Thunar 1.1.0 – Native support for remote filesystems

Update: The updated version of Thunar with network share support will be included as part of Xfce 4.8, sure to be featured by all of the distributions that ship Xfce (e.g., Fedora 15, Xubuntu 11.04, OpenSUSE 11.4, and many others).


Congratulations to Jannis Pohlmann on the release of Thunar 1.1.0!  For those who don’t know, Thunar is the Xfce file manager, and this release marks a major milestone for Thunar and for the Xfce project.  Why is this release so noteworthy?  With this new version of Thunar, users will be able to access networked file systems (SFTP shares, FTP shares, Samba shares, etc.) from within the file manager itself.

This means that desktop users will be able to access their networked files and folders via a couple of clicks.   Users of previous versions of Thunar who wanted to access network folders would have to hack around with FUSE file systems, or use a separate application altogether.  Configuring a special file system, or having to open a different file manager application to get files and folders on a network do not represent user-friendly approaches to networked computing.  Thus, providing network-share support from within the file manager represents a major improvement to the Xfce user experience.

Admittedly, for long-time GNOME and KDE users (or even for Windows or Mac users), adding network-share support to the file manager may not seem like a big deal. The respective GNOME and KDE file managers, Nautilus and Konqueror (or Dolphin), have provided network-share support for some time.  However, Xfce is a much smaller project than GNOME or KDE, so I’m sure that people can appreciate the effort of a small group of developers working to add important end-user functionality such as this.

For long-time Xfce users who don’t want or need the new network share support, and would prefer that things stay as simple and lightweight as possible, there is good news for you, too.  Jannis will be issuing a maintenance release of Thunar that includes several of the improvements from the 1.1.0 release, but uses the previous back-end of Thunar, called Thunar-VFS.  Thunar-VFS does not support native access to network shares.  Thus, individuals who package Thunar for their Linux/BSD distributions will be able to choose whether or not they want to incorporate the new network-share features into their packaged version of Thunar.

While the network-share support is the most prominent improvement that comes with this release of Thunar, several other improvements are also included.  Have a look at the release notes (best viewed in Firefox) if you want the full-scoop on the improvements and new features that come with this new release of Thunar.

[edit] as John Carr indicated in the comments, the GIO/GVfs back-end is the result of the hard work of GNOME developers, so credit is due to them, as well.  Also, the performance of the GIO/GVfs back-end has not been tested in comparisons against the Thunar-VFS back-end.  Thank you for the comment, John.