![]() |
|
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
MIVA® SNIPPETS: Miva/HTML Code Viewer
If you want to publish the source code of a MIVA Script or an HTML page, use the following snippet:
Or use the following function to display code from within another page/script:
NOTE: the file should be in the Miva data directory. Use sfcopy() to move it there. Source viewer with syntax coloringMore advanced (but slower) function to display source code uses MvCALL and therefore it can show source of any document on the web. Miva tags, of course, can be displayed only if the server does not parse them. It means - if you want to publish code of a Miva script, you have to save it with such extension that is not parsed by Miva Empresa (e.g. script.txt instead of script.mv) Have a look at the source of the function Advanced function with partially implemented syntax checkerYou can edit the style sheet to customize the colors and you can add more code to distinguish other tags or identifiers with different styles. Or change the CSS CLASS to older (but longer) FONT tags if you want to support older browsers. Color styling can be also use for easier searching of syntax errors. With some modifications a syntax checker could be made. Unfortunately using MvCALL is not only slower, but it has also some limitations because MvCALL parses the remote document and may mess it up. The following script tries to fix some of such problems and partially implements a spell checker. For example if you move the mouse over some tags, the level of nesting should be displayed under your cursor. More features may be implemented later. TEST IT ! Submit an URL to display its sourceNOTE: MvCALL can screw up some tags or even whole documents! Normally you cannot view the source of Miva scripts. You will see just the source of the resulting HTML page. It is possible only if the author let a renamed (non-parsed) copy of the script on the server (e.g. script.mv renamed to script.txt) |
||||||||||
|
Miva and some other terms used on this page are registerd trademarks of the Miva Corporation |