On écrit un texte en italique, un autre en gras, et un dernier barré.
Une page avec un peu d'aide sur la syntawe du wiki : syntax.
Une nouvelle page.
Une petite liste :
for(int i = 0 ; i < 10 ; i++) printf("Hello World\n");
<markdown> Header 1
~~~ some code ~~~
Paragraph
Header 2
- A - simple - list
1. And 2. numbered 3. list
Quite intuitive? *emphasis*, strong, etc. </markdown>
$$sqrt(x*y) = z$$
Il faut ajouter dans conf/local.php la ligne suivante : $conf['htmlok'] = 1; ou plus simplement via l'interface d'administration. Ensuite, on peut intégrer du HTML avec la balise <html> ... </html> et même du JavaScript.
Un exemple HTML :
<html><span style="color:red;font-size:100%;">inline HTML</span></html>
<html><span style=“color:red;font-size:100%;”>inline HTML</span></html>
Un petit exemple JavaScript :
<html> <script>document.write("hello world");</script> </html>
<html> <script>document.write(“Hello World in JavaScript !”);</script> </html>
Il y a également la possibilité d'activer le PHP dans le wiki via l'interface d'administration.
<php> print "hello world in PHP ! "; </php>
<php> print “ * hello world in PHP ! <br>”; print “ * hello world in PHP ! <br>”; </php>
Un peu d'aide sur JavaScript :
Un exemple tout simple
<html>
<script type="text/javascript">
var jsontext = '{"firstname":"Jesper","surname":"Aaberg","phone":["555-0100","555-0120"]}';
var contact = JSON.parse(jsontext);
document.write(contact.surname + ", " + contact.firstname);
</script>
</html>
Pour récupérer les coordonnées GPS (lat,lon) du Col de Marraut : http://www.camptocamp.org/summits/fr/395835.json
<html>
<script type="text/javascript">
// if(window.XMLHttpRequest) alert("HTTP Request Good!");
function httpGet(theUrl) {
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); /* async = false or true */
xmlHttp.send( null );
// if(xmlHttp.readyState == 4) alert("Requête effectuée !");
return xmlHttp.responseText;
}
var httpResponse = httpGet('www.camptocamp.org/summits/fr/395835.json'); // SOP (SAME-ORIGIN POLICY) ERROR !!!!
document.write("Response : " + httpResponse);
</script>
</html>
En fait, la requête XHR est impossible en Cross-Domain !
Tout est expliqué ici : http://api.jquery.com/jQuery.getJSON/
<html> <head>
<meta charset="utf-8">
<style type="text/css">
/*
#images, img {
height: 50px;
float: left;
}
*/
</style>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div id=“images”></div>
<script> (function() {
var flickerAPI = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
$.getJSON( flickerAPI, {
tags: "mount rainier",
tagmode: "any",
format: "json"
})
.done(function( data ) {
$.each( data.items, function( i, item ) {
$( "<img>" ).attr( "src", item.media.m ).appendTo( "#images" );
if ( i === 3 ) {
return false;
}
});
});
})(); </script>
</body> </html>
Une solution possible, ici : http://blog.pascal-martin.fr/post/Requete-Ajax-Cross-domain-balise-script
Ou une autre avec un serveur proxy JSONP : http://jsonp.jit.su/
<html>
<script>
$.getJSON('http://jsonp.jit.su/?callback=?&url=http://jsonview.com/example.json', function(data){
alert('fake AJAX! ' + data.awesome);
});
</script>
</html>
OK