User manual and Sphinx

I’m using Sphinx for documenting my simple roguelike game and the manual is created with that too. Until very recently, I was maintaining some information in two places. Weapons and armours have configuration in game that is used for playing and same information is stored in manual for player to read.

Since Sphinx is very configurable and extensible, I decided to write some directives that I could insert into source of the manual in order to pull data from configuration. Luckily there’s simple tutorial online that was easy enough to modify. Results can be found here.

This allows me to write directives like:

Warhammer
=========
.. itemimage:: warhammer

.. itemdescription:: warhammer

Which results to:
Warhammer
Warhammer
Heavy two-handed weapon that crushes through but the strongest defences. Rare sight in the battle field, because of the huge weight.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s