From 4f78e6cdc2263594b6c185b7d86e95c7d518ca70 Mon Sep 17 00:00:00 2001 From: lanius Date: Wed, 9 Jul 2003 14:08:08 +0000 Subject: sync with website / convert to xml --- desktop-entry/Makefile | 7 - desktop-entry/desktop-entry-spec.sgml | 1033 ------------------------------ desktop-entry/desktop-entry-spec.xml | 1034 ++++++++++++++++++++++++++++++ desktop-entry/spec.dsl | 1139 --------------------------------- 4 files changed, 1034 insertions(+), 2179 deletions(-) delete mode 100644 desktop-entry/Makefile delete mode 100644 desktop-entry/desktop-entry-spec.sgml create mode 100644 desktop-entry/desktop-entry-spec.xml delete mode 100644 desktop-entry/spec.dsl diff --git a/desktop-entry/Makefile b/desktop-entry/Makefile deleted file mode 100644 index 678c153..0000000 --- a/desktop-entry/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: desktop-entry-spec.html desktop-entry-spec.ps - -desktop-entry-spec.html: desktop-entry-spec.sgml spec.dsl - jade -t sgml -i html -d spec.dsl#html -V nochunks desktop-entry-spec.sgml > $@ - -desktop-entry-spec.ps: desktop-entry-spec.sgml spec.dsl - docbook2ps -d spec.dsl#print desktop-entry-spec.sgml > $@ diff --git a/desktop-entry/desktop-entry-spec.sgml b/desktop-entry/desktop-entry-spec.sgml deleted file mode 100644 index 4177c52..0000000 --- a/desktop-entry/desktop-entry-spec.sgml +++ /dev/null @@ -1,1033 +0,0 @@ - -
- - Desktop Entry Standard - Version 0.9.3 - 13 March 2001 - - - Preston - Brown - -
- pbrown@kde.org -
-
-
- - Jonathan - Blandford - -
- jrb@redhat.com -
-
-
- - Owen - Taylor - -
- otaylor@gtk.org -
-
-
-
-
- - - Introduction - - Both the KDE and GNOME desktop environments have adopted a similar - format for "desktop entries," or configuration files describing how a - particular program is to be launched, how it appears in menus, etc. - It is to the larger community's benefit that a unified standard be - agreed upon by all parties such that interoperation between the two - environments, and indeed any additional environments that implement - the specification, becomes simpler. - - - - Basic format of the file - - These desktop entry files should have an extension of ".desktop" or - ".kdelnk". ".kdelnk" is deprecated, and is only maintained for - backwards compatibility. Determining file type on basis of extension - makes determining the file type very easy and quick. When no file - extension is present, the desktop system should fall back to - recognition via "magic detection." Desktop entries which describe how - a directory is to be formatted/displayed should be simply called - ".directory". - - - The basic format of the desktop entry file requires that there be a - "group" header named "[Desktop Entry]". For backwards compatibility, - implementations may also support the header "[KDE Desktop Entry]". - This "group" entry denotes that all {key,value} pairs following it - belong in the Desktop Entry group. There may be other groups present - in the file (see MIME types discussion below), but this is the most - important group which explicitly needs to be supported. This group - should also be used as the "magic key" for automatic mime type - detection. There should be nothing proceeding this group in the - desktop entry file but possibly one or more comments (see - below). - - - Group headers may not contain the characters '[' and ']' as - those delimit the header. - - - Lines beginning with a "#" are considered comments and will be - ignored, however they should be preserved across reads / writes of the - desktop entry file. - - - Compliant implementations MUST not remove any fields from the file, - even if they don't support them. Such fields must be maintained in a - list somewhere, and if the file is "rewritten," they will be included. - This ensures that any desktop-specific extensions will be preserved - even if another system accesses and changes the file. - - - Entries in the file are {key,value} pairs in the format: - - -Name=Value - - Space before and after the equals sign should be ignored; the "=" - sign is the actual delimiter. - - - The escape sequences \s, \n, \t, \r, and \\ are supported, - meaning ASCII space, newline, tab, carriage return, and - backslash, respectively. - - - - Possible value types - - The value types recognized are string, localestring, regular expression, - boolean (encoded as the string true/false), and numeric. - - - The difference between string and localestring is that the value for - a string key must contain only UTF-8 characters and while the value - of a localestring key may contain localized encodings. (See - section 5.) - - - Some keys can have multiple values; these should be separated by a - semicolon. Those keys which have several values should have a - semicolon as the trailing character. For lists of strings, - semicolons are simply not allowed in the strings, there is no - escape mechanism. - - - - Recognized desktop entry keys - - Keys may be postfixed by [locale], where locale is the LOCALE type - of the entry. locale must be of the form lang[_COUNTRY][.ENCODING], - where either _COUNTRY or .ENCODING may be omitted. If a postfixed key - occurs, the same key must be also present without the postfix. - - - When reading in the desktop entry file, the value of the key is - selected by matching the current POSIX locale for the LC_MESSAGES - category against the locale postfixes of all occurrences of the key, - with the .ENCODING part stripped. (The .ENCODING is used when the - Encoding key for the desktop entry file is Legacy-Mixed, see - .) - - - The matching is done as follows: if the current value of - LC_MESSAGES is - lang_country.encoding@modifier, - then, if a key for - lang_country - is present, it will be used. Otherwise, if a key for - lang is present, it will be used. If - both of these are missing, the required key without a locale - specified is used. The encoding and modifier from the - LC_MESSAGES value are ignored. - - - For example, if the current value of the LC_MESSAGES category - is de_DE, and the desktop file includes: - - - Name=Foo - Name[de]=Foo auf Deutsch - - Then the value used for the name key will be 'Foo auf Deutsch'. However, - if a value is specified for Name[de_DE], then that will be used - instead. - - - Case is significant. The keys "Name" and "NAME" are not equivalent. - The same holds for group names. Key values are case sensitive as - well. - - - Keys are either OPTIONAL or REQUIRED. If a key is optional it may or - may not be present in the file. However, if it isn't, the - implementation of the standard should not blow up, it must provide - some sane defaults. Additionally, keys either MUST or MAY be - supported by a particular implementation. - - - Some keys only make sense in the context when another particular key - is also present. - - - Some example keys: Name[C], Comment[it]. - - - Standard Keys - - - - Key - Description - Value Type - REQ? - MUST? - - - - - Encoding - - encoding of the desktop entry file - - string - YES - YES - - - Version - - version of Desktop Entry Specification - - numeric (4) - NO - YES - - - Name - - specific name of the application, for example "Mozilla" - - localestring - YES - YES - - - GenericName - - generic name of the application, for example "Web Browser" - - localestring - YES - YES - - - Type - - the type of desktop entry - - string (1) - YES - YES - - - FilePattern - - a list of regular expressions to match against for a - file manager to determine if this entry's icon should be - displayed. Usually simply the name of the main - executable and friends. - - regexp(s) - NO - NO - - - TryExec - - filename of a binary on disk used to determine if the - program is actually installed. If not, entry may not - show in menus, etc. - - string - NO - NO - - - NoDisplay - - whether not to display in menus, etc. - - boolean - NO - NO - - - Comment - - tooltip for the entry, for example "View sites on the - Internet"; should not be redundant with Name or - GenericName. - - localestring - NO - YES - - - Exec - - program to execute, possibly with arguments - - string - NO - YES - - - Actions - - additional actions possible, see MIME type discussion - in - - string(s) - NO - YES - - - Icon - - icon to display in file manager, menus, etc. If the - name is an absolute path, the given file will be - used. If the name is not an absolute path, an - implementation-dependent search algorithm will be used - to locate the icon. Icons may be localized with the - Icon[xx]= syntax, but filenames should be in UTF-8, not - locale encoding. - - string - NO - YES - - - MiniIcon - - small icon for menus, etc (deprecated). - - string - NO - NO - - - Hidden - - if true, pretend this entry doesn't exist. - - boolean - NO - NO - - - Path - - if entry is type Application, the working directory to run the program in. - - string - NO - YES - - - Terminal - - whether the program runs in a terminal window - - boolean (2) - NO - YES - - - TerminalOptions - - if the program runs in a terminal, any options that - should be passed to the terminal emulator before - actually executing the program. This field is - deprecated because it's dependent on which emulator - is used. - - string - NO - NO - - - SwallowTitle - - if entry is swallowed onto the panel, this should be the title of window - - localestring - NO - NO - - - SwallowExec - - program to exec if swallowed app is clicked - - string - NO - NO - - - MimeType - - the MIME type(s) supported by this entry - - regexp(s) - NO - NO - - - Patterns - - if entry is type MimeType, various file name extensions - associated with the MIME type. - - regexp(s) - NO - NO - - - DefaultApp - - if entry is type MimeType, the default application associated with this mime type - - string - NO - NO - - - Dev - - if FSDevice type of entry, the device to mount - - string - NO - NO - - - FSType - - The type of filesystem to try to mount - - string - NO - NO - - - MountPoint - - if FSDevice type of entry, the mount point of the device in question - - string - NO - NO - - - ReadOnly - - if FSDevice type of entry, specifies whether or not the device is read-only - - boolean (2) - NO - NO - - - UnmountIcon - - icon to display when device is not mounted Mounted devices display icon from Icon key - - string - NO - NO - - - SortOrder - - if entry of type Directory, this may specify the order in which to display files - - strings (3) - NO - NO - - - URL - - if entry is Link type, the URL to access - - string - NO - YES - - - BinaryPattern - - Deprecated. - - string - NO - NO - - - DocPath - - Deprecated. - - string - NO - NO - - - Extensions - - Deprecated. - - string - NO - NO - - - InitialPreference - - Deprecated. - - string - NO - NO - - - Keywords - - Deprecated. - - string - NO - NO - - - MapNotify - - Deprecated. - - string - NO - NO - - - Protocols - - Deprecated. - - string - NO - NO - - - ServiceTypes - - Deprecated. - - string - NO - NO - - - -
- - Notes: - - - - - possible values are Application, Link, FSDevice, MimeType, Directory, - Service, ServiceType - - - - - historically these have been represented by the numeric entries 0 - or 1. With this version of the standard they are now to be - represented as a boolean string. However, if an implementation is - reading a pre-1.0 desktop entry, it should interpret 0 and 1 as false - and true, respectively. - - - - - historically this has been a comma separated list. This is inconsistent - with other lists which are separated by a semicolon. When reading - a pre-1.0 desktop entry, comma separated lists should continue to - be supported. - - - - - while the version field is not required to be present, it should - be in all newer implementations of the Desktop Entry specification. - If the version number is not present, a "pre-standard" desktop entry - file is to be assumed. - - - -
- - Character set encoding of the file - - Desktop entry files are encoded as lines of 8-bit characters separated - by LF characters. - - - Except for comments and values of type localestring, only ASCII - characters are permitted in the file: - - - - - Key names must contain only the characters 'A-Za-z0-9-' - - - - - Group names may contain all ASCII characters except for control - characters and '[' and ']'. - - - - - Values of type string may contain all ASCII characters except - for control characters. - - - - - Values of type boolean must either be the string 'true' or - 'false' - - - - - Numeric values must be a valid floating point number as recognized - by the %f specifier for scanf. - - - - - Comment lines are uninterpreted and may contain any character - (except for LF). However, using UTF-8 for comment lines that - contain characters not in ASCII is encouraged. - - - The encoding for values of type localestring is determined by the - Encoding field of the desktop entry. This field should always - be present. (However, many legacy files may not include it.) - - - Only two values for Encoding are currently defined: 'UTF-8', and - 'Legacy-Mixed', and desktop files must not use any other value. - Implementations must support the UTF-8 encoding, and may choose - to support Legacy-Mixed in addition. For this reason, authors - of desktop files are encouraged to use the value 'UTF-8'. - - - If the file specifies an unsupported encoding, the implementation - should either ignore the file, or, if the user has requested a direct - operation on the file (such as opening it for editing), display an - appropriate error indication to the user. - - - In the absence of an Encoding line, the implementation may choose - to autodetect the encoding of the file by using such factors - as: - - - - - The location of the file on the filesystem - - - - - Whether the contents of the file are valid UTF-8 - - - - - If the implementation does not perform such auto-detection, it should - treat a file without an Encoding key in the same way as a file with an - unsupported Encoding Key. - - - - List of valid Exec parameter variables - - Each "Exec" field may take a number of arguments which will be - expanded by the file manager or program launcher and passed to the - program if necessary. - - - Literal % characters must be escaped as %%, and adding new - format characters is not allowed. It's a fatal error to have an - Exec field with a format character not given in the spec. - Again for emphasis: nonstandard extensions are - not allowed here - you must add an X-Foo-Exec field if you have - nonstandard Exec lines. - - - Recognized fields are as follows: - - - - - - %f - - a single file name, even if multiple files are selected. The system - reading the Desktop Entry should recognize that the program in - question cannot handle multiple file arguments, and it should - should probably spawn and execute multiple copies of a program - for each selected file if the program is not able to handle - additional file arguments. If files are not on the local file system - (i.e. HTTP or FTP locations), the files will be copied to the local - file system and %f will be expanded to point at the temporary - file. Used for programs that do not understand URL syntax. - - - - %F - - a list of files. Use for apps that can open several local - files at once. - - - - %u - - a single URL. - - - - %U - - a list of URLs. - - - - %d - - directory containing the file that would be passed in a %f field - - - - %D - - list of directories containing the files that would be - passed in to a %F field - - - - %n - - a single filename (without path) - - - - %N - - a list of filenames (without path) - - - - %i - - the icon associated with the desktop entry - - - - %m - - the mini-icon associated with the desktop entry - - - - %c - - the comment associated with the desktop entry - - - - %k - - the name of the desktop file - - - - %v - - the name of the Device entry in the desktop file - - - - - - - - Detailed discussion of supporting MIME types - - It is in every desktop's best interest to have thorough support for - mime types. The old /etc/mailcap and /etc/mime.types files are rather - limited in scope and frankly, are outdated. Various desktop systems - have come up with different ways of extending this original system, - but none are compatible with each other. The Desktop Entry Standard - hopes to be able to provide the beginnings of a solution to this - problem. - - - At a very basic level, the "Exec" key provides the default action to - take when the program described by a desktop entry is used to open a - document or data file. Usually this consists of some action along the - lines of "kedit %f" or "ee %f". This is a good - start, but it isn't as flexible as it can be. - - - Let us first establish that a program which supports a MIME type or - multiple mime types may be able to support multiple actions on those - MIME types as well. The desktop entry may want to define additional - actions in addition to the default. The toplevel "Exec" key describes - the default action; Let us define this action to also be known as the - "Open" action. Additional actions which might be possible include - View, Edit, Play, etc. A further revision of this document will - probably specify several "standard" actions in addition to the default - "Open" action, but in all cases, the number of actions is - arbitrary. - - - Let us use a sound player as a simple example. Call it sp. The - default Exec (Open) action for this program would likely look - something like: - - -Exec=sp %u - - However, imagine the sound player also supports editing of sound files - in a graphical manner. We might wish to define an additional action - which could accomodate this. Adding the action would be performed - like this: - - -Actions=Edit; - -[Desktop Action Edit] -Exec=sp -edit %u - - As you can see, defining the action "edit" will enable an additional - group of the name [Desktop Action actionname] to be read. This - group can contain an additional Exec line, as well as possibly other - information like a new Name, Comment, Icon, and Path. Thus - right-clicking on a .wav file will show both the default "Open" action - and this "Edit" action to both be displayed as choices in the - context-menu. A left click (double or single, whichever the file - manager implements) would cause the default action to take place. - These are implementation-specific details which are up to the - implementer, and are not enforced by this standard. - - - If no DefaultApp is specified for a particular MIME type, any one of - the programs registered which claim to be able to handle the MIME type - may become the default handler. This behaviour is undefined and - implementation-specific. KDE doesn't use a DefaultApp anymore, but assigns - a Preference number to each program, so that the highest number is the - one chosen for handling the MIME type. - - - - Extending the format - - If the standard is to be amended with a new {key,value} pair which - should be applicable to all supporting parties, a group discussion - will take place. This is the preferred method for introducing - changes. If one particular party wishes to add a field for personal - use, they should prefix the key with the string "X-PRODUCT", - i.e. "X-NewDesktop-Foo", following the precedent set by other IETF and RFC - standards. - - - Alternatively, fields can be placed in their own group, where they may - then have arbitrary key names. If this is the case, the group should - follow the scheme outlined above, i.e. [X-PRODUCT GROUPNAME] or - something similar. These steps will avoid namespace clashes between - different yet similar environments. - - - - Example Desktop Entry File - -[Desktop Entry] -Version=1.0 -Type=Application -Name=Foo Viewer -Comment=The best viewer for Foo objects available! -TryExec=fooview -Exec=fooview %F -Actions=Edit;Inverse -Icon=fooview.png -MimeType=image/x-foo -X-KDE-Library=libfooview -X-KDE-FactoryName=fooviewfactory -X-KDE-ServiceType=FooService - -[Desktop Action Inverse] -Exec=fooview --inverse %f -Name=Foo Viewer (inverse image) - -[Desktop Action Edit] -Exec=fooview --edit %f -Name=Foo Viewer (edit image) -Icon=fooview-edit.png - - - The Legacy-Mixed encoding - - The Legacy-Mixed encoding corresponds to the traditional encoding - of desktop files in older versions of the GNOME and KDE desktop - files. In this encoding, the encoding of each localestring key - is determined by the locale tag for that key, if any. For keys - without a locale tag, the value must contain only ASCII - characters. - - - If the locale tag includes an .ENCODING part, then that determines - the encoding for the line. Otherwise, the encoding is determined - by the language, or language-country pair from the locale tag, according - to the following table. (A language-country locale tag matches a - language by itself in the table if the language-country pair isn't - explicitely in the table.) - - - - - - Encoding - Aliases - Tags - - - - - ARMSCII-8 (*)hy - - BIG5zh_TW - - CP1251be bg - - EUC-CNGB2312zh_CN - - EUC-JPja - - EUC-KRko - - GEORGIAN-ACADEMY (*) - - GEORGIAN-PS (*)ka - - ISO-8859-1br ca da de en es eu fi fr gl it nl wa no pt sv - - ISO-8859-2cs hr hu pl ro sk sl sq sr - - ISO-8859-3 eo - - ISO-8859-5mk sp - - ISO-8859-7el - - ISO-8859-9tr - - ISO-8859-13lt lv mi - - ISO-8859-14ga cy - - ISO-8859-15et - - KOI8-Rru - - KOI8-Uuk - - TCVN-5712 (*)TCVNvi - - TIS-620th - - VISCII - - - - - - - Encoding - - - The name given here is listed here is typically the - canonical name for the encoding in the GNU C Library's - iconv facility Encodings marked with (*) are not - currently supported by the GNU C Library; for this reason, - implementations may choose to ignore lines in desktop - files that resolve to this encoding. Desktop files with - these encodings are currently rare or non-existent. - - - - - Aliases - - - Other names for the encoding found in existing desktop - files. - - - - - Tags - - - Language tags for which this is the default encoding. - - - - - - This table above covers all tags and encodings that are known to - be currently in use. Implementors may choose to support - encodings not in the above set. For tags without defaults listed - in the above table, desktop file creators must specify the - ENCODING part of the locale tag. - - - Matching the ENCODING part of the locale tag against a locale - name or alias should be done by stripping all punctuation - characters from both the tag and the name or alias, converting - both name and alias to lowercase, and comparing the result. - This is necessary because, for example, "Big5" is frequently - found instead of "BIG5" and "georgianacademy" instead of - GEORGIAN-ACADEMY. Desktop files creators should, however, use - the name as it appears in the "Encoding" column above. - - -
- diff --git a/desktop-entry/desktop-entry-spec.xml b/desktop-entry/desktop-entry-spec.xml new file mode 100644 index 0000000..d39e891 --- /dev/null +++ b/desktop-entry/desktop-entry-spec.xml @@ -0,0 +1,1034 @@ + +
+ + Desktop Entry Standard + Version 0.9.3 + 13 March 2001 + + + Preston + Brown + +
+ pbrown@kde.org +
+
+
+ + Jonathan + Blandford + +
+ jrb@redhat.com +
+
+
+ + Owen + Taylor + +
+ otaylor@gtk.org +
+
+
+
+
+ + + Introduction + + Both the KDE and GNOME desktop environments have adopted a similar + format for "desktop entries," or configuration files describing how a + particular program is to be launched, how it appears in menus, etc. + It is to the larger community's benefit that a unified standard be + agreed upon by all parties such that interoperation between the two + environments, and indeed any additional environments that implement + the specification, becomes simpler. + + + + Basic format of the file + + These desktop entry files should have an extension of ".desktop" or + ".kdelnk". ".kdelnk" is deprecated, and is only maintained for + backwards compatibility. Determining file type on basis of extension + makes determining the file type very easy and quick. When no file + extension is present, the desktop system should fall back to + recognition via "magic detection." Desktop entries which describe how + a directory is to be formatted/displayed should be simply called + ".directory". + + + The basic format of the desktop entry file requires that there be a + "group" header named "[Desktop Entry]". For backwards compatibility, + implementations may also support the header "[KDE Desktop Entry]". + This "group" entry denotes that all {key,value} pairs following it + belong in the Desktop Entry group. There may be other groups present + in the file (see MIME types discussion below), but this is the most + important group which explicitly needs to be supported. This group + should also be used as the "magic key" for automatic mime type + detection. There should be nothing proceeding this group in the + desktop entry file but possibly one or more comments (see + below). + + + Group headers may not contain the characters '[' and ']' as + those delimit the header. + + + Lines beginning with a "#" are considered comments and will be + ignored, however they should be preserved across reads / writes of the + desktop entry file. + + + Compliant implementations MUST not remove any fields from the file, + even if they don't support them. Such fields must be maintained in a + list somewhere, and if the file is "rewritten," they will be included. + This ensures that any desktop-specific extensions will be preserved + even if another system accesses and changes the file. + + + Entries in the file are {key,value} pairs in the format: + + +Name=Value + + Space before and after the equals sign should be ignored; the "=" + sign is the actual delimiter. + + + The escape sequences \s, \n, \t, \r, and \\ are supported, + meaning ASCII space, newline, tab, carriage return, and + backslash, respectively. + + + + Possible value types + + The value types recognized are string, localestring, regular expression, + boolean (encoded as the string true/false), and numeric. + + + The difference between string and localestring is that the value for + a string key must contain only UTF-8 characters and while the value + of a localestring key may contain localized encodings. (See + section 5.) + + + Some keys can have multiple values; these should be separated by a + semicolon. Those keys which have several values should have a + semicolon as the trailing character. For lists of strings, + semicolons are simply not allowed in the strings, there is no + escape mechanism. + + + + Recognized desktop entry keys + + Keys may be postfixed by [locale], where locale is the LOCALE type + of the entry. locale must be of the form lang[_COUNTRY][.ENCODING], + where either _COUNTRY or .ENCODING may be omitted. If a postfixed key + occurs, the same key must be also present without the postfix. + + + When reading in the desktop entry file, the value of the key is + selected by matching the current POSIX locale for the LC_MESSAGES + category against the locale postfixes of all occurrences of the key, + with the .ENCODING part stripped. (The .ENCODING is used when the + Encoding key for the desktop entry file is Legacy-Mixed, see + .) + + + The matching is done as follows: if the current value of + LC_MESSAGES is + lang_country.encoding@modifier, + then, if a key for + lang_country + is present, it will be used. Otherwise, if a key for + lang is present, it will be used. If + both of these are missing, the required key without a locale + specified is used. The encoding and modifier from the + LC_MESSAGES value are ignored. + + + For example, if the current value of the LC_MESSAGES category + is de_DE, and the desktop file includes: + + + Name=Foo + Name[de]=Foo auf Deutsch + + Then the value used for the name key will be 'Foo auf Deutsch'. However, + if a value is specified for Name[de_DE], then that will be used + instead. + + + Case is significant. The keys "Name" and "NAME" are not equivalent. + The same holds for group names. Key values are case sensitive as + well. + + + Keys are either OPTIONAL or REQUIRED. If a key is optional it may or + may not be present in the file. However, if it isn't, the + implementation of the standard should not blow up, it must provide + some sane defaults. Additionally, keys either MUST or MAY be + supported by a particular implementation. + + + Some keys only make sense in the context when another particular key + is also present. + + + Some example keys: Name[C], Comment[it]. + + + Standard Keys + + + + Key + Description + Value Type + REQ? + MUST? + + + + + Encoding + + encoding of the desktop entry file + + string + YES + YES + + + Version + + version of Desktop Entry Specification + + numeric (4) + NO + YES + + + Name + + specific name of the application, for example "Mozilla" + + localestring + YES + YES + + + GenericName + + generic name of the application, for example "Web Browser" + + localestring + YES + YES + + + Type + + the type of desktop entry + + string (1) + YES + YES + + + FilePattern + + a list of regular expressions to match against for a + file manager to determine if this entry's icon should be + displayed. Usually simply the name of the main + executable and friends. + + regexp(s) + NO + NO + + + TryExec + + filename of a binary on disk used to determine if the + program is actually installed. If not, entry may not + show in menus, etc. + + string + NO + NO + + + NoDisplay + + whether not to display in menus, etc. + + boolean + NO + NO + + + Comment + + tooltip for the entry, for example "View sites on the + Internet"; should not be redundant with Name or + GenericName. + + localestring + NO + YES + + + Exec + + program to execute, possibly with arguments + + string + NO + YES + + + Actions + + additional actions possible, see MIME type discussion + in + + string(s) + NO + YES + + + Icon + + icon to display in file manager, menus, etc. If the + name is an absolute path, the given file will be + used. If the name is not an absolute path, an + implementation-dependent search algorithm will be used + to locate the icon. Icons may be localized with the + Icon[xx]= syntax, but filenames should be in UTF-8, not + locale encoding. + + string + NO + YES + + + MiniIcon + + small icon for menus, etc (deprecated). + + string + NO + NO + + + Hidden + + if true, pretend this entry doesn't exist. + + boolean + NO + NO + + + Path + + if entry is type Application, the working directory to run the program in. + + string + NO + YES + + + Terminal + + whether the program runs in a terminal window + + boolean (2) + NO + YES + + + TerminalOptions + + if the program runs in a terminal, any options that + should be passed to the terminal emulator before + actually executing the program. This field is + deprecated because it's dependent on which emulator + is used. + + string + NO + NO + + + SwallowTitle + + if entry is swallowed onto the panel, this should be the title of window + + localestring + NO + NO + + + SwallowExec + + program to exec if swallowed app is clicked + + string + NO + NO + + + MimeType + + the MIME type(s) supported by this entry + + regexp(s) + NO + NO + + + Patterns + + if entry is type MimeType, various file name extensions + associated with the MIME type. + + regexp(s) + NO + NO + + + DefaultApp + + if entry is type MimeType, the default application associated with this mime type + + string + NO + NO + + + Dev + + if FSDevice type of entry, the device to mount + + string + NO + NO + + + FSType + + The type of filesystem to try to mount + + string + NO + NO + + + MountPoint + + if FSDevice type of entry, the mount point of the device in question + + string + NO + NO + + + ReadOnly + + if FSDevice type of entry, specifies whether or not the device is read-only + + boolean (2) + NO + NO + + + UnmountIcon + + icon to display when device is not mounted Mounted devices display icon from Icon key + + string + NO + NO + + + SortOrder + + if entry of type Directory, this may specify the order in which to display files + + strings (3) + NO + NO + + + URL + + if entry is Link type, the URL to access + + string + NO + YES + + + BinaryPattern + + Deprecated. + + string + NO + NO + + + DocPath + + Deprecated. + + string + NO + NO + + + Extensions + + Deprecated. + + string + NO + NO + + + InitialPreference + + Deprecated. + + string + NO + NO + + + Keywords + + Deprecated. + + string + NO + NO + + + MapNotify + + Deprecated. + + string + NO + NO + + + Protocols + + Deprecated. + + string + NO + NO + + + ServiceTypes + + Deprecated. + + string + NO + NO + + + +
+ + Notes: + + + + + possible values are Application, Link, FSDevice, MimeType, Directory, + Service, ServiceType + + + + + historically these have been represented by the numeric entries 0 + or 1. With this version of the standard they are now to be + represented as a boolean string. However, if an implementation is + reading a pre-1.0 desktop entry, it should interpret 0 and 1 as false + and true, respectively. + + + + + historically this has been a comma separated list. This is inconsistent + with other lists which are separated by a semicolon. When reading + a pre-1.0 desktop entry, comma separated lists should continue to + be supported. + + + + + while the version field is not required to be present, it should + be in all newer implementations of the Desktop Entry specification. + If the version number is not present, a "pre-standard" desktop entry + file is to be assumed. + + + +
+ + Character set encoding of the file + + Desktop entry files are encoded as lines of 8-bit characters separated + by LF characters. + + + Except for comments and values of type localestring, only ASCII + characters are permitted in the file: + + + + + Key names must contain only the characters 'A-Za-z0-9-' + + + + + Group names may contain all ASCII characters except for control + characters and '[' and ']'. + + + + + Values of type string may contain all ASCII characters except + for control characters. + + + + + Values of type boolean must either be the string 'true' or + 'false' + + + + + Numeric values must be a valid floating point number as recognized + by the %f specifier for scanf. + + + + + Comment lines are uninterpreted and may contain any character + (except for LF). However, using UTF-8 for comment lines that + contain characters not in ASCII is encouraged. + + + The encoding for values of type localestring is determined by the + Encoding field of the desktop entry. This field should always + be present. (However, many legacy files may not include it.) + + + Only two values for Encoding are currently defined: 'UTF-8', and + 'Legacy-Mixed', and desktop files must not use any other value. + Implementations must support the UTF-8 encoding, and may choose + to support Legacy-Mixed in addition. For this reason, authors + of desktop files are encouraged to use the value 'UTF-8'. + + + If the file specifies an unsupported encoding, the implementation + should either ignore the file, or, if the user has requested a direct + operation on the file (such as opening it for editing), display an + appropriate error indication to the user. + + + In the absence of an Encoding line, the implementation may choose + to autodetect the encoding of the file by using such factors + as: + + + + + The location of the file on the filesystem + + + + + Whether the contents of the file are valid UTF-8 + + + + + If the implementation does not perform such auto-detection, it should + treat a file without an Encoding key in the same way as a file with an + unsupported Encoding Key. + + + + List of valid Exec parameter variables + + Each "Exec" field may take a number of arguments which will be + expanded by the file manager or program launcher and passed to the + program if necessary. + + + Literal % characters must be escaped as %%, and adding new + format characters is not allowed. It's a fatal error to have an + Exec field with a format character not given in the spec. + Again for emphasis: nonstandard extensions are + not allowed here - you must add an X-Foo-Exec field if you have + nonstandard Exec lines. + + + Recognized fields are as follows: + + + + + + %f + + a single file name, even if multiple files are selected. The system + reading the Desktop Entry should recognize that the program in + question cannot handle multiple file arguments, and it should + should probably spawn and execute multiple copies of a program + for each selected file if the program is not able to handle + additional file arguments. If files are not on the local file system + (i.e. HTTP or FTP locations), the files will be copied to the local + file system and %f will be expanded to point at the temporary + file. Used for programs that do not understand URL syntax. + + + + %F + + a list of files. Use for apps that can open several local + files at once. + + + + %u + + a single URL. + + + + %U + + a list of URLs. + + + + %d + + directory containing the file that would be passed in a %f field + + + + %D + + list of directories containing the files that would be + passed in to a %F field + + + + %n + + a single filename (without path) + + + + %N + + a list of filenames (without path) + + + + %i + + the icon associated with the desktop entry + + + + %m + + the mini-icon associated with the desktop entry + + + + %c + + the comment associated with the desktop entry + + + + %k + + the name of the desktop file + + + + %v + + the name of the Device entry in the desktop file + + + + + + + + Detailed discussion of supporting MIME types + + It is in every desktop's best interest to have thorough support for + mime types. The old /etc/mailcap and /etc/mime.types files are rather + limited in scope and frankly, are outdated. Various desktop systems + have come up with different ways of extending this original system, + but none are compatible with each other. The Desktop Entry Standard + hopes to be able to provide the beginnings of a solution to this + problem. + + + At a very basic level, the "Exec" key provides the default action to + take when the program described by a desktop entry is used to open a + document or data file. Usually this consists of some action along the + lines of "kedit %f" or "ee %f". This is a good + start, but it isn't as flexible as it can be. + + + Let us first establish that a program which supports a MIME type or + multiple mime types may be able to support multiple actions on those + MIME types as well. The desktop entry may want to define additional + actions in addition to the default. The toplevel "Exec" key describes + the default action; Let us define this action to also be known as the + "Open" action. Additional actions which might be possible include + View, Edit, Play, etc. A further revision of this document will + probably specify several "standard" actions in addition to the default + "Open" action, but in all cases, the number of actions is + arbitrary. + + + Let us use a sound player as a simple example. Call it sp. The + default Exec (Open) action for this program would likely look + something like: + + +Exec=sp %u + + However, imagine the sound player also supports editing of sound files + in a graphical manner. We might wish to define an additional action + which could accomodate this. Adding the action would be performed + like this: + + +Actions=Edit; + +[Desktop Action Edit] +Exec=sp -edit %u + + As you can see, defining the action "edit" will enable an additional + group of the name [Desktop Action actionname] to be read. This + group can contain an additional Exec line, as well as possibly other + information like a new Name, Comment, Icon, and Path. Thus + right-clicking on a .wav file will show both the default "Open" action + and this "Edit" action to both be displayed as choices in the + context-menu. A left click (double or single, whichever the file + manager implements) would cause the default action to take place. + These are implementation-specific details which are up to the + implementer, and are not enforced by this standard. + + + If no DefaultApp is specified for a particular MIME type, any one of + the programs registered which claim to be able to handle the MIME type + may become the default handler. This behaviour is undefined and + implementation-specific. KDE doesn't use a DefaultApp anymore, but assigns + a Preference number to each program, so that the highest number is the + one chosen for handling the MIME type. + + + + Extending the format + + If the standard is to be amended with a new {key,value} pair which + should be applicable to all supporting parties, a group discussion + will take place. This is the preferred method for introducing + changes. If one particular party wishes to add a field for personal + use, they should prefix the key with the string "X-PRODUCT", + i.e. "X-NewDesktop-Foo", following the precedent set by other IETF and RFC + standards. + + + Alternatively, fields can be placed in their own group, where they may + then have arbitrary key names. If this is the case, the group should + follow the scheme outlined above, i.e. [X-PRODUCT GROUPNAME] or + something similar. These steps will avoid namespace clashes between + different yet similar environments. + + + + Example Desktop Entry File + +[Desktop Entry] +Version=1.0 +Type=Application +Name=Foo Viewer +Comment=The best viewer for Foo objects available! +TryExec=fooview +Exec=fooview %F +Actions=Edit;Inverse +Icon=fooview.png +MimeType=image/x-foo +X-KDE-Library=libfooview +X-KDE-FactoryName=fooviewfactory +X-KDE-ServiceType=FooService + +[Desktop Action Inverse] +Exec=fooview --inverse %f +Name=Foo Viewer (inverse image) + +[Desktop Action Edit] +Exec=fooview --edit %f +Name=Foo Viewer (edit image) +Icon=fooview-edit.png + + + The Legacy-Mixed encoding + + The Legacy-Mixed encoding corresponds to the traditional encoding + of desktop files in older versions of the GNOME and KDE desktop + files. In this encoding, the encoding of each localestring key + is determined by the locale tag for that key, if any. For keys + without a locale tag, the value must contain only ASCII + characters. + + + If the locale tag includes an .ENCODING part, then that determines + the encoding for the line. Otherwise, the encoding is determined + by the language, or language-country pair from the locale tag, according + to the following table. (A language-country locale tag matches a + language by itself in the table if the language-country pair isn't + explicitely in the table.) + + + + + + Encoding + Aliases + Tags + + + + + ARMSCII-8 (*)hy + + BIG5zh_TW + + CP1251be bg + + EUC-CNGB2312zh_CN + + EUC-JPja + + EUC-KRko + + GEORGIAN-ACADEMY (*) + + GEORGIAN-PS (*)ka + + ISO-8859-1br ca da de en es eu fi fr gl it nl wa no pt sv + + ISO-8859-2cs hr hu pl ro sk sl sq sr + + ISO-8859-3 eo + + ISO-8859-5mk sp + + ISO-8859-7el + + ISO-8859-9tr + + ISO-8859-13lt lv mi + + ISO-8859-14ga cy + + ISO-8859-15et + + KOI8-Rru + + KOI8-Uuk + + TCVN-5712 (*)TCVNvi + + TIS-620th + + VISCII + + + + + + + Encoding + + + The name given here is listed here is typically the + canonical name for the encoding in the GNU C Library's + iconv facility Encodings marked with (*) are not + currently supported by the GNU C Library; for this reason, + implementations may choose to ignore lines in desktop + files that resolve to this encoding. Desktop files with + these encodings are currently rare or non-existent. + + + + + Aliases + + + Other names for the encoding found in existing desktop + files. + + + + + Tags + + + Language tags for which this is the default encoding. + + + + + + This table above covers all tags and encodings that are known to + be currently in use. Implementors may choose to support + encodings not in the above set. For tags without defaults listed + in the above table, desktop file creators must specify the + ENCODING part of the locale tag. + + + Matching the ENCODING part of the locale tag against a locale + name or alias should be done by stripping all punctuation + characters from both the tag and the name or alias, converting + both name and alias to lowercase, and comparing the result. + This is necessary because, for example, "Big5" is frequently + found instead of "BIG5" and "georgianacademy" instead of + GEORGIAN-ACADEMY. Desktop files creators should, however, use + the name as it appears in the "Encoding" column above. + + +
+ diff --git a/desktop-entry/spec.dsl b/desktop-entry/spec.dsl deleted file mode 100644 index 55062c0..0000000 --- a/desktop-entry/spec.dsl +++ /dev/null @@ -1,1139 +0,0 @@ - - - -]]> - - -]]> -]> - - - - - - - - - -;;========================================================================== -;; PRINT -;;========================================================================== - -;;====================================== -;;General Options -;;====================================== - -;;Do you want to print on both sides of the paper? -(define %two-side% - #t) - -;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.) -(define %section-autolabel% - #t) - -;;What is the default extension for graphics? -(define %graphic-default-extension% - "eps") - -;;Show URL links? If the text of the link and the URL are identical, -;;the parenthetical URL is suppressed. -(define %show-ulinks% - #t) - -;Make Ulinks footnotes to stop bleeding in the edges - this increases -;'jade --> print' time tremendously keep this in mind before -;complaining! -(define %footnote-ulinks% - #t) - -;;Tex Backend on -(define tex-backend - #t) - -;;Define Line Spacing -(define %line-spacing-factor% 1.1) - -;;Define the Paragraph Style -(define para-style - (style - font-size: %bf-size% - font-weight: 'medium - font-posture: 'upright - font-family-name: %body-font-family% - line-spacing: (* %bf-size% %line-spacing-factor%))) - -(define ($object-titles-after$) - (list (normalize "figure"))) - -;;====================================== -;;Book Options -;;====================================== - - -;;Do you want a title page for a Book? -(define %generate-book-titlepage% - #t) - -;;Do you want a separate page for the title? -(define %generate-book-titlepage-on-separate-page% - #t) - -;;Generate Book TOC? -(define %generate-book-toc% - #t) - -;;What depth should the TOC generate? -;;!Only top level of appendixes! -(define (toc-depth nd) - (if (string=? (gi nd) (normalize "book")) - 3 - (if (string=? (gi nd) (normalize "appendix")) - 0 - 1))) - -;;Do you want a TOC for the element part? -(define %generate-part-toc% - #f) - -;;Do you want the part toc on the part titlepage or separate? -(define %generate-part-toc-on-titlepage% - #t) - -;;Generate Part Title Page? -(define %generate-part-titlepage% - #f) - -;;Do you want the Part intro on the part title page? -(define %generate-partintro-on-titlepage% - #t) - -;;What elements should have a LOT? -(define ($generate-book-lot-list$) - (list (normalize "equation"))) - -;;Do you want chapters enumerated? -(define %chapter-autolabel% - #t) - -;;Do you want Chapter's and Appendix's -;;to have automatic labels? -(define %chap-app-running-head-autolabel% - #t) - - -;;====================================== -;;Article Options -;;====================================== - -;;Do you want a title page for an Article? -(define %generate-article-titlepage% - #t) - -;;Which elements should appear -;;on title page? -(define (article-titlepage-recto-elements) - (list (normalize "title") - (normalize "subtitle") - (normalize "authorgroup") - (normalize "copyright") - (normalize "legalnotice") - (normalize "releaseinfo") - (normalize "date") - (normalize "abstract"))) - -;;Generate Article TOC? -(define %generate-article-toc% - #t) - -;;Do you want a separate page for the title? -(define %generate-article-titlepage-on-separate-page% - #t) - -;;Do you want the article toc on the titlepage or separate? -(define %generate-article-toc-on-titlepage% - #t) - -;;Do you want to start new page numbers with each article? -(define %article-page-number-restart% - #f) - -;;Titlepage Separate? -(define (chunk-skip-first-element-list) - '()) - -;;Titlepage Not Separate -;(define (chunk-skip-first-element-list) -; (list (normalize "sect1") -; (normalize "section"))) - -;;====================================== -;;Columns -;;====================================== - -;;How many columns do you want? -(define %page-n-columns% - 1) - -;;How much space between columns? -(define %page-column-sep% - 0.2in) - -;;How many Columns on the titlepage? -(define %titlepage-n-columns% - 1) - -;;Balance columns? -(define %page-balance-colums% -#t) - -;;====================================== -;;Fonts -;;====================================== - -;;Defines the general size of the text in the document. normal(10), -;;presbyopic(12), and large-type(24). -(define %visual-acuity% - "normal") - -;;What font would you like for titles? -(define %title-font-family% - "Helvetica") - -;;What font would you like for the body? -(define %body-font-family% - "Palatino") - -;;What font would you like for mono-seq? -(define %mono-font-family% - "Courier New") - -;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is -;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc -(define %hsize-bump-factor% - 1.1) - -;;What size do you want the body fonts? -(define %bf-size% - (case %visual-acuity% - (("tiny") 8pt) - (("normal") 10pt) - (("presbyopic") 12pt) - (("large-type") 24pt))) - -(define-unit em %bf-size%) - -;;====================================== -;;Margins -;;====================================== - -(define %left-right-margin% 6pi) - -;;How much indentation for the body? -(define %body-start-indent% - 4pi) - -;;How big is the left margin? (relative to physical page) -(define %left-margin% - 8pi) ;white-paper-column - -;;How big is the right margin? (relative to physical page) -(define %right-margin% - 8pi) ;white-paper-column - -;;How big do you want the margin at the top? -(define %top-margin% -(if (equal? %visual-acuity% "large-type") - 7.5pi - 4pi)) - -;;How big do you want the margin at the bottom? -(define %bottom-margin% - (if (equal? %visual-acuity% "large-type") - 7.5pi - 2pi)) - -;;Define the text width. (Change the elements in the formula rather -;;than the formula itself) -;(define %text-width% (- %page-width% (* %left-right-margin% 2))) -(define %text-width% (- %page-width% (+ %left-margin% %right-margin%))) - -;;Define the body width. (Change the elements in the formula rather -;;than the formula itself) -(define %body-width% - (- %text-width% %body-start-indent%)) - -;;Define distance between paragraphs -(define %para-sep% - (/ %bf-size% 2.0)) - -;;Define distance between block elements (figures, tables, etc.). -(define %block-sep% - (* %para-sep% 2.0)) - -;;Indent block elements? -(define %block-start-indent% - 0pt) -;0pt - -;;====================================== -;;Admon Graphics -;;====================================== - -;;Do you want admon graohics on? -(define %admon-graphics% - #f) - -;;Where are the admon graphics? -(define %admon-graphics-path% - "../images/") - -;;====================================== -;;Quadding -;;====================================== - -;;What quadding do you want by default; start, center, justify, or end? -(define %default-quadding% - 'justify) - -;;What quadding for component titles(Chapter, Appendix, etc)? -(define %component-title-quadding% - 'start) - -;;What quadding for section titles? -(define %section-title-quadding% - 'start) - -;;What quadding for section sub-titles? -(define %section-subtitle-quadding% - 'start) - -;;What quadding for article title? -(define %article-title-quadding% - 'center) - -;;What quadding for article sub-titles? -(define %article-subtitle-quadding% - 'center) - -;;What quadding for division subtitles? -(define %division-subtitle-quadding% - 'start) - -;;What quadding for component subtitles? -(define %component-subtitle-quadding% - 'start) - - - - -;;====================================== -;;Paper Options -;;====================================== - -;;What size paper do you need? A4, USletter, USlandscape, or RedHat? -(define %paper-type% - "USletter") - -;;Now define those paper types' width -(define %page-width% - (case %paper-type% - (("A4") 210mm) - (("USletter") 8.5in) - (("USlandscape") 11in))) - -;;Now define those paper types' height -(define %page-height% - (case %paper-type% - (("A4") 297mm) - (("USletter") 11in) - (("USlandscape") 8.5in))) - -;;====================================== -;;Functions -;;====================================== - -(define (OLSTEP) - (case - (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4) - ((1) 1.2em) - ((2) 1.2em) - ((3) 1.6em) - ((0) 1.4em))) - -(define (ILSTEP) 1.0em) - -(define (PROCSTEP ilvl) - (if (> ilvl 1) 1.8em 1.4em)) - -(define (PROCWID ilvl) - (if (> ilvl 1) 1.8em 1.4em)) - - -(define ($comptitle$) - (make paragraph - font-family-name: %title-font-family% - font-weight: 'bold - font-size: (HSIZE 2) - line-spacing: (* (HSIZE 2) %line-spacing-factor%) - space-before: (* (HSIZE 2) %head-before-factor%) - space-after: (* (HSIZE 2) %head-after-factor%) - start-indent: 0pt - first-line-start-indent: 0pt - quadding: 'start - keep-with-next?: #t - (process-children-trim))) - -;;Callouts are confusing in Postscript... fix them. -(define %callout-fancy-bug% - #f) - - -;;By default perils are centered and dropped into a box with a really -;;big border - I have simply decreased the border thickness - -;;unfortunately it takes all this to do it - sigh. -(define ($peril$) - (let* ((title (select-elements - (children (current-node)) (normalize "title"))) - (has-title (not (node-list-empty? title))) - (adm-title (if has-title - (make sequence - (with-mode title-sosofo-mode - (process-node-list (node-list-first title)))) - (literal - (gentext-element-name - (current-node))))) - (hs (HSIZE 2))) - (if %admon-graphics% - ($graphical-admonition$) - (make display-group - space-before: %block-sep% - space-after: %block-sep% - font-family-name: %admon-font-family% - font-size: (- %bf-size% 1pt) - font-weight: 'medium - font-posture: 'upright - line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%) - (make box - display?: #t - box-type: 'border - line-thickness: .5pt - start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt) - end-indent: (inherited-end-indent) - (make paragraph - space-before: %para-sep% - space-after: %para-sep% - start-indent: 1em - end-indent: 1em - font-family-name: %title-font-family% - font-weight: 'bold - font-size: hs - line-spacing: (* hs %line-spacing-factor%) - quadding: 'center - keep-with-next?: #t - adm-title) - (process-children)))))) - - -;;====================================== -;;Non-printing Elements -;;====================================== -(element TITLEABBREV (empty-sosofo)) -(element SUBTITLE (empty-sosofo)) -(element SETINFO (empty-sosofo)) -(element BOOKINFO (empty-sosofo)) -(element BIBLIOENTRY (empty-sosofo)) -(element BIBLIOMISC (empty-sosofo)) -(element BOOKBIBLIO (empty-sosofo)) -(element SERIESINFO (empty-sosofo)) -(element DOCINFO (empty-sosofo)) -(element ARTHEADER (empty-sosofo)) -(element ADDRESS (empty-sosofo)) - -;;Show comment element? -(define %show-comments% - #t) - -;;Redefine comment for LSB -(element comment - (if %show-comments% - (make paragraph - start-indent: 0pt - first-line-start-indent: -10pt - font-posture: 'italic - font-size: (* (inherited-font-size) 0.9) - (make sequence - (make line-field - field-width: 10pt - quadding: 'center - (literal "BEGIN RATIONALE: ")) - (process-children)) - (literal "END RATIONALE: ")) - (empty-sosofo))) - -;; In DocBook V4.0 comment became remark -(element remark - (if %show-comments% - (make paragraph - start-indent: 0pt - first-line-start-indent: -10pt - font-posture: 'italic - font-size: (* (inherited-font-size) 0.9) - (make sequence - (make line-field - field-width: 10pt - quadding: 'center - (literal "BEGIN RATIONALE: ")) - (process-children)) - (literal "END RATIONALE: ")) - (empty-sosofo))) - -;;====================================== -;;Formalpara titles -;;====================================== - - -;;Change the way Formal Paragraph titles are displayed. The commented -;;out section will run the titles in the paragraphs. -(element (formalpara title) - ;(make sequence - ;font-weight: 'bold - ;($runinhead$)) - ($lowtitle$ 5)) - -;;====================================== -;;Inlines -;;====================================== - -(element application ($mono-seq$)) -(element command ($bold-seq$)) -(element filename ($mono-seq$)) -(element function ($mono-seq$)) -(element guibutton ($bold-seq$)) -(element guiicon ($bold-seq$)) -(element guilabel ($italic-seq$)) -(element guimenu ($bold-seq$)) -(element guimenuitem ($bold-seq$)) -(element hardware ($bold-mono-seq$)) -(element keycap ($bold-seq$)) -(element literal ($mono-seq$)) -(element parameter ($italic-mono-seq$)) -(element prompt ($mono-seq$)) -(element symbol ($charseq$)) -(element emphasis ($italic-seq$)) - - - - - - - - - - -;; this is necessary because right now jadetex does not understand -;; symbolic entities, whereas things work well with numeric entities. -(declare-characteristic preserve-sdata? - "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" - #f) - - -;;========================= -;;Header HTML 4.0.1 -;;========================= - -(define %html-pubid% "-//W3C//DTD HTML 4.01//EN") - -;;========================= -;;Common Stuff -;;========================= - -;;Should there be a link to the legalnotice? -(define %generate-legalnotice-link% - #t) - -;;What graphics extensions allowed? -(define %graphic-extensions% -'("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" )) - -;;What is the default extension for images? -(define %graphic-default-extension% "png") - -;;Use element ids as filenames? -(define %use-id-as-filename% - #t) - - -;;========================= -;;Book Stuff -;;========================= - -;;Do you want a TOC for Books? -(define %generate-book-toc% - #t) - -;;What depth should the TOC generate? -;;!Only top level of appendixes! -(define (toc-depth nd) - (if (string=? (gi nd) (normalize "book")) - 3 - (if (string=? (gi nd) (normalize "appendix")) - 0 - 1))) - -;;What elements should have an LOT? -(define ($generate-book-lot-list$) - (list (normalize "equation"))) - -;;Do you want a title page for your Book? -(define %generate-book-titlepage% -#t) - -;;========================= -;;Part Stuff -;;========================= - -;;Should parts have TOCs? -(define %generate-part-toc% - #t) - -;;Should part TOCs be on their titlepages? -(define %generate-part-toc-on-titlepage% - #t) - -;;Do you want a title page for your part? -(define %generate-part-titlepage% - #t) - -;;Should the Part intro be on the part title page? -(define %generate-partintro-on-titlepage% - #t) - -(define %para-autolabel% - #t) - -;;======================== -;;Chapter Stuff -;;======================= - -;;No TOCs in Chapters -(define $generate-chapter-toc$ - (lambda () - #f)) - -;;========================= -;;Navigation -;;========================= - -;;Should there be navigation at top? -(define %header-navigation% - #t) - -;;Should there be navigation at bottom? -(define %footer-navigation% - #t) - -;;Use tables to create the navigation? -(define %gentext-nav-use-tables% - #t) - -;;If tables are used for navigation, -;;how wide should they be? -(define %gentext-nav-tblwidth% -"100%") - -;;Add arrows to navigation (comment these -;;out if you want admon graphics here) -(define (gentext-en-nav-prev prev) - (make sequence (literal "<<< Previous"))) - -;;Add arrows to navigation (comment these -;;out if you want admon graphics here) -(define (gentext-en-nav-next next) - (make sequence (literal "Next >>>"))) - - -;;========================= -;;Tables and Lists -;;========================= - -;;Should Variable lists be tables? -(define %always-format-variablelist-as-table% - #f) - -;;What is the length of the 'Term' in a variablelist? -(define %default-variablelist-termlength% - 20) - -;;When true | If the terms are shorter than -;;the termlength above then the variablelist -;;will be formatted as a table. -(define %may-format-variablelist-as-table% -#f) - -;;This overrides the tgroup definition -;;(copied from 1.20, dbtable.dsl). -;;It changes the table background color, -;;cell spacing and cell padding. -;;This is based on gtk-doc additions - thanks! - -(element tgroup - (let* ((wrapper (parent (current-node))) - (frameattr (attribute-string (normalize "frame") wrapper)) - (pgwide (attribute-string (normalize "pgwide") wrapper)) - (footnotes (select-elements (descendants (current-node)) - (normalize "footnote"))) - (border (if (equal? frameattr (normalize "none")) - '(("BORDER" "0")) - '(("BORDER" "1")))) - (bgcolor '(("BGCOLOR" "#E0E0E0"))) - (width (if (equal? pgwide "1") - (list (list "WIDTH" ($table-width$))) - '())) - (head (select-elements (children (current-node)) (normalize "thead"))) - (body (select-elements (children (current-node)) (normalize "tbody"))) - (feet (select-elements (children (current-node)) (normalize "tfoot")))) - (make element gi: "TABLE" - attributes: (append - border - width - bgcolor - '(("CELLSPACING" "0")) - '(("CELLPADDING" "4")) - (if %cals-table-class% - (list (list "CLASS" %cals-table-class%)) - '())) - (process-node-list head) - (process-node-list body) - (process-node-list feet) - (make-table-endnotes)))) - -;;=================== -;; Admon Graphics -;;=================== - -;;Should Admon Graphics be used? -(define %admon-graphics% - #t) - -;;Where are those admon graphics? -(define %admon-graphics-path% - "./stylesheet-images/") - -;;Given an admonition node, returns the -;;name of the graphic that should -;;be used for that admonition. -;;Define admon graphics usage -;;NOTE these will change to pngs -;;soon in the GDP when Tigert gets -;;the time to make special ones for us! -(define ($admon-graphic$ #!optional (nd (current-node))) - (cond ((equal? (gi nd) (normalize "tip")) - (string-append %admon-graphics-path% "tip.gif")) - ((equal? (gi nd) (normalize "note")) - (string-append %admon-graphics-path% "note.gif")) - ((equal? (gi nd) (normalize "important")) - (string-append %admon-graphics-path% "important.gif")) - ((equal? (gi nd) (normalize "caution")) - (string-append %admon-graphics-path% "caution.gif")) - ((equal? (gi nd) (normalize "warning")) - (string-append %admon-graphics-path% "warning.gif")) - (else (error (string-append (gi nd) " is not an admonition."))))) - -;;Given an admonition node, returns -;;the width of the graphic that will -;;be used for that admonition. -(define ($admon-graphic-width$ #!optional (nd (current-node))) - "25") - -;;========================= -;;Labels -;;========================= - -;;Enumerate Chapters? -(define %chapter-autolabel% - #f) - -;;Enumerate Sections? -(define %section-autolabel% - #t) - -;;========================= -;; HTML Attributes -;;========================= - -;;What attributes should be hung off -;;of 'body'? -(define %body-attr% - (list - (list "BGCOLOR" "#FFFFFF") - (list "TEXT" "#000000") - (list "LINK" "#0000FF") - (list "VLINK" "#840084") - (list "ALINK" "#0000FF"))) - -;;Default extension for filenames? -(define %html-ext% - ".html") - -;;Use a CSS stylesheet? -;;Which one? Should work on -;;this one soon -;(define %stylesheet% -; "./gnome.css") - -;;Use it -;(define %stylesheet-type% -;"text/css") - - -;;======================== -;;Title Pages for Books -;;======================= - -(define (book-titlepage-recto-elements) - (list (normalize "title") - (normalize "subtitle") - (normalize "corpauthor") - (normalize "authorgroup") - (normalize "author") - (normalize "orgname") - (normalize "graphic") - (normalize "copyright") - (normalize "legalnotice") - (normalize "releaseinfo") - (normalize "publisher") - (normalize "isbn"))) - -;;======================== -;;Title Pages for Articles -;;======================== - -;;Should Articles have a TOC? -(define %generate-article-toc% - #t) - -;;Which elements should appear -;;on title page? -(define (article-titlepage-recto-elements) - (list (normalize "title") - (normalize "subtitle") - (normalize "authorgroup") - (normalize "copyright") - (normalize "legalnotice") - (normalize "releaseinfo") - (normalize "date") - (normalize "abstract"))) - -;;How should elements on title page look? -(mode article-titlepage-recto-mode - -;;Author name is too big - change it! - (element author - (let ((author-name (author-string)) - (author-affil (select-elements (children (current-node)) - (normalize "affiliation")))) - (make sequence - (make element gi: "H4" - attributes: (list (list "CLASS" (gi))) - (make element gi: "A" - attributes: (list (list "NAME" (element-id))) - (literal author-name))) - (process-node-list author-affil)))) - -;;Address? - (element address - (make sequence - (make element gi: "DIV" - attributes: (list (list "CLASS" (gi))) - (process-children)))) - -;;Get rid of spam-producing "mailto" links -;;and get rid of email indentation - (element email - (make sequence - (make element gi: "DIV" - attributes: (list (list "CLASS" (gi))) - (process-children)))) - -;;Point Abstract to custom table function -;;(See $dcm-abstract-object$ below. For default -;;use $semiformal-object$ - (element abstract - (make element gi: "DIV" - ($dcm-abstract-object$))) - - (element (abstract title) (empty-sosofo)) - -;;subtitle sizing -(element subtitle - (make element gi: "H4" - attributes: (list (list "CLASS" (gi))) - (process-children-trim)))) - -;;================= -;; INLINES -;;================= - -;Define my own series of fonts for various elements -(element application ($mono-seq$)) -(element command ($bold-seq$)) -(element filename ($mono-seq$)) -(element function ($mono-seq$)) -(element guibutton ($bold-seq$)) -(element guiicon ($bold-seq$)) -(element guilabel ($bold-mono-seq$)) -(element guimenu ($bold-seq$)) -(element guimenuitem ($bold-seq$)) -(element guisubmenu ($bold-seq$)) -(element hardware ($bold-mono-seq$)) -(element keycap ($bold-seq$)) -(element literal ($mono-seq$)) -(element parameter ($italic-mono-seq$)) -(element prompt ($mono-seq$)) -(element symbol ($charseq$)) -(element emphasis ($italic-seq$)) - -;;Show comment element? -(define %show-comments% - #t) - -;;Redefine comment element for LSB -(element comment - (if %show-comments% - (make element gi: "TABLE" - attributes: ($shade-verbatim-attr$) - (make element gi: "TR" - (make element gi: "TD" - (literal "RATIONALE:") - (make element gi: "P" - (process-children))))) - (empty-sosofo))) - -;;In DocBook V4.0 comment became remark -(element remark - (if %show-comments% - (make element gi: "TABLE" - attributes: ($shade-verbatim-attr$) - (make element gi: "TR" - (make element gi: "TD" - (literal "RATIONALE:") - (make element gi: "P" - (process-children))))) - (empty-sosofo))) - -;;==================== -;; General Formatting -;;==================== - -;;Formal Paras are ugly by default! -;;Make the title run in - otherwise -;;you should use a sect! -(element formalpara - (make element gi: "DIV" - attributes: (list - (list "CLASS" (gi))) - (make element gi: "P" - (process-children)))) - -;;This is the old one -;(element (formalpara title) -;($lowtitle$ 5)) - -;;This is the new one -(element (formalpara title) - (make element gi: "B" - ($runinhead$))) - -;;Make captions come after objects in the list -(define ($object-titles-after$) - (list (normalize "figure"))) - - -;; Handle qanda labelling with Q: A: -(define (qanda-defaultlabel) - (normalize "qanda")) - -;;From FreeBSD Sheets (Thanks!) Display Q and A in bigger bolder fonts - -(element question - (let* ((chlist (children (current-node))) - (firstch (node-list-first chlist)) - (restch (node-list-rest chlist))) - (make element gi: "DIV" - attributes: (list (list "CLASS" (gi))) - (make element gi: "P" - (make element gi: "BIG" - (make element gi: "A" - attributes: (list - (list "NAME" (element-id))) - (empty-sosofo)) - (make element gi: "B" - (literal (question-answer-label - (current-node)) " ") - (process-node-list (children firstch))))) - (process-node-list restch)))) - -;;Literal Elements - -;;Indent Literal layouts? -(define %indent-literallayout-lines% - #f) - -;;Indent Programlistings? -(define %indent-programlisting-lines% - #f) - -;;Number lines in Programlistings? -(define %number-programlisting-lines% - #f) - -;;Should verbatim items be 'shaded' with a table? -(define %shade-verbatim% - #t) - -;;Define shade-verbatim attributes -(define ($shade-verbatim-attr$) - (list - (list "BORDER" "0") - (list "BGCOLOR" "#E0E0E0") - (list "WIDTH" ($table-width$)))) - -;;=================== -;; Entities -;;=================== - -;;Netscape doesn't handle trademark -;;entity right at all!! Get rid of it. -;;Make a TM in a superscipt font. -(element trademark - (make sequence - (process-children) - (make element gi: "sup" - (literal "TM")))) - - -;;=================== -;; New Definitions -;;================== - -(define ($dcm-abstract-object$) - (make element gi: "TABLE" - attributes: '(("BORDER" "0") - ("BGCOLOR" "#E0E0E0") - ("WIDTH" "50%") - ("CELLSPACING" "0") - ("CELLPADDING" "0") - ("ALIGN" "CENTER")) - (make element gi: "TR" - (make element gi: "TD" - attributes: '(("VALIGN" "TOP")) - (make element gi: "B" - (literal "Abstract")))) - (make element gi: "TR" - (make element gi: "TD" - attributes: '(("VALIGN" "TOP")) - (process-children))))) - -;;Redefine Titlepage Separator on Articles - -(define (article-titlepage-separator side) - (make empty-element gi: "HR" - attributes: '(("WIDTH" "75%") - ("ALIGN" "CENTER") - ("COLOR" "#000000") - ("SIZE" "1")))) - - - - -(define (chunk-element-list) - (list (normalize "preface") - (normalize "chapter") - (normalize "appendix") - (normalize "article") - (normalize "glossary") - (normalize "bibliography") - (normalize "index") - (normalize "colophon") - (normalize "setindex") - (normalize "reference") - (normalize "refentry") - (normalize "part") - (normalize "sect1") - (normalize "section") - (normalize "book") ;; just in case nothing else matches... - (normalize "set") ;; sets are definitely chunks... - )) - -;;Do you want Callouts to be graphics? -(define %callout-graphics% -#f) - - -;;Make Callout graphics PNGs -(define %callout-graphics-path% - "./imagelib/callouts/") - - ;; Redefine $callout-bug$ to support the %callout-graphic-ext% - ;; variable. - (define ($callout-bug$ conumber) - (let ((number (if conumber (format-number conumber "1") "0"))) - (if conumber - (if %callout-graphics% - (if (<= conumber %callout-graphics-number-limit%) - (make empty-element gi: "IMG" - attributes: (list (list "SRC" - (root-rel-path - (string-append - %callout-graphics-path% - number - %callout-graphics-ext%))) - (list "HSPACE" "0") - (list "VSPACE" "0") - (list "BORDER" "0") - (list "ALT" - (string-append - "(" number ")")))) - (make element gi: "B" - (literal "(" (format-number conumber "1") ")"))) - (make element gi: "B" - (literal "(" (format-number conumber "1") ")"))) - (make element gi: "B" - (literal "(??)"))))) - - - - - - - -- cgit v1.2.3-54-g00ecf