implemented edurl and viewurl helpers
This commit is contained in:
@@ -217,9 +217,14 @@ A simple line-oriented text editor and page-oriented text viewer for MicroPython
|
||||
|
||||
Exports the following functions:
|
||||
|
||||
- `edit(filename)`: start an `ed`-like text editor (see below)
|
||||
- `edbuf()`: create an empty buffer, run the editor interface on it and return the result as a string (without creating any files)
|
||||
- `edit(filename)`: start an `ed`-like text editor on a file (see below)
|
||||
- `edbuf(bufstr='')`: create an empty buffer, fill it with the input string (if any), run the editor interface on it and return the result as a string (without creating any files)
|
||||
- `edurl(url)`: download the URL contents via HTTP, run the editor interface on it and return the result as a string (without creating any files)
|
||||
- `view(filename, lno=False)`: start a `more`-like pager for viewing a text file (pass an additional parameter to view it with line numbers)
|
||||
- `viewbuf(text, lno=False)`: same as `view` but for string variables instead of files
|
||||
- `viewurl(url, lno=False)`: download the URL contents via HTTP and run `viewbuf` method on the result
|
||||
|
||||
Note: with `edbuf` and `edurl` methods, you can always save the file locally while inside the editor interface. Use the `f` command to specify the name (see below).
|
||||
|
||||
The editor mode supports the following subset of POSIX ed commands in the standard `[range][command][param]` syntax:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user