drop gemtext features (use gemtext-php library)

This commit is contained in:
yggverse 2024-06-26 20:01:35 +03:00
parent 3ee5de206f
commit 325ac1eb8c
3 changed files with 0 additions and 406 deletions

102
README.md
View file

@ -109,108 +109,6 @@ var_dump(
);
```
## Gemtext
Object-oriented API for Gemtext
**Deprecated and will be removed in future releases! Use [gemtext-php](https://github.com/YGGverse/gemtext-php) instead.**
### Body
Basic methods to work with `text/gemini` documents
``` php
$body = new \Yggverse\Gemini\Gemtext\Body(
$response->getBody() // gemtext body from client response or .gmi file content
);
```
#### Body::getLines
#### Body::getLine
#### Body::getH1
#### Body::getH2
#### Body::getH3
#### Body::getQuote
#### Body::getCode
#### Body::getLinks
``` php
var_dump(
$body->getLinks() // returns array of links (with line number in key)
);
```
#### Body::findLinks
Find context links by protocol as argument, `gemini` by default
``` php
var_dump(
$body->findLinks('http') // returns array of http links only (with line number in key)
);
```
#### Body::skipTags
Strip gemini tags from Gemini document
``` php
var_dump(
$body->skipTags() // strip all tags
);
var_dump(
$body->skipTags(
[ // 1- and 2- level headers only
"##",
"###"
]
)
);
```
### Link
Inline links parser.
Allows to extract address, date with timestamp and alt text from link line given
``` php
foreach ($body->getLinks() as $line)
{
$link = new \Yggverse\Gemini\Gemtext\Link(
$line
);
var_dump(
$link->getAddress()
);
var_dump(
$link->getAlt()
);
}
```
#### Link::getAddress
#### Link::getDate
This method also validates time format and returns the unix timestamp as linked argument
``` php
var_dump(
$link->getDate(
$timestamp // get unix time from this variable
)
);
var_dump(
$timestamp
);
```
#### Link::getAlt
## GTK3
### Pango