User Tools

Site Tools


format_code

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
format_code [2016/08/28 22:35] adminformat_code [Unknown date] (current) – external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
 [[resource]] [[resource]]
  
-<code php> +Often time, you will need to post a code here to for share. Here is how you can do it.
-if (!$lang) $lang = NULL; +
-// add one line +
-if (!trim($title) && $lang) $title = "Language: $lang"; +
-// end addition +
-} else {}+
  
 +''%%<code lang | title> some code </code>%%'' 
 +
 +Here is an example. 
 +
 +<code python | code.py>
 +def function(){
 +   print "hello, world!"
 +}
 </code>  </code> 
  
 +Here is the source line:
  
-<code python | good.py>+''%%<code python | code.py>
 def function(){ def function(){
- print "hello"+   print "hello, world!"
 } }
 +</code> %%''
 +
 +
 +If you want to disable the download,
 +''%%<code lang> some code </code>%%''
 +
 +
 +<code python>
 +def function2(){
 +   print "hello, python!"
 +}
 +</code>
 +
 +Here is the source line:
 +
 +''%%<code python>
 +def function2(){
 +   print "hello, python!"
 +}
 +</code>%%''
 +
 +For a very simple commend, try ''%%''code piece''%%''
 +
 +The advantage of using this is that you can include it in the sentence.  
 +
  
-</code>  
format_code.1472438157.txt.gz · Last modified: 2016/08/28 21:35 (external edit)