Changes between Version 19 and Version 20 of AddHeadersPlugin


Ignore:
Timestamp:
May 10, 2015, 7:27:11 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • AddHeadersPlugin

    v19 v20  
    11[[PageOutline(2-5,Contents,pullout)]]
    2 = Add HTML Headers to Trac Pages in a simple way =
    3 
    4 == Description ==
    5 
    6 This plug-in allows Trac server admins to add `script`, `link` and (with Trac 0.12) also `meta` headers into all trac pages without having to create a Chrome template file.
     2
     3= Add HTML Headers to Trac Pages in a simple way
     4
     5== Description
     6
     7This plugin allows Trac server admins to add `script`, `link` and (with Trac 0.12) also `meta` headers into all Trac pages without having to create a Chrome template file.
    78This allows the easy usage of own !JavaScript and CSS files. Also all other kinds of `link` headers can be added.
    89
    9 == Installation ==
    10 Install as normal and enable this plug-in by adding the following into the config file (normally '`conf/trac.ini`'):
    11 {{{
    12 #!ini
     10== Bugs/Feature Requests
     11
     12Existing bugs and feature requests for AddHeadersPlugin are
     13[report:9?COMPONENT=AddHeadersPlugin here].
     14
     15If you have any issues, create a
     16[http://trac-hacks.org/newticket?component=AddHeadersPlugin&owner=martin_s new ticket].
     17
     18[[TicketQuery(component=AddHeadersPlugin&group=type,format=progress)]]
     19
     20== Download
     21
     22Download the zipped source from [download:addheadersplugin here].
     23
     24== Source
     25
     26You can check out AddHeadersPlugin from [http://trac-hacks.org/svn/addheadersplugin here] using Subversion, or [source:addheadersplugin browse the source] with Trac.
     27
     28== Installation
     29
     30Install as normal and enable this plugin by adding the following into your `trac.ini` file, normally found at `../conf/trac.ini`:
     31{{{#!ini
    1332[components]
    1433tracaddheaders.* = enabled
    1534}}}
    1635
    17 == Usage ==
    18 The plugin is controlled over settings the Trac config file (normally '`conf/trac.ini`').
    19 All settings must be put in the section `[addheaders]`.
    20 
    21 === Settings ===
    22  `default_base = `''<path relative to base URL>'' (default: '`site/`'):: This is used as default base of the files relative to the base URL (which is e.g. `http://trac.example.org/project1/`). Please note that URL paths not local file paths are used. The default is `site/` which is the relative URL for the `htdocs` directory in your `$TRAC_PROJECT_DIR`.
    23 
    24  `default_script_base = `''<path relative to base URL>'' (default: `default_base`):: To provide an different default path for scripts.
    25 
    26  `default_style_base = `''<path relative to base URL>'' (default: `default_base`):: To provide an different default path for style files.
    27 
    28  `default_meta_lang = `''default language>'' (default: None):: Default language for meta tags (i.e. `lang` and `xml:lang` attributes)
     36== Usage
     37
     38The plugin is controlled through settings in the TracIni file. All settings must be put in the section `[addheaders]`.
     39
     40=== Settings
     41
     42 `default_base = `''<path relative to base URL>'' (default: '`site/`'):: This is used as default base of the files relative to the base URL, which is eg `http://trac.example.org/project1/`. Note that URL paths, not local file paths are used. The default is `site/` which is the relative URL for the `htdocs` directory in your `$TRAC_PROJECT_DIR`.
     43
     44 `default_script_base = `''<path relative to base URL>'' (default: `default_base`):: To provide a different default path for scripts.
     45
     46 `default_style_base = `''<path relative to base URL>'' (default: `default_base`):: To provide a different default path for style files.
     47
     48 `default_meta_lang = `''default language>'' (default: None):: Default language for meta tags, ie `lang` and `xml:lang` attributes.
    2949
    3050 `add_scripts = `''<name1>''`,`''<name2>''`,``...`:: Will add `script` tags for all given names. The mime-type and filename can be defined by:
     
    4565   * ''<name>''`.class = `''<(CSS?) class of link>''
    4666
    47  `add_meta = `''<name1>''`,`''<name2>''`,``...`:: Will add [http://en.wikipedia.org/wiki/Meta_element `meta` tags] for all given names. There exists no default setting.[[BR]]
     67 `add_meta = `''<name1>''`,`''<name2>''`,``...`:: Will add [http://en.wikipedia.org/wiki/Meta_element `meta` tags] for all given names. There is no default setting.[[BR]]
    4868  [[BR]]One and only one of the following settings must be given:
    4969   * ''<name>''`.http_equiv = `''<equivalent HTTP header>''
     
    5777See also the [#Examples example] below.
    5878
    59 == Bugs/Feature Requests ==
    60 
    61 Existing bugs and feature requests for AddHeadersPlugin are
    62 [report:9?COMPONENT=AddHeadersPlugin here].
    63 
    64 If you have any issues, create a
    65 [http://trac-hacks.org/newticket?component=AddHeadersPlugin&owner=martin_s new ticket].
    66 
    67 == Download ==
    68 
    69 Download the zipped source from [download:addheadersplugin here].
    70 
    71 == Source ==
    72 
    73 You can check out AddHeadersPlugin from [http://trac-hacks.org/svn/addheadersplugin here] using Subversion, or [source:addheadersplugin browse the source] with Trac.
    74 
    75 == Examples ==
    76 === Multi-Style ===
    77 The following example shows how to add files for a multi-style implementation, i.e. the user can select between different graphics styles:
     79== Examples
     80
     81=== Multi-Style
     82
     83The following example shows how to add files for a multi-style implementation, ie the user can select between different graphics styles:
    7884The !JavaScript file is located at `$TRAC_PROJECT_DIR/htdocs/js/multistyle.js` and all CSS files are located at `$TRAC_PROJECT_DIR/htdocs/css/`.
    79 A general style file '`common.css`' is included which holds all common style definition. The default style is in '`default.css`' and the alternative styles in '`theme1.css`' and '`theme2.css`'.
     85A general style file `common.css` is included which holds all common style definition. The default style is in `default.css` and the alternative styles in `theme1.css` and `theme2.css`.
    8086Please note that general CSS files are added using `add_styles` while the others using `add_links`. This has HTML and Trac API related reasons.
    8187
    82 {{{
    83 #!ini
     88{{{#!ini
    8489# in trac.ini
    8590[addheaders]
     
    113118}}}
    114119
    115 This will result in the following added headers (not necessary in that order):
     120This will result in the following added headers, not necessary in that order:
    116121{{{
    117122<link title="default" type="text/css" href="/chrome/site/style.css" rel="stylesheet" />
     
    122127}}}
    123128
    124 === Adding custom !JavaScript and CSS ===
    125 
    126 The following example shows how to add some custom !JavaScript and CSS files. Here they all start with a common prefix. The JS files (abc_one.js,abc_two.js,abc_tree.js) are positioned in the `$TRAC_PROJECT_DIR/htdocs/js/` and the CSS files (style_print.css,style_screen.css) `$TRAC_PROJECT_DIR/htdocs/css/` directory.
    127 
    128 {{{
    129 #!ini
     129=== Adding custom !JavaScript and CSS
     130
     131The following example shows how to add some custom !JavaScript and CSS files. Here they all start with a common prefix. The JS files (abc_one.js, abc_two.js, abc_tree.js) are positioned in the `$TRAC_PROJECT_DIR/htdocs/js/` and the CSS files (style_print.css, style_screen.css) `$TRAC_PROJECT_DIR/htdocs/css/` directory.
     132
     133{{{#!ini
    130134# in trac.ini
    131135[addheaders]
     
    139143or, even shorter:
    140144
    141 {{{
    142 #!ini
     145{{{#!ini
    143146# in trac.ini
    144147[addheaders]
     
    150153}}}
    151154
    152 === Weird filenames ===
     155=== Unusual filenames
    153156
    154157While the names given by `add_scripts` or `add_styles` is used to build the default filename, it becomes just an arbitrary string when the real filename is set explicitly using ''<name>''`.filename`.
    155 This can be used when the real filename is quit weird, e.g. has commas included or is very long. Make sure to use an UTF-8 capable editor when adding non-ASCII letters.
    156 {{{
    157 #!ini
     158This can be used when the real filename is unusual, eg has commas included or is very long. Make sure to use an UTF-8 capable editor when adding non-ASCII letters.
     159{{{#!ini
    158160# in trac.ini
    159161[addheaders]
     
    169171}}}
    170172
    171 === General `link` tag ===
     173=== General `link` tag
    172174
    173175The `link` tags are used to define ''relations'' between the page and other pages, e.g. 'My startpage is at ..., the next page is at ...'. Trac itself adds a couple of link tags for `help`, `up`, `prev`, etc. for some pages.
    174176
    175 The following example would add a linked copyright notice (written  plain text) and a shortcut icon to every Trac page. Please note that the information is not displayed by default to the user in any way and most browsers are ignoring link tags which aren't used for style sheets an shortcut icons.
    176 
    177 {{{
    178 #!ini
     177The following example would add a linked copyright notice (written in plain text) and a shortcut icon to every Trac page. Note that the information is not displayed by default to the user in any way and most browsers are ignoring link tags which aren't used for style sheets or shortcut icons.
     178
     179{{{#!ini
    179180# in trac.ini
    180181[addheaders]
     
    197198}}}
    198199
    199 == Recent Changes ==
     200== Recent Changes
    200201
    201202[[ChangeLog(addheadersplugin, 3)]]
    202203
    203 == Author/Contributors ==
     204== Author/Contributors
    204205
    205206'''Author:''' [wiki:martin_s] [[BR]]
    206 '''Maintainer:''' [wiki:martin_s] [[BR]]
     207'''Maintainer:''' [[Maintainer]] [[BR]]
    207208'''Contributors:'''