Terminal web browser.
Project description
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
Start term using this command in the downloaded directory:
python3 -m term
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
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
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.
Attributes
Attributes for cont include width, height, border, direction, and padding.
Attributes for text include align, and style
Attributes for link include url, align, and style
Attributes for input include submit, width, height, and padding
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file termbrowser-0.1.2.tar.gz.
File metadata
- Download URL: termbrowser-0.1.2.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
439325b585a51ebde4b51863e7aa3238966ec60b4493b23e39775fc61821e2d4
|
|
| MD5 |
a8a23940af88272bd5676d7d53d8ed6e
|
|
| BLAKE2b-256 |
f92de296a061458decbfdf90b8fe19a4c65e332c40fabc539b83fbbd7248dbd5
|
File details
Details for the file termbrowser-0.1.2-py3-none-any.whl.
File metadata
- Download URL: termbrowser-0.1.2-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33656a54c4ef8635856d216bf80d43c99b822e397d2a577dc93760d2c48fe1ad
|
|
| MD5 |
6a985de3a6d28d0a574a6c875a76ca53
|
|
| BLAKE2b-256 |
4551fbcda560997cf8e1a2876b333aa6722045195a78d7c51a534dceb331d2cf
|