/** * Generate the documentation site-map. * @param string $links menu of links to show. * @param string $docsroot file path of the root of the docs. * @param string $docsurl base URL for the docs. * @return string HTML page body. */ function stack_docs_site_map($links, $docsroot, $docsurl) { $body = ''; $body .= $links; $body .= '<h3>' . stack_string('stackDoc_directoryStructure', 'stack') . '</h3>'; $body .= stack_docs_index($docsroot, $docsurl); return $body; }
public function test_stack_docs_index() { global $CFG; $this->assertEquals(str_replace('WWWROOT', $CFG->wwwroot, '<ul class="dir">' . '<li><a href="http://www.example.com/moodle/question/type/stack/doc.php/Installation/Mathjax.md">' . 'Mathjax</a></li>' . '<li><a href="http://www.example.com/moodle/question/type/stack/doc.php/Installation/Maxima.md">Maxima</a></li>' . '<li><a href="WWWROOT/question/type/stack/doc.php/Installation/Testing_installation.md">' . 'Testing installation</a></li></ul>'), stack_docs_index($CFG->dirroot . '/question/type/stack/doc/en/Installation', $CFG->wwwroot . '/question/type/stack/doc.php/Installation')); $this->assertEquals(str_replace('WWWROOT', $CFG->wwwroot, '<ul class="dir">' . '<li><a href="WWWROOT/question/type/stack/doc.php/Students/Accessibility.md">Accessibility</a></li>' . '<li><a href="WWWROOT/question/type/stack/doc.php/Students/Answer_assessment.md">Answer assessment</a></li>' . '<li><a href="WWWROOT/question/type/stack/doc.php/Students/Answer_input.md">Answer input</a></li>' . '<li><a href="WWWROOT/question/type/stack/doc.php/Students/FAQ.md">FAQ</a></li></ul>'), stack_docs_index($CFG->dirroot . '/question/type/stack/doc/en/Students', $CFG->wwwroot . '/question/type/stack/doc.php/Students')); }