Difference between revisions of "Template:Diary/Documentation"

From GodWiki
Jump to navigation Jump to search
m (Documenting hint style)
(Update docs for new style and width parameter values, and add simple style gallery)
Line 8: Line 8:
  
 
;width
 
;width
:''Optional''. Must be a standard length (in 'px', 'em', or other supported units). Auto by default (sized to the diary entry contents), but with a minimum width that matches the quest boxes from {{tl|Diaryquest}}. It is better to leave it as default in most cases (i.e omitting this parameter, or leaving it blank) unless you need extra width for some reason.
+
:''Optional''. The width may be set to a standard CSS length (in 'px', 'em', or other supported units), or it can be set to one of the standard sizes on the hero main page (on desktop). Setting {{para|width}} to any of the keywords '''main''', '''central''', '''center''', or '''centre''' will set it to the default width of the central column on desktop; setting it to the keyword '''side''' will set the default width of the side columns on desktop. The default behaviour is to automatically size the diary box to the contents, but with a minimum width that matches the quest boxes from {{tl|Diaryquest}}. It is better to leave it as default in most cases (i.e omitting this parameter, or leaving it blank) unless you need extra width for some reason.
  
 
;title
 
;title
Line 14: Line 14:
  
 
;style
 
;style
:''Optional''. If this parameter is omitted or set to '''default''', the template will use a modern style which closely resembles the current Godville web interface. (That same style can be explicitly selected by setting the parameter to '''superhero'''.) The previous default style is available by specifying {{para|style|hero}}. Other available styles are {{para|style|retro}} and {{para|style|hint}}, which mimics the yellow hint/dev blog announcement popup at the top of the superhero page. A few old, deprecated styles in different color schemes are no longer available.
+
:''Optional''. If this parameter is omitted or set to '''default''', the template will use a modern style which closely resembles the current Godville web interface. (That same style can be explicitly selected by setting the parameter to '''superhero'''.) The previous default style is available by specifying {{para|style|hero}}. Other available styles are '''retro''', '''sunny''', '''emerald''', '''violet''', '''divine''', and '''hint'''. See the table below of examples of each of these styles.
  
===Examples of Use===
+
;css
 +
:''Optional''. Allows advanced users to insert inline CSS into the enclosing {{tag|div}} element if needed.
 +
 
 +
=== Style Gallery ===
 +
 
 +
{|
 +
! Style parameter !! Example
 +
|-
 +
| Unspecified (or {{para|style|superhero}}) || {{diary|This is the superhero style}}
 +
|-
 +
| {{para|style|retro}} || {{diary|style=retro|This is the retro style}}
 +
|-
 +
| {{para|style|hero}} || {{diary|style=hero|This is the hero style}}
 +
|-
 +
| {{para|style|sunny}} || {{diary|style=sunny|This is the sunny style}}
 +
|-
 +
| {{para|style|emerald}} || {{diary|style=emerald|This is the emerald style}}
 +
|-
 +
| {{para|style|violet}} || {{diary|style=violet|This is the violet style}}
 +
|-
 +
| {{para|style|divine}} || {{diary|style=divine|This is the divine style}}
 +
|-
 +
| {{para|style|hint}} || {{diary|style=hint|This is the hint style}}
 +
|}
 +
 
 +
=== Examples of Use ===
 
;This
 
;This
 
:<pre>{{diary|What is wrong with all these monsters? Why does my pain give them such delight?!}}</pre>
 
:<pre>{{diary|What is wrong with all these monsters? Why does my pain give them such delight?!}}</pre>
Line 23: Line 48:
  
 
;This
 
;This
:<pre>{{diary | title = The Scroll of Spode | width = 40em | text = 22:22  This is an entry of great width}}</pre>
+
:<pre>{{diary | title = The Scroll of Spode | width = 40em | 22:22  This is an entry of great width}}</pre>
 
;Results in
 
;Results in
:{{diary | title = The Scroll of Spode | width = 40em | text = 22:22  This is an entry of great width}}
+
:{{diary | title = The Scroll of Spode | width = 40em | 22:22  This is an entry of great width}}
  
 
;This
 
;This
:<pre>{{diary | style=superhero | text = 22:22  This is also an entry of great (automatic) width, but with the default title (if you leave it unspecified) and the "superhero" style.}}</pre>
+
:<pre>{{diary | style=superhero | 22:22  This is also an entry of great (automatic) width, but with the default title (if you leave it unspecified) and the "superhero" style.}}</pre>
 
;Results in:
 
;Results in:
:{{diary | style=superhero | text = 22:22  This is also an entry of great (automatic) width, but with the default title (if you leave it unspecified) and the "superhero" style.}}
+
:{{diary | style=superhero | 22:22  This is also an entry of great (automatic) width, but with the default title (if you leave it unspecified) and the "superhero" style.}}
  
 
;This
 
;This
:<pre>{{diary | style=superhero | text = 10:15 An auto-sized diary!<br />10:14 With two entries!}}</pre>
+
:<pre>{{diary | style=superhero | 10:15 An auto-sized diary!<br />10:14 With two entries!}}</pre>
 
;Results in:
 
;Results in:
:{{diary | style=superhero | text = 10:15 An auto-sized diary!<br />10:14 With two entries!}}
+
:{{diary | style=superhero | 10:15 An auto-sized diary!<br />10:14 With two entries!}}
  
 
;This
 
;This
:<pre>{{diary | style=retro| title = The Scroll of Spode |  text = 10:15 Look at this retro diary entry!}}</pre>
+
:<pre>{{diary | style=retro | title = The Scroll of Spode |  10:15 Look at this retro diary entry!}}</pre>
 
;Results in:
 
;Results in:
:{{diary | style=retro| title = The Scroll of Spode |  text = 10:15 Look at this retro diary entry!}}
+
:{{diary | style=retro| title = The Scroll of Spode |  10:15 Look at this retro diary entry!}}
  
 
;This
 
;This
:<pre>{{diary | style=hero | text = 10:15 Look at this hero diary entry!}}</pre>
+
:<pre>{{diary | style=hero | 10:15 Look at this hero diary entry!}}</pre>
 
;Results in:
 
;Results in:
:{{diary | style=hero | text = 10:15 Look at this hero diary entry!}}
+
:{{diary | style=hero | 10:15 Look at this hero diary entry!}}
 +
 
 
;This
 
;This
:<pre>{{diary | style = hint | text = Check out the [https://godvillegame.com/blog news] in the blog. }}</pre>
+
:<pre>{{diary | style = hint | Check out the [https://godvillegame.com/blog news] in the blog. }}</pre>
 
;Results in:
 
;Results in:
:{{diary | style = hint | text = Check out the [https://godvillegame.com/blog news] in the blog. }}
+
:{{diary | style = hint | Check out the [https://godvillegame.com/blog news] in the blog. }}
 +
 
 +
;This
 +
:<pre>{{diary | width = central | This matches the default width of the main column of the superhero page on desktop. }}</pre>
 +
;Results in:
 +
:{{diary | width = central | This matches the default width of the main column of the superhero page on desktop. }}
 +
 
 +
;This
 +
:<pre>{{diary | width = side | This matches the default width of the side column of the superhero page on desktop. }}</pre>
 +
;Results in:
 +
:{{diary | width = side | This matches the default width of the side column of the superhero page on desktop. }}
 +
 
 
<noinclude>[[Category:Templates/Documents|{{PAGENAME}}]]</noinclude>
 
<noinclude>[[Category:Templates/Documents|{{PAGENAME}}]]</noinclude>

Revision as of 07:30, 11 December 2020

Inserts a Hero's Diary graphic very similar to the real thing.

Parameters

Unnamed parameter, or
text
Required. The diary entry. Include the time before it. You can see the default text above. If you want another diary entry after it, to place the next one on the line below separate each diary entry with a <br /> as this is the code for a line break.
width
Optional. The width may be set to a standard CSS length (in 'px', 'em', or other supported units), or it can be set to one of the standard sizes on the hero main page (on desktop). Setting |width= to any of the keywords main, central, center, or centre will set it to the default width of the central column on desktop; setting it to the keyword side will set the default width of the side columns on desktop. The default behaviour is to automatically size the diary box to the contents, but with a minimum width that matches the quest boxes from {{Diaryquest}}. It is better to leave it as default in most cases (i.e omitting this parameter, or leaving it blank) unless you need extra width for some reason.
title
Optional. This is the title text. The default is 'Hero's Diary' (the same as the real thing).
style
Optional. If this parameter is omitted or set to default, the template will use a modern style which closely resembles the current Godville web interface. (That same style can be explicitly selected by setting the parameter to superhero.) The previous default style is available by specifying |style=hero. Other available styles are retro, sunny, emerald, violet, divine, and hint. See the table below of examples of each of these styles.
css
Optional. Allows advanced users to insert inline CSS into the enclosing <div>...</div> element if needed.

Style Gallery

Style parameter Example
Unspecified (or |style=superhero)
!Hero's Diary
This is the superhero style
|style=retro
!Hero's Diary
This is the retro style
|style=hero
Hero's Diary ▼
This is the hero style
|style=sunny
!Hero's Diary
This is the sunny style
|style=emerald
!Hero's Diary
This is the emerald style
|style=violet
!Hero's Diary
This is the violet style
|style=divine
!Hero's Diary
This is the divine style
|style=hint
!Hooray!
This is the hint style

Examples of Use

This
{{diary|What is wrong with all these monsters? Why does my pain give them such delight?!}}
Results in
!Hero's Diary
What is wrong with all these monsters? Why does my pain give them such delight?!


This
{{diary | title = The Scroll of Spode | width = 40em | 22:22  This is an entry of great width}}
Results in
!The Scroll of Spode
22:22 This is an entry of great width


This
{{diary | style=superhero | 22:22  This is also an entry of great (automatic) width, but with the default title (if you leave it unspecified) and the "superhero" style.}}
Results in
!Hero's Diary
22:22 This is also an entry of great (automatic) width, but with the default title (if you leave it unspecified) and the "superhero" style.


This
{{diary | style=superhero | 10:15 An auto-sized diary!<br />10:14 With two entries!}}
Results in
!Hero's Diary
10:15 An auto-sized diary!
10:14 With two entries!


This
{{diary | style=retro | title = The Scroll of Spode |  10:15 Look at this retro diary entry!}}
Results in
!The Scroll of Spode
10:15 Look at this retro diary entry!


This
{{diary | style=hero | 10:15 Look at this hero diary entry!}}
Results in
Hero's Diary ▼
10:15 Look at this hero diary entry!


This
{{diary | style = hint | Check out the [https://godvillegame.com/blog news] in the blog. }}
Results in
!Hooray!
Check out the news in the blog.


This
{{diary | width = central | This matches the default width of the main column of the superhero page on desktop. }}
Results in
!Hero's Diary
This matches the default width of the main column of the superhero page on desktop.


This
{{diary | width = side | This matches the default width of the side column of the superhero page on desktop. }}
Results in
!Hero's Diary
This matches the default width of the side column of the superhero page on desktop.