logo separator

[mkgmap-dev] Style include files

From Steve Ratcliffe steve at parabola.me.uk on Thu Aug 30 21:40:10 BST 2012

Hi

In the style-include branch (pre-built jar files available at 
http://www.mkgmap.org.uk/snapshots/) you can now include files
from the same style.

The syntax is:

	include "filename";

You can put this anywhere where you can start a new rule. The contents
of the file "filename" are included at that point in the file, just as
you would expect.

You can (and probably should) put the files in a subdirectory and
access it as:

	include "inc/filename";

A forward slash should be used, even on windows (untested - will fix if
it doesn't work).

You don't strictly need the quotes around the filename if it is only
letters, but its best to always use them since common filename
characters such as '.' and '/' will require the quotes anyway.

An included file can include another file and this can be arbitrarily
nested. The name of the file is always relative to the top of the
style and not relative to the location of the file that includes it.
So if you have a sub-directory 'inc' with files 'first' and 'second'
and 'inc/first' wants to include 'second' then it is written as:
	include "inc/second";
and not:
	include "second";

You can't yet include files from other styles, maybe that is not
really so useful, what do you think?

..Steve



More information about the mkgmap-dev mailing list