screenshot:
Code: Select all
Text$ = "<link href=https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/themes/prism.css rel=stylesheet />" + "<STYLE>body {font-size:18px;}</STYLE>"
Text$ + "<script src=https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/prism.js></script><pre><code class='special language-html'></code></pre>"
HtmlFile$ = #PB_Compiler_Home + "\Examples\Sources - Advanced\Atomic Web Server\WWW\Index.html"
ReadFile(1, HtmlFile$) : Text2$ = ReadString(1, #PB_File_IgnoreEOL)
Text2$ = ReplaceString(text2$, "<", "<")
Text2$ = ReplaceString(text2$, ">", ">")
Text$ = ReplaceString(text$, "</code>", Text2$ + "</code>")
OpenWindow(0, 30, 30, 840+40, 450, "view-source:"+GetFilePart(HtmlFile$), #PB_Window_SystemMenu )
WebGadget (0, 0, 0, WindowWidth(0), WindowHeight(0), "")
SetGadgetItemText(0, #PB_Web_HtmlCode, "<meta http-equiv='X-UA-Compatible' content='IE=edge' /> <BODY> " + Text$ )
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow