Term - terminal web browser
Term is terminal-based web browser that only accepts files using the Term File Format. This browser is responsive to youtr terminal's sizing and is developer-focused. This browser will not render HTML or execute JavaScript. It does, however, implement a similar DOM model, and styling attributes are similar to CSS.
Using the browser
Install using this command:
pip3 install termbrowser
and start using this command:
term
or manually:
python3 -m termbrowser
Open links using their hotkeys ex. 1 for [1] Link Name
Press Escape twice to change the URL to load Press Tab to cycle focus of input fields Press Enter to submit an input field Press Alt(or Option) + Q to unfocus from an input field
Important Note
Term Browser sends requests using the header Content-Type: Term. Your web server can distiguish that the request is coming from the Term Browser through this header.
File Format
Term File Format files are read line by line. The first line of any term file declares the term version to be used. Ex:
@termtype:m100
The # character at the start of a line is used for commenting
# this is a comment!
Elements
There are currently 5 element types. cont, text, link, input, and action
Declare an element like so
cont
end
Inside of that element, you can place attributes
cont
-width: 10
-height: 5
-border: line
end
A cont (container) is similar to a <div> in HTML
To specify an element's value, use :
text:Hello World!
end
# Note any spacing after the `:` is recorded ('text: Hello World!' returns a value of ' Hello World!')
A text element is similar to a <p> element in HTML
Input fields can be created like so:
input
-submit: my-action
end
Actions
Actions are blocks of code that you can write in a term file to provide interactivity to it's elements
To declare an action, use
action: my-action (
)
Values are passed to an action code block through a variable named value
input
-submit: my-action
end
action: my-action (
visit("http://localhost/hello?world=" + value)
)
Scripting
The code executed in an action block is not of any specification or language, but is evaluated through SimpleEval.
See the scripting page.
Attributes
Attributes for cont include width, height, border, direction, and padding.
Attributes for text include initial, align, and style
Attributes for link include url, align, and style
Attributes for input include submit, width, height, and padding
All elements accept a name property, which gives the actions of the page access to it's attributes and value. Accessing by name returns the first element in-order of the tree with that name.
Responsiveness
Attributes that take in a mathematic value (like padding and width), can also use a percetange of the screen width or height using the pc keyword.
# A container that will take up half of the screen width
cont
-border: line
-width: 50pc
end
Credits
Term was created by Martin Darazs
License
MIT License
Metadata
Release files for termbrowser 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| termbrowser-0.1.7.tar.gz | 13.2 kB | Without provenance | Details for termbrowser-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| termbrowser-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for termbrowser-0.1.7-py3-none-any.whl |
Total release size: 32.8 kB
Release files / termbrowser-0.1.7.tar.gz
| Download URL | termbrowser-0.1.7.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d591f74805cee6b864f71402f919fccaaac5c28fefc7184b54ead5cda2926b3d
|
|
BLAKE2b-256 checksum How to use checksums |
add88432a8879f1f949573b2e3c671d84083029554dbbad07abd0bc77049dfac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / termbrowser-0.1.7-py3-none-any.whl
| Download URL | termbrowser-0.1.7-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
217bb00282716aac1156a4f4e2bb1513abadc18f2e8262aebaea2e3741b9a477
|
|
BLAKE2b-256 checksum How to use checksums |
7b06309f8ded280b51fd224800d18f1cd4a28e9338e3214c3b4a402d7b2c67f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Security for termbrowser 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.