Wiki and shell#
Shell script/command is a bit like a wiki plugin. A console with history is a bit like a long web page. A wiki page could be a sequence of command, output. Or each command output goes in separate page and a session history shows the N latest subpages. Command line output has markup: return, tab, colors. A regular VT is needed to use VI or other fullscreen programs. I need more markup otherwise it's not worth the overhead of the webpage/wiki. Possibilities:
- recognise certain data forms, add markup (e.g. http, mailto, date)
- recognize command or wrap command with dedicated filter that adds markup
- allow new commands to add markup in their output
Ideas for markup#
- makes table a table
- add links to documentation
- add links that execute a command in the current shell)
- add image (e.g. Gnuplot output)
- add tag that tells JSPWiki to use a plugin (e.g. JfreeChart around some data).
- add menu of contextual actions
- add anchors that can be used to reuse output into new shell commands. Scenarios:
- click on prompt showing path, choose ls
- type lsof, output is decorated, pids show a menu of actions (pargs, stack, pwdx...)
- file prettifier annotates documentation with doc links etc.
- script displays information with local links and certain information as popups, linked pages
Bad scenarios#
- How to handle tail?
- ls -l on big directory is useless, big, pollutes search results, how to get rid of it?
- vi and other interactive programs don't mix well
Terminal Emulation in JavaScript#
Several terminal emulators are available which could be modified to enhance the text they display and or redirect it to web services.<html> <head> <title>Anyterm</title> <script type="text/javascript" src="anyterm.js"> </script> <script type="text/javascript"> window.onload=function() { create_term("term1","%h (Anyterm%v)",25,80,"","",50); }; var on_close_goto_url = ""; </script> <link rel="stylesheet" type="text/css" href="anyterm.css"> </head> <body> <div id="term1"></div> </body> </html>
The JavaScript terminal even handles applications like top nicely:
Writing to a wiki from the shell#
If we have FUSE and a filesystem view of the wiki then it's easy to write to a wiki from the shell. But one is not always root and some systems don't have fuse. So another idea would be to create a couple of commands that access a wiki and use environment variables.
Ideally curl would be used but authentication is not always easy. So it might be necessary to use a Java/XMLRPC API to acces the wikis:
- WikiAPI
- A REST API would be nice to update pages (cf. WikiWiki#Eliminate Ugly URLs and Modal Views
Add new attachment
List of attachments
Kind | Attachment Name | Size | Version | Date Modified | Author | Change note |
---|---|---|---|---|---|---|
png |
anyterm.png | 123.3 kB | 1 | 04-Aug-2010 20:36 | scott |