Difference between revisions of "Wiki Tips"

From GnuCash
Jump to: navigation, search
(Syntax Highlighting)
(Updated wiki tips to a bit with inspiration from mediawiki for example formatting. This was done in prep for adding tips for tables.)
Line 1: Line 1:
Tips to edit and maintain this wiki
+
The GnuCash wiki uses the very popular and capable [https://www.mediawiki.org WikiMedia].  Here we list a few tips and recommendations for the GnuCash wiki.
 +
 
 
==Syntax Highlighting==
 
==Syntax Highlighting==
Syntax Highlighting is enabled and should be prefered over <nowiki><nowiki></nowiki></nowiki>, <nowiki><pre></pre></nowiki> or indentation to mark code snippets or other formated files.
+
Syntax Highlighting makes code examples so much easier to read.  It is therefore strongly preferred over <nowiki><nowiki></nowiki></nowiki>, <nowiki><pre></pre></nowiki> or indentation to mark code snippets or other formatted files.
;Example: <nowiki><syntaxhighlight lang="sh">
+
 
LANG=C gnucash
+
Here are a couple of examples to illustrate this richness:
 +
{| style="width:100%;text-align:left"
 +
!scope="col" style="width:50% " | You Type
 +
!scope="col" style="width:50%" | You Get
 +
 
 +
|-style="vertical-align:top;"
 +
|<pre><syntaxhighlight lang="sh">
 +
# A hello world shell script
 +
echo "Hello, World!"
 
</syntaxhighlight>
 
</syntaxhighlight>
</nowiki>
+
</pre>
will result in
+
|<syntaxhighlight lang="sh">
<syntaxhighlight lang="sh">
+
# A hello world shell script
LANG=C gnucash
+
echo "Hello, World!"
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
|-style="vertical-align:top;"
 +
|<pre><syntaxhighlight lang="scheme">
 +
; A hello world program in scheme
 +
(begin
 +
  (display "Hello, World!")
 +
  (newline))
 +
</syntaxhighlight>
 +
</pre>
 +
|<syntaxhighlight lang="scheme">
 +
; A hello world program in scheme
 +
(begin
 +
  (display "Hello, World!")
 +
  (newline))
 +
</syntaxhighlight>
 +
|}
  
 
Examples with optional parameters can be found at https://www.mediawiki.org/wiki/Extension:SyntaxHighlight.  
 
Examples with optional parameters can be found at https://www.mediawiki.org/wiki/Extension:SyntaxHighlight.  
:A list of supported languages is available at [http://pygments.org/languages/ Supported languages],
+
 
: more details at [http://pygments.org/docs/lexers/ Available lexers].
+
A list of supported languages is available at [http://pygments.org/languages/ Supported languages],
 +
more details at [http://pygments.org/docs/lexers/ Available lexers].
  
 
==Using Images==
 
==Using Images==
  
There are several ways to use images - beneath other files - in this wiki:
+
There are several ways to incorporate images into your wiki pages.
  
 
=== Uploading ===
 
=== Uploading ===
Admins and other users with uploadaccess can upload images via [[Special:Upload]].
+
Admins and other users with the uploadaccess permission can upload images via [[Special:Upload]].
<nowiki>[[File:filename.extension|options|caption]]</nowiki>
 
can than be used to embed them in a text.
 
;Example:
 
<nowiki>[[File:Gnucash-icon.png|100px|Click me!]]</nowiki>
 
appears as
 
:[[File:Gnucash-icon.png|100px|Click me!]]
 
  
This Images will have a full version history and other metadata. To see them, just click on the image.
+
These images are then referenced from a wiki page with the following syntax:
 +
<syntaxhighlight lang="html">
 +
[[File:filename.extension|options|caption]]
 +
</syntaxhighlight>
 +
 
 +
{| style="width:100%;text-align:left"
 +
!scope="col" style="width:50%" | You Type
 +
!scope="col" style="width:50%" | You Get
 +
|-
 +
|<pre>[[File:Gnucash-icon.png|100px|Click me!]]</pre>
 +
|[[File:Gnucash-icon.png|100px|Click me!]]
 +
|}
 +
 
 +
Images have a full version history and other metadata. To see them, just click on the image.
  
 
With the <tt>link={target}</tt> option you can refer files from other sites with a wikimedia upload directory like commons.wikimedia.org.  
 
With the <tt>link={target}</tt> option you can refer files from other sites with a wikimedia upload directory like commons.wikimedia.org.  
  
=== Linking ===
+
=== Linking to External Images ===
Sometimes you might wish to link elsewhere existing images whithout overhead e.g. drafts of the guide might reuse the images from the nightly docs.  
+
Sometimes you might wish to link existing images without overhead, e.g. drafts of the guide might reuse the images from the nightly docs.  
But the URL must not match our [[MediaWiki:Spam-blacklist]] or conform our [[MediaWiki:Spam-whitelist]].
+
 
 +
The URL must not match [[MediaWiki:Spam-blacklist]] and must conform to our [[MediaWiki:Spam-whitelist]].
 +
 
 +
==== embedding external image ====
 +
Embedding an allowed image is as simple as typing its URL:
 +
<syntaxhighlight lang="html">
 +
http://url.for/some/image.png
 +
</syntaxhighlight>
 +
The URL must conform to our [[MediaWiki:External image whitelist]].
 +
 
 +
Example:
 +
{| style="width:100%;text-align:left"
 +
!scope="col" style="width:50%" | You Type
 +
!scope="col" style="width:50%" | You Get
 +
|-style="vertical-align:top;"
 +
|<pre>http://www.gnucash.org/images/gnucash-perspective.png</pre>
 +
|http://www.gnucash.org/images/gnucash-perspective.png
 +
|}
  
==== embedding ====
+
==== linking to external image ====
<nowiki>http://url.for/some/image.png</nowiki>
+
You can also link to an external image like so.
The URL must match our [[MediaWiki:External image whitelist]].
 
;Example:
 
<nowiki>http://www.gnucash.org/images/gnucash-perspective.png</nowiki>
 
appears as
 
:http://www.gnucash.org/images/gnucash-perspective.png
 
  
==== linking ====
+
{| style="width:100%;text-align:left"
<nowiki>[http://www.gnucash.org/images/banner5.png Banner]</nowiki>
+
!scope="col" style="width:50%" | You Type
This will only show up as a textual link:
+
!scope="col" style="width:50%" | You Get
[http://www.gnucash.org/images/banner5.png Banner]
+
|-
You will have to click on it to see the image.
+
|<pre>[http://www.gnucash.org/images/banner5.png Banner]</pre>
 +
|[http://www.gnucash.org/images/banner5.png Banner]
 +
|}
 +
 +
You will have to click on the link to open the image.
  
 
;Source: https://www.mediawiki.org/wiki/Help:Images
 
;Source: https://www.mediawiki.org/wiki/Help:Images

Revision as of 22:02, 26 July 2017

The GnuCash wiki uses the very popular and capable WikiMedia. Here we list a few tips and recommendations for the GnuCash wiki.

Syntax Highlighting

Syntax Highlighting makes code examples so much easier to read. It is therefore strongly preferred over <nowiki></nowiki>, <pre></pre> or indentation to mark code snippets or other formatted files.

Here are a couple of examples to illustrate this richness:

You Type You Get
<syntaxhighlight lang="sh">
# A hello world shell script
echo "Hello, World!"
</syntaxhighlight>
# A hello world shell script
echo "Hello, World!"
<syntaxhighlight lang="scheme">
; A hello world program in scheme
(begin
  (display "Hello, World!")
  (newline))
</syntaxhighlight>
; A hello world program in scheme
(begin
  (display "Hello, World!")
  (newline))

Examples with optional parameters can be found at https://www.mediawiki.org/wiki/Extension:SyntaxHighlight.

A list of supported languages is available at Supported languages, more details at Available lexers.

Using Images

There are several ways to incorporate images into your wiki pages.

Uploading

Admins and other users with the uploadaccess permission can upload images via Special:Upload.

These images are then referenced from a wiki page with the following syntax:

[[File:filename.extension|options|caption]]
You Type You Get
[[File:Gnucash-icon.png|100px|Click me!]]
Click me!

Images have a full version history and other metadata. To see them, just click on the image.

With the link={target} option you can refer files from other sites with a wikimedia upload directory like commons.wikimedia.org.

Linking to External Images

Sometimes you might wish to link existing images without overhead, e.g. drafts of the guide might reuse the images from the nightly docs.

The URL must not match MediaWiki:Spam-blacklist and must conform to our MediaWiki:Spam-whitelist.

embedding external image

Embedding an allowed image is as simple as typing its URL:

http://url.for/some/image.png

The URL must conform to our MediaWiki:External image whitelist.

Example:

You Type You Get
http://www.gnucash.org/images/gnucash-perspective.png
gnucash-perspective.png

linking to external image

You can also link to an external image like so.

You Type You Get
[http://www.gnucash.org/images/banner5.png Banner]
Banner

You will have to click on the link to open the image.

Source
https://www.mediawiki.org/wiki/Help:Images