What & How & Why

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
other:server:apache:rewirte [2016/09/25 15:04] haregyother:server:apache:rewirte [2018/09/24 15:30] (当前版本) – 外部编辑 127.0.0.1
行 1: 行 1:
 ====rewrite ==== ====rewrite ====
 +
 +<pre><samp>You are in an open field west of a big white house with a boarded
 +front door.
 +There is a small mailbox here.
 +
 +></samp> <kbd>open mailbox</kbd>
 +
 +<samp>Opening the mailbox reveals:
 +A leaflet.
 +
 +></samp></pre>
 +
  
 <sxh apache round 11-15> <sxh apache round 11-15>
行 38: 行 50:
     transform: translateY(-50%);     transform: translateY(-50%);
 } }
 +</sxh>
 +<sxh php>
 +    /**
 +     * Render xhtml output or metadata
 +     *
 +     * @param string         $mode      Renderer mode (supported modes: xhtml)
 +     * @param Doku_Renderer  $renderer  The renderer
 +     * @param array          $data      The data from the handler() function
 +     * @return bool If rendering was successful.
 +     */
 +    public function render($mode, Doku_Renderer &$renderer, $data) {
 +        if($mode != 'xhtml') return false;
 +
 +        if (count($data) != 3) {
 +            return true;
 +        }
 +
 +        list($syntax, $attr, $content) = $data;
 +        if ($syntax == 'sxh') {
 +            $title = $this->procTitle($attr);
 +            $highlight = $this->procHighlight($attr);
 +            $renderer->doc .= '<pre class="brush: ' . strtolower($attr . $highlight) . '"' . $title . '>' . $renderer->_xmlEntities($content) . '</pre>';
 +        } else {
 +            $renderer->file($content);
 +        }
 +
 +        return true;
 +    }
 +</sxh>
 +<sxh glsl>
 +varying vec3 normal;
 +varying vec3 vertex_to_light_vector;
 + 
 +void main()
 +{
 +    // Defining The Material Colors
 +    const vec4 AmbientColor = vec4(0.1, 0.0, 0.0, 1.0);
 +    const vec4 DiffuseColor = vec4(1.0, 0.0, 0.0, 1.0);
 + 
 +    // Scaling The Input Vector To Length 1
 +    vec3 normalized_normal = normalize(normal);
 +    vec3 normalized_vertex_to_light_vector = normalize(vertex_to_light_vector);
 + 
 +    // Calculating The Diffuse Term And Clamping It To [0;1]
 +    float DiffuseTerm = clamp(dot(normal, vertex_to_light_vector), 0.0, 1.0);
 + 
 +    // Calculating The Final Color
 +    gl_FragColor = AmbientColor + DiffuseColor * DiffuseTerm;
 +}
 +</sxh>
 +<sxh bash>
 +#!/bin/bash
 +
 +echo "hello bash"
 +
 +exit 0
 </sxh> </sxh>