La gestion des ressources multimédia n’est jamais simple.
Toutes les ressources sont placées dans un même répertoire.
La macro link-asset vous permet de faire des liens facilement.
Pour notre modèle, les ressources sont dans le répertoire :
La coloration syntaxique est gérée par Rouge, la liste des languages disponibles ici.
Python
defdump_args(func):"This decorator dumps out the arguments passed to a function before calling it"argnames=func.func_code.co_varnames[:func.func_code.co_argcount]fname=func.func_namedefecho_func(*args,**kwargs):printfname,":",', '.join('%s=%r'%entryforentryinzip(argnames,args)+kwargs.items())returnfunc(*args,**kwargs)returnecho_func@dump_argsdeff1(a,b,c):printa+b+cf1(1,2,3)defprecondition(precondition,use_conditions=DEFAULT_ON):returnconditions(precondition,None,use_conditions)defpostcondition(postcondition,use_conditions=DEFAULT_ON):returnconditions(None,postcondition,use_conditions)classconditions(object):__slots__=('__precondition','__postcondition')def__init__(self,pre,post,use_conditions=DEFAULT_ON):ifnotuse_conditions:pre,post=None,Noneself.__precondition=preself.__postcondition=post
C++
#include"algostuff.hpp"usingnamespacestd;boolbothEvenOrOdd(intelem1,intelem2){returnelem1%2==elem2%2;}intmain(){vector<int>coll1;list<int>coll2;floatm=40.0f;INSERT_ELEMENTS(coll1,1,7);INSERT_ELEMENTS(coll2,3,9);PRINT_ELEMENTS(coll1,"coll1: \n");PRINT_ELEMENTS(coll2,"coll2: \n");// check whether both collections are equalif(equal(coll1.begin(),coll1.end(),// first rangecoll2.begin())){// second rangecout<<"coll1 == coll2"<<endl;}/* TODO Shouldn't there be an 'else' case? */// check for corresponding even and odd elementsif(equal(coll1.begin(),coll1.end(),// first rangecoll2.begin(),// second rangebothEvenOrOdd)){// comparison criterioncout<<"even and odd elements correspond"<<endl;}}
Java
importjava.io.*;importjava.util.*;publicclassKeyboardIntegerReader{publicstaticvoidmain(String[]args)throwsjava.io.IOException{Strings1;Strings2;intnum=0;// set up the buffered reader to read from the keyboardBufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));booleancont=true;while(cont){System.out.print("Enter an integer:");s1=br.readLine();StringTokenizerst=newStringTokenizer(s1);s2="";while(cont&&st.hasMoreTokens()){try{s2=st.nextToken();num=Integer.parseInt(s2);cont=false;}catch(NumberFormatExceptionn){System.out.println("The value in \""+s2+"\" is not an integer");}}}System.out.println("You entered the integer: "+num);}}
Normal code block
/** Comment */publicvoidmethod();
Some extra explanation to help understand the code.
Code block with title
/** Comment */publicvoidmethod();
Code block for shell
me@laptop$ command args "more args"
output text from command
though output may be highlighted weirdly
Coloration syntaxiques disponibles
Différentes coloration syntaxiques sont possibles.
Defaut
importjava.io.*;importjava.util.*;publicclassKeyboardIntegerReader{publicstaticvoidmain(String[]args)throwsjava.io.IOException{Strings1;Strings2;intnum=0;// set up the buffered reader to read from the keyboardBufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));booleancont=true;while(cont){System.out.print("Enter an integer:");s1=br.readLine();StringTokenizerst=newStringTokenizer(s1);s2="";while(cont&&st.hasMoreTokens()){try{s2=st.nextToken();num=Integer.parseInt(s2);cont=false;}catch(NumberFormatExceptionn){System.out.println("The value in \""+s2+"\" is not an integer");}}}System.out.println("You entered the integer: "+num);}}
base16
base16-dark
base16-monokai
base16-monokai-light
base16-solarized
base16-solarized-dark
bw
colorful
github
gruvbox
gruvbox-light
igorpro
magritte
molokai
monokai-sublime
monokai
murphy
pastie
prism
thankful-eyes
tulip
Quotes
Here’s a short quotation which is in the middle of a sentence.
This is a long quotation by someone, normal markdown formatting rules apply: strong, em, em, strong em, html bold, code, kbd, samp, ins, del
TWiStErRob
All alerts support markdown and their names are all lowercase, because they’re used as CSS classes, for example TODO is alert todo=. The TODO: prefix is not automatically inserted, it’s for name calling only here.
Alert:
This is like any normal markdown, even when used from non-markdown context: strong, em, em, strong em, html bold, code, kbd, samp, ins, del.
Warning: call out a caveat that’s easy to trigger
This is like any normal markdown, even when used from non-markdown context: strong, em, em, strong em, html bold, code, kbd, samp, ins, del.
Info: supplementary information, for example links to further reading or documentation.
This is like any normal markdown, even when used from non-markdown context: strong, em, em, strong em, html bold, code, kbd, samp, ins, del.
Tip: call out something non-trivial that could help.
This is like any normal markdown, even when used from non-markdown context: strong, em, em, strong em, html bold, code, kbd, samp, ins, del.
Success:
This is like any normal markdown, even when used from non-markdown context: strong, em, em, strong em, html bold, code, kbd, samp, ins, del.
Text:
This is like any normal markdown, even when used from non-markdown context: strong, em, em, strong em, html bold, code, kbd, samp, ins, del.
TODO: reminder to myself that something needs to be done here
This is like any normal markdown, even when used from non-markdown context: strong, em, em, strong em, html bold, code, kbd, samp, ins, del.
Terminal:
This is like any normal markdown, even when used from non-markdown context:
**strong**, *em*, _em_, ***strong em***, html bold, `code`, kbd, samp, ins, del.