iijs文档(待完善)


本演示站首页由解析README.md文档后,配合模板生成,控制器代码:


    async index() {
        let readme = await this.view.load('README.md');
        readme = this.view.md.toHTML(readme);
        readme = readme.replace('</p>', '</p><hr>');
        readme = readme.replace(/<p><code>/g, '<pre><code>');
        readme = readme.replace(/<\/code><\/p>/g, '</code></pre>');
        this.assign('title', 'iijs - 一个简单轻量级Node.js MVC框架');
        this.assign('readme', readme);
        await this.fetch();
    }
    

本文档页由解析模板生成,控制器代码:


    async doc() {
        this.assign('title', 'iijs文档手册 - iijs');
        await this.fetch();
    }
    

hello页为内容直接输出,控制器代码:


    async hello() {
        this.display(`<div style="font-size:50px;">hello iijs, hello world !</div>`);
    }