WikiGrammarGuide
(以“=语法高亮= <pre class="brush:html"> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>HTML 范例</title> </head> <body> <h1>Hello,Mediaw...”为内容创建页面) |
|||
第1行: | 第1行: | ||
=语法高亮= | =语法高亮= | ||
+ | |||
+ | <div class="code_type">HTML</div> | ||
<pre class="brush:html"> | <pre class="brush:html"> | ||
<!DOCTYPE html> | <!DOCTYPE html> | ||
第12行: | 第14行: | ||
</body> | </body> | ||
</html> | </html> | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | <div class="code_type">Javascript</div> | ||
+ | <pre class="brush:js"> | ||
+ | function add(a, b){ | ||
+ | return a + b; | ||
+ | } | ||
+ | add(3, 5); | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | <div class="code_type">Linux Shell</div> | ||
+ | <pre class="brush:bash"> | ||
+ | mkdir /home/path1 | ||
+ | ls -al /var | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | <div class="code_type">PHP</div> | ||
+ | <pre class="brush:php"> | ||
+ | <?php | ||
+ | session_start(); | ||
+ | |||
+ | ini_set('display_errors', true); | ||
+ | error_reporting(E_ALL); | ||
+ | |||
+ | include_once('phpsdk/config.php'); | ||
+ | include_once('phpsdk/saetv2.ex.class.php'); | ||
+ | include_once('Mobile_Detect/Mobile_Detect.php'); | ||
+ | |||
+ | $o = new SaeTOAuthV2( WB_AKEY , WB_SKEY ); | ||
+ | $access_token = ""; | ||
+ | $token = ""; | ||
+ | |||
+ | // 解析应用框架传过来的 access_token | ||
+ | try{ | ||
+ | $appkey = WB_AKEY; | ||
+ | $signed = $_POST["signed_request"]; | ||
+ | if(isset($signed)){ | ||
+ | $oauth = $o->parseSignedRequest( $signed ); | ||
+ | if(isset($oauth["oauth_token"])){ | ||
+ | $access_token = $oauth["oauth_token"]; | ||
+ | // 对 access_token 进行 MD5 运算 | ||
+ | $token = md5(WB_SKEY . "_" . $access_token); | ||
+ | } | ||
+ | } else { | ||
+ | $code_url = $o->getAuthorizeURL(WB_CALLBACK_URL); | ||
+ | } | ||
+ | |||
+ | }catch(Exception $e){} | ||
+ | </pre> | ||
+ | |||
+ | <pre> | ||
+ | // 这段代码没有指定任何语言 | ||
+ | if(scope.$isLogin()){ | ||
+ | return true; | ||
+ | } else { | ||
+ | $.common.login.login.showLoginLayer({ | ||
+ | success: function() { | ||
+ | feedback.check(); | ||
+ | $.common.wiki.reloadTop(); | ||
+ | } | ||
+ | }); | ||
+ | return fasle; | ||
+ | } | ||
</pre> | </pre> |
2014年7月11日 (五) 11:32的最后版本
语法高亮
HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>HTML 范例</title> </head> <body> <h1>Hello,Mediawiki</h1> </body> </html>
Javascript
function add(a, b){ return a + b; } add(3, 5);
Linux Shell
mkdir /home/path1 ls -al /var
PHP
<?php session_start(); ini_set('display_errors', true); error_reporting(E_ALL); include_once('phpsdk/config.php'); include_once('phpsdk/saetv2.ex.class.php'); include_once('Mobile_Detect/Mobile_Detect.php'); $o = new SaeTOAuthV2( WB_AKEY , WB_SKEY ); $access_token = ""; $token = ""; // 解析应用框架传过来的 access_token try{ $appkey = WB_AKEY; $signed = $_POST["signed_request"]; if(isset($signed)){ $oauth = $o->parseSignedRequest( $signed ); if(isset($oauth["oauth_token"])){ $access_token = $oauth["oauth_token"]; // 对 access_token 进行 MD5 运算 $token = md5(WB_SKEY . "_" . $access_token); } } else { $code_url = $o->getAuthorizeURL(WB_CALLBACK_URL); } }catch(Exception $e){}
// 这段代码没有指定任何语言 if(scope.$isLogin()){ return true; } else { $.common.login.login.showLoginLayer({ success: function() { feedback.check(); $.common.wiki.reloadTop(); } }); return fasle; }
文档更新时间: 2014-07-11