Skip to content

Commit

Permalink
Added code highlighting to documentation code
Browse files Browse the repository at this point in the history
  • Loading branch information
rafeca committed Oct 3, 2011
1 parent 529e82e commit 96f03ad
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 14 deletions.
44 changes: 30 additions & 14 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" media="all" href="docco.css" />
<link rel="stylesheet" media="all" href="stylesheets/sh_style.css" />

<script type="text/javascript" src="javascripts/sh_main.min.js"></script>
<script type="text/javascript" src="javascripts/sh_javascript.min.js"></script>

<style type="text/css">
body {
Expand Down Expand Up @@ -38,7 +42,10 @@
pre {
margin: 25px 0;
padding: 5px 0;
border-left: 5px solid #b9b19d;
border-left: 5px solid #dab583;
color: #444;
font-weight: normal;
font-style: normal;
}

h2 {
Expand Down Expand Up @@ -68,15 +75,17 @@ <h2>How to install</h2>
<p>Downloading it from npm repository:</p>

<pre>
$ npm install connfu</pre>
$ npm install connfu
</pre>

<p>If you'd prefer to install the latest master version of connFu, you can clone the connfu-node source repository
from GitHub and then install it using npm:</p>

<pre>
$ git clone https://github.com/dogfood20/connfu-node.git

$ npm install -g connfu-node/</pre>
$ npm install -g connfu-node/
</pre>


<h2>How to use it</h2>
Expand All @@ -85,36 +94,40 @@ <h3>Connecting to streams</h3>

<p>First, require connfu package:</p>

<pre>
var connFu = require('connfu');</pre>
<pre class="sh_javascript">
var connFu = require('connfu');
</pre>

<p>Next, create a basic application using your connFu API KEY:</p>

<pre>
var app = connFu.createApp(<your_api_key>);</pre>
<pre class="sh_javascript">
var app = connFu.createApp(&lt;your_api_key&gt;);
</pre>

<p>Then, attach some event handlers:</p>

<pre>
<pre class="sh_javascript">
app.on("voice", {
join: function(params){
console.log("The number " + params.from + " joined to the conference with number " + params.to);
},
leave: function(params){
console.log("The number " + params.from + " left the conference with number " + params.to);
}
});</pre>
});
</pre>

<p>Finally, just listen!</p>

<pre>
app.listen();</pre>
<pre class="sh_javascript">
app.listen();
</pre>

<h3>Sending commands</h3>

<p>The connFu package can also send commands to handle some aspects of the application:</p>

<pre>
<pre class="sh_javascript">
var connFu = require('connfu');

// Init application
Expand All @@ -129,10 +142,11 @@ <h3>Sending commands</h3>
});
});

(...)
/** (...) **/

// Delete the voice channel
app.commands.voice("conference").delete();</pre>
app.commands.voice("conference").delete();
</pre>

<h2>Examples</h2>

Expand All @@ -142,5 +156,7 @@ <h2>Examples</h2>

<p class="powered"><span>Powered by: </span><a href="http://bluevia.com" title="Bluevia Labs"><img src="images/bluevia-logo.png" alt="Bluevia Labs"></a>
</div>

<script type="text/javascript">sh_highlightDocument();</script>
</body>
</html>
1 change: 1 addition & 0 deletions docs/javascripts/sh_javascript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions docs/javascripts/sh_main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

131 changes: 131 additions & 0 deletions docs/stylesheets/sh_style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
pre.sh_sourceCode .sh_keyword {
color: #B26818;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_type {
color: #00ff00;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_string {
color: #D11E27;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_regexp {
color: #ff0000;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_specialchar {
color: #ff22ff;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_comment {
color: #999;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_number {
color: #ff0000;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_preproc {
color: #ff22ff;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_function {
color: #000;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_url {
color: #ff0000;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_date {
color: #B26818;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_time {
color: #B26818;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_file {
color: #B26818;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_ip {
color: #ff0000;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_name {
color: #ff0000;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_variable {
color: #B26818;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_oldfile {
color: #ff22ff;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_newfile {
color: #ff0000;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_difflines {
color: #B26818;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_selector {
color: #B26818;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_property {
color: #B26818;
font-weight: normal;
font-style: normal;
}

pre.sh_sourceCode .sh_value {
color: #ff0000;
font-weight: normal;
font-style: normal;
}

0 comments on commit 96f03ad

Please sign in to comment.