| 1 | A Sphinx theme for SourceForge hosted projects |
|---|
| 2 | ============================================== |
|---|
| 3 | |
|---|
| 4 | :Author: Antonio Valentino |
|---|
| 5 | :Contact: a_valentino@users.sf.net |
|---|
| 6 | :Version: 1.0 |
|---|
| 7 | :Copyright (C): 2009-2010 Antonio Valentino |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | All `SourceForge.net`_ projects that use the `SourceForge.net`_ project web |
|---|
| 11 | services are required to display the `SourceForge.net`_ logo on all web pages, |
|---|
| 12 | per the `Project Web, Shell and Database Services`__ site document. |
|---|
| 13 | |
|---|
| 14 | It is also common practice for SF hosted projects to display links to the |
|---|
| 15 | *SF project page*, *SF downloads page*, etc, in the project website. |
|---|
| 16 | |
|---|
| 17 | .. _`SourceForge.net`: http://sourceforge.net |
|---|
| 18 | __ http://p.sf.net/sourceforge/logo |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | Summary of changes against the standard theme |
|---|
| 22 | --------------------------------------------- |
|---|
| 23 | |
|---|
| 24 | * SourceForge logo displayed in the sidebar of each page |
|---|
| 25 | * SourceForge project links displayed in the sidebar (optional) |
|---|
| 26 | * additional links (provided via conf.py) displayed in the sidebar (optional) |
|---|
| 27 | * `doctitle` displayed over the `relbar1` in the `master_doc` |
|---|
| 28 | * different (and customizable) colours for todo directive |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | SourceForge project info |
|---|
| 32 | ------------------------ |
|---|
| 33 | |
|---|
| 34 | The *unixname* and the *groupid*, of the project are needed to compute the |
|---|
| 35 | project paths on `SourceForge.net`_ site. |
|---|
| 36 | It is strongly recommended to to provide both *unixname* and *groupid* |
|---|
| 37 | parameters. |
|---|
| 38 | It can be done by setting the `html_theme_options` in the documentation |
|---|
| 39 | `conf.py` as shown in the following example:: |
|---|
| 40 | |
|---|
| 41 | html_theme_options = { |
|---|
| 42 | 'unixname': 'gsdview', |
|---|
| 43 | 'groupid': '226458', |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | If the *unixname* is not provided it is assumed: unixname = lower(project) |
|---|
| 47 | |
|---|
| 48 | .. warning:: if the *groupid* is not provided links needing it, and **SF logo** |
|---|
| 49 | are not displayed. |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | `SourceForge.net`_ logo preferences |
|---|
| 53 | ----------------------------------- |
|---|
| 54 | |
|---|
| 55 | SF provides different version of the SF logo that have to be displayed in |
|---|
| 56 | all pages hosted on SF. |
|---|
| 57 | Logos are identified by a type id [8-16] and each logo has its own size. |
|---|
| 58 | The *sflogotype*, *sflogowidth* and *sflogoheight* allow to customize it:: |
|---|
| 59 | |
|---|
| 60 | sflogotype = 14 |
|---|
| 61 | sflogowidth = 150 |
|---|
| 62 | sflogoheight = 40 |
|---|
| 63 | |
|---|
| 64 | .. warning:: The SourceForge.net logo may not be modified for any purpose. |
|---|
| 65 | The changing of things like size, color, and form factor is |
|---|
| 66 | prohibited. |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | The sidebar *links* section |
|---|
| 70 | --------------------------- |
|---|
| 71 | |
|---|
| 72 | The *sporceforge* theme provides a custom html template for sidebars. |
|---|
| 73 | It adds to the sidebar a `Links` section with standard links to SF hosted |
|---|
| 74 | project pages and an optional list of user provided additional links. |
|---|
| 75 | |
|---|
| 76 | In order to display the customized sidebar, and the hence SF links, |
|---|
| 77 | the `sfpagesidebar.html` template ave to be associated to the target document |
|---|
| 78 | using the `html_sidebars` optionin the `conf.py` file:: |
|---|
| 79 | |
|---|
| 80 | html_sidebars = {'index': 'sfpagesidebar.html'} |
|---|
| 81 | |
|---|
| 82 | `SourceForge.net`_ also provides `hosted apps`_, a number of well-written |
|---|
| 83 | Open Source applications which are useful to developers for personal use and |
|---|
| 84 | critical to meeting the needs of Open Source software development projects. |
|---|
| 85 | |
|---|
| 86 | If the project provides a trac_ site hosted on `SourceForge.net`_ it is |
|---|
| 87 | possible to include a link pointing to it in the sidebar using the `hastrac` |
|---|
| 88 | theme option:: |
|---|
| 89 | |
|---|
| 90 | html_theme_options = { |
|---|
| 91 | 'hastrac': True, |
|---|
| 92 | } |
|---|
| 93 | |
|---|
| 94 | .. _`hosted apps`: http://sourceforge.net/apps/trac/sourceforge/wiki/Hosted%20Apps |
|---|
| 95 | .. _trac: http://trac.edgewall.org |
|---|
| 96 | |
|---|
| 97 | Additional links can be specified using the `extralinks` theme option:: |
|---|
| 98 | |
|---|
| 99 | html_theme_options = { |
|---|
| 100 | 'extralinks': [ |
|---|
| 101 | ('GSDView Pro', 'http://www.example.com/products/gsdview/index.html'), |
|---|
| 102 | ], |
|---|
| 103 | } |
|---|
| 104 | |
|---|
| 105 | It is also possible to suppress *SF project linksé and display only |
|---|
| 106 | *extralinks* by using the `nosflinks` option:: |
|---|
| 107 | |
|---|
| 108 | html_theme_options = { |
|---|
| 109 | 'nosflinks': True, |
|---|
| 110 | } |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | A common example |
|---|
| 114 | ---------------- |
|---|
| 115 | |
|---|
| 116 | Here it is a summery of options to set in the `conf.py` file in order to use |
|---|
| 117 | the *sourceforge* sphinx theme:: |
|---|
| 118 | |
|---|
| 119 | html_theme = 'sourceforge' |
|---|
| 120 | html_theme_path = ['/path/to/themes/folder'] |
|---|
| 121 | html_theme_options = { |
|---|
| 122 | 'unixname': 'gsdview', |
|---|
| 123 | 'groupid': '226458', |
|---|
| 124 | 'hastrac': True, |
|---|
| 125 | #'nosflinks': False, |
|---|
| 126 | #'sflogotype': '14', |
|---|
| 127 | #'sflogowidth': '150', |
|---|
| 128 | #'sflogoheight': '40', |
|---|
| 129 | #'docstitlecolor': 'white', |
|---|
| 130 | 'extralinks': [ |
|---|
| 131 | ('GSDView Pro', 'http://www.example.com/products/gsdview/index.html'), |
|---|
| 132 | ], |
|---|
| 133 | } |
|---|
| 134 | html_sidebars = {'index': 'sfpagesidebar.html'} |
|---|