Erlang Central

Difference between revisions of "How to write HowTo's"

From ErlangCentral Wiki

 
(Stupid spammers)
(20 intermediate revisions by 10 users not shown)
Line 1: Line 1:
1. The first chapter.
+
==Author==
 +
[[User:Ludvig]]
  
The first section of the chapter
+
==Creating HowTo's==
 +
===Introduction===
 +
The best way to start creating a new How To is to look at the source of all the others howto's.
 +
(Hopefully someone will give a good explanation on how to create a new one.)
  
We are great fans of Gentoo, and encurage everyone to try it out. The document style you see here is taken from Gentoo, which has excellent (and beautiful) documentation. We have just made some minor adjustments, removing some Gentoo specific stuff. However, all credits should go to the Gentoo Documentation Project, where you can read more about the markup syntax etc.
+
===Creating A New Page===
  
Markup examples
+
A simple way to create a new Wiki page is to edit a URL to the title of the new page.
  
Here is some examples of various tags. /etc/passwd is a file. Here is an example of a command: ls. Some emphazised text.
+
For instance, for a new page called 'Grokking OTP Principles' you can
 +
simply browse to a new URL that looks like this:
  
Code listing 1.1
+
http://wiki.trapexit.org/index.php/Grokking_OTP_Principles
  
Here comes some text output or code.
+
===Adding New Article To HowTo Category===
1> F = fun(X) -> X+1 end.
+
#Fun<erl_eval.5.123085357>
+
2>  lists:map(F, [1,2,3]).
+
[2,3,4]
+
  
// How to use an anonymous function.
+
At the moment the only core thing for creating a new howto is how to add the new article in to the HowTo category.  
  
Note: This is a note.
+
This is done by adding the line
  
Warning: This is a warning.
+
<nowiki>[[Category:HowTo]]</nowiki>
  
Important: This is important.
+
at the bottom of the howto.  
  
Code listing 1.2: Output of time()
+
This will then automatically add the article to the category.
  
1> time().
+
===Embedding Erlang Code===
{9,49,56}
+
  
[[Category:Howto]]
+
Erlang code can be embedded in pages using the
  
[[Category:Howto]]
+
<nowiki><code></code></nowiki> tags.
 +
 
 +
The code tag can take a 'caption' attribute which will cause a caption to be displayed for the
 +
snippet.  It is a good idea to use the code tags rather than try and format code samples
 +
yourself since future extensions to the Wiki will include syntax highlighting
 +
for appropriately marked up code.
 +
 
 +
You can also create a code section by just putting a space in front of each line:
 +
 
 +
Code Line 1
 +
Code Line 2
 +
Code Line 3
 +
 
 +
====Example====
 +
 
 +
<pre>

Revision as of 13:26, 15 June 2007

Contents

Author

User:Ludvig

Creating HowTo's

Introduction

The best way to start creating a new How To is to look at the source of all the others howto's. (Hopefully someone will give a good explanation on how to create a new one.)

Creating A New Page

A simple way to create a new Wiki page is to edit a URL to the title of the new page.

For instance, for a new page called 'Grokking OTP Principles' you can simply browse to a new URL that looks like this:

http://wiki.trapexit.org/index.php/Grokking_OTP_Principles

Adding New Article To HowTo Category

At the moment the only core thing for creating a new howto is how to add the new article in to the HowTo category.

This is done by adding the line

[[Category:HowTo]]

at the bottom of the howto.

This will then automatically add the article to the category.

Embedding Erlang Code

Erlang code can be embedded in pages using the

<code></code> tags.

The code tag can take a 'caption' attribute which will cause a caption to be displayed for the snippet. It is a good idea to use the code tags rather than try and format code samples yourself since future extensions to the Wiki will include syntax highlighting for appropriately marked up code.

You can also create a code section by just putting a space in front of each line:

Code Line 1
Code Line 2
Code Line 3

Example