在代码编辑器中打开` for title,link in string.gmatch(code,"!\N\s*\s*(\N+?)<<:>|\:>?\s+?(||\://[^\s()]+)") { if(string.find(title,":") && !string.find(title,"\a\.\a\w+\(") && !string.indexOf(title,"//")){ title = string.match(title,"《\s*(.+)\s*》") || title; htmlBody = htmlBody ++ ` | `+title+`` } } for title,link in string.gmatch(code,"!\N\s*?!(\N+?)<<:>|\:>?\s+(||\://[^\s()]+)") { if(string.find(title,":" )&& !string.find(title,"\a\.\a\w+\(") && !string.indexOf(title,"//") ){ title = string.match(title,"《\s*(.+)\s*》") || title; htmlBody = htmlBody ++ ` | `+title+`` } } htmlBody = htmlBody ++ markdown.renderCode(code,"aardio"); } } else { var md = string.load(request.path); //doc://library-guide/builtin/io/io.file.html if(!md){ htmlBody = "找不到文件:" + request.path; } else{ htmlTitle = string.match(md,"\n\s*\#\s+(\N+)") || string.match(md,"\n\s*\#\#\s+(\N+)") || "aardio 文档" ; htmlBody = markdown.render(md); } } } elseif( string.startsWith(request.path,"/example/") ){ htmlTitle = "范例" var code = string.load("~"+request.path ); if(code){ code = ..string.replace(code,"@@file://~/example/","doc://example/"); htmlBody = `在代码编辑器中打开` for title,link in string.gmatch(code,"!\N\s*\s*(\N+?)<<:>|\:>?\s+?(||\://[^\s()]+)") { if(string.find(title,":") && !string.find(title,"\a\.\a\w+\(") && !string.indexOf(title,"//") ){ title = string.match(title,"《\s*(.+)\s*》") || title; htmlBody = htmlBody ++ ` | `+title+`` } } for title,link in string.gmatch(code,"!\N\s*?!(\N+?)<<:>|\:>?\s+(||\://[^\s()]+)") { if(string.find(title,":") && !string.find(title,"\a\.\a\w+\(") && !string.indexOf(title,"//") ){ title = string.match(title,"《\s*(.+)\s*》") || title; htmlBody = htmlBody ++ ` | `+title+`` } } htmlBody = htmlBody ++ markdown.renderCode(code,"aardio"); } } htmlBody = string.replace(htmlBody ,"\(<@@Ctrl@>|<@@Shift@>|<@@Alt@>||<[Ff]\d>!\W.*?)\" ,function(kbd){ var items = string.splitEx(kbd,"\s*\+\s*"); for(i,v in items){ items[i] = ""+v+"" } return string.join(items,"+"); } ) if(request.path == "/guide/ide/ai.md"){ var js = /**** ****/ htmlBody = string.replace(htmlBody,"@

AI 编程指南

",`

AARDIO 编程指南

`); htmlBody = htmlBody ++ js; } ?> aardio 编程语言文档 - <?=htmlTitle?>