Style
Style Guide
On this page, we summarize best practices for keeping the GoodRelations Wiki consistent.Contents
- 1 Style Guide
- 1.1 URI Pattern
- 1.2 Color Codes
- 1.3 Basic Structure
- 1.4 Naming Conventions
- 1.5 Code: RDF/XML, Turtle, RDFa
- 1.6 Images
- 1.7 Multiple Columns
- 1.8 Disabling Page Title
- 1.9 Disabling Table of Contents
- 1.10 Forcing the Table of Contents to be Displayed at a Certain Position
- 1.11 Disabling Edit Link for Subsections
- 1.12 Side-bar
- 1.13 Infobox, Message Boxes and Navigation Templates
- 1.14 Feed
- 1.15 Extensions
URI Pattern
We use a hierarchical URI pattern:
- Pages of generic relevance are in the "root" name space
- The following types of documents have their own subspaces
- /Cookbook/ - all recipes
- /Case_studies/ - all case studies
- /Tools/ - all tools
- /Events/ - all events
- /Vocabularies/ - all ontologies (VSO etc.)
- /GEP/ - GoodRelations Enhancement Proposals
- /Documentation/ - the User's Guide
Examples:
- http://wiki.goodrelations-vocabulary.org/Case_studies/Best_Buy
- http://wiki.goodrelations-vocabulary.org/Tools/BMEcat2GR
Color Codes
- Links
- Foreground color: #df6010
- Code listings
- Background color: #fff9ef
- Border color: #efa363
- Header menu
- Background color on select: #636161
- Background color on hover: none
- Border color: #bd7b1a
- Navigation boxes and footer bar
- Background color: #eeeeee
- Border color: #dddddd (bottom or top)
Basic Structure
Page titles use H1, e.g.
= The GoodRelations Cookbook =
All subsections use H2. e.g.
= The GoodRelations Cookbook = blabla == Section 1 == blabla == Section 2 ==
Naming Conventions
Pages
Page URIs should be useful page titles, e.g.
- http://wiki.goodrelations-vocabulary.org/Case_studies
Only the first character is capitalized, unless the page title is a proper name, e.g.
- http://wiki.goodrelations-vocabulary.org/GoodRelations_Validator
If the full page title is pretty long, use a good acronym and disable the displaying of this as the page title, e.g. as in
Categories
Category names should be in singular form, with proper English capitalization and underscores for spaces (no CamelWords). Examples:
- http://wiki.goodrelations-vocabulary.org/Category:Tool
- http://wiki.goodrelations-vocabulary.org/Category:Shop_Extension
Code: RDF/XML, Turtle, RDFa
The wiki supports syntax highlighting via the Geshi extension, plus a proprietary extension for syntax highlighting for SPARQL and Turtle. For RDF/XML, use
<code xml> code </code>
For SPARQL and Turtle, use
<code n3> code </code>
See also http://www.mediawiki.org/wiki/Extension:GeSHiCodeTag
Images
Images should be 720 pixels wide.
Multiple Columns
Use a div element instead of tables:
Two columns
Tools
FAQs
Tools
FAQs
Three columns
Tools
FAQs
People
Tools
FAQs
People
Disabling Page Title
Insert (has been disabled - titles only appear if colon is found in title name, e.g. Mediawiki:Sidebar)
{{DISPLAYTITLE:<span style="display:none">{{FULLPAGENAME}}</span>}}
Better use
__NOTITLE__
Disabling Table of Contents
__NOTOC__
Forcing the Table of Contents to be Displayed at a Certain Position
__TOC__
or
__FORCETOC__
Disabling Edit Link for Subsections
__NOEDITSECTION__
Side-bar
Edit http://wiki.goodrelations-vocabulary.org/Mediawiki:Sidebar
Infoboxes
- Infobox User: http://wiki.goodrelations-vocabulary.org/Template:Infobox_User
- Infobox Case Study: http://wiki.goodrelations-vocabulary.org/Template:Infobox_Case_Study
- Infobox Cookbook: http://wiki.goodrelations-vocabulary.org/Template:Infobox_Cookbook
- Infobox Event: http://wiki.goodrelations-vocabulary.org/Template:Infobox_Event
- Infobox Tool: http://wiki.goodrelations-vocabulary.org/Template:Infobox_Tool
Example 1 - Case Study Infobox:
{{infobox Case Study | company = Universität der Bundeswehr München }}
Example 2 - User Infobox:
{{infobox User | name = Martin Hepp | affiliation = Universität der Bundeswehr München | role = Professor and Head of Research Group }}
- Navbox Documentation: http://wiki.goodrelations-vocabulary.org/Template:Navbox_Documentation
Example - Documentation Navbox:
{{navbox Documentation | prev = Intro | next = Quickstart }}
Message boxes
{{Warning|It is important to observe ...}}
{{Note|This feature has been introduced for scenarios where...}}
{{Tip|You can save a lot of markup by ...}}
{{Update required}}
{{Work in progress}}
Feed
Last modified pages: {{#widget:Feed |feedurl=http://wiki.goodrelations-vocabulary.org/index.php?title=Special:RecentChanges&feed=atom |chan=n |num=5 |desc=0 |date=n |targ=y }}
Extensions
No Title
This light-weight extension allows to hide the page title:
__NOTITLE__
CategorySuggest
... is an extraction of SelectCategoryTagCloud (without cloud feature). SelectCategoryTagCloud causes a weird behaviour of mediawiki in a sense that it trims all leading spaces in preformatted text. Thus we discarded it.
Cite
Example
According to scientists, the Sun is pretty big.<ref>E. Miller, The Sun, (New York: Academic Press, 2005), 23-5.</ref> The Moon, however, is not so big.<ref>R. Smith, "Size of the Moon", Scientific American, 46 (April 1978): 44-6.</ref> ==Notes== <references />
Sample result
According to scientists, the Sun is pretty big.[1] The Moon, however, is not so big.[2]
Notes
- ↑ E. Miller, The Sun, (New York: Academic Press, 2005), 23-5.
- ↑ R. Smith, "Size of the Moon", Scientific American, 46 (April 1978): 44-6.
Custom Sidebar
The replacement of the standard sidebar for a single page by a custom sidebar (e.g. with two boxes) is best accomplished via the sidebar tag:
<sidebar> * Menu ** link1|Text 1 ** link2|Text 2 * Menu2 ** link1|Text 1 ** link2|Text 2 </sidebar>
If you inserted the above snippet (omitting the sidebar-tag) into Tools/Sidebar the complete "Tools" hierarchy would inherit the custom sidebar, i.e. Tools/BMEcat2GR, etc.
More information:
Category Members on Sidebar
This extension allows to enrich the sidebar with a list of all members in a category.
* CATEGORY:Tool|List of Tools
This widget allows you to add SlideShare presentations to your wiki page.
To insert this widget, use the following code:
{{#widget:SlideShare |doc=goodrelationsoverviewfinal3key-1227044498468783-9 |width=425 |height=348 }}
Parameters
- doc - is a parameter from embed code
- start - optional parameter to define start slide number
- width & height - optional, 425x348 is a default
- player - defaults to '2' and allows you to switch to other players
- norelated - if set, widget will not display related content and sharing functionality at the end of the deck
Sample result
{{#widget:SlideShare |doc=goodrelationsoverviewfinal3key-1227044498468783-9 |width=425 |height=348 }}