Skip to content

Commit

Permalink
fixed documentations
Browse files Browse the repository at this point in the history
```
  • Loading branch information
obervinov committed Jan 29, 2024
1 parent c057c27 commit 95400ae
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 31 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).


## v1.0.3 - 2024-01-29
### What's Changed
**full changelog**: https://github.com/obervinov/messages-package/compare/v1.0.2...v1.0.3 by @ obervinov https://github.com/obervinov/messages-package/pull/
#### 🐛 Bug Fixes
* [Fix typos in README.md](https://github.com/obervinov/messages-package/issues/20)


## v1.0.2 - 2024-01-24
### What's Changed
**full changelog**: https://github.com/obervinov/messages-package/compare/v1.0.1...v1.0.2 by @ obervinov https://github.com/obervinov/messages-package/pull/19
Expand Down
36 changes: 27 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This package helps to easily and quickly generate beautiful messages for telegra
## <img src="https://github.com/obervinov/_templates/blob/v1.0.5/icons/build.png" width="25" title="build"> Environment variables
| Variable | Description | Default value |
| ------------- | ------------- | ------------- |
| `MESSAGES_CONFIG` | Json file with templates for rendering messages. (Example)[tests/configs/messages.json] | `configs/messages.json` |
| `MESSAGES_CONFIG` | Json file with templates for rendering messages. [Example](tests/configs/messages.json) | `configs/messages.json` |


## <img src="https://github.com/obervinov/_templates/blob/main/icons/stack2.png" width="20" title="install"> Installing with Poetry
Expand All @@ -38,7 +38,7 @@ version = "1.0.0"
[tool.poetry.dependencies]
python = "^3.10"
messages = { git = "https://github.com/obervinov/messages-package.git", tag = "v1.0.1" }
messages = { git = "https://github.com/obervinov/messages-package.git", tag = "v1.0.3" }
[build-system]
requires = ["poetry-core"]
Expand All @@ -54,7 +54,14 @@ poetry install
- all emojis should be wrapped in `:`
- all variables must be specified in the same form as in your code
```json
{ "templates": {"hello_message": {"text": "Hi, <b>{0}</b>! {1}\nAccess for your account - allowed {2}", "args": ["username", ":raised_hand:", ":unlocked:"]}}}
{
"templates": {
"hello_message": {
"text": "Hi, <b>{0}</b>! {1}\nAccess for your account - allowed {2}",
"args": ["username", ":raised_hand:", ":unlocked:"]
}
}
}
```

```python
Expand Down Expand Up @@ -84,7 +91,14 @@ Access for your account - allowed 🔓
- all emojis should be wrapped in `:`
- all variables must be specified in the same form as in your code
```json
{"templates": {"progressbar_message": {"text": "{0} Messages from the queue have already been processed", "args": [":framed_picture:", "progressbar"]}}
{
"templates": {
"queue_message": {
"text": "{0} Messages from the queue have already been processed\n{1}",
"args": [":framed_picture:", "progressbar"]
}
}
}
```

```python
Expand All @@ -94,16 +108,20 @@ from messages import Messages
# Create instance
messages = Messages()

# Rendering and getting messages
# Render and get messages with progress bar
print(
messages.render_progressbar(
total_count=100,
current_count=19
messages.render_template(
template_alias='queue_message',
progressbar=messages.render_progressbar(
total_count=100,
current_count=19
)
)
)
```

_output result_
```python
[◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️]19%🔓
🏞 Messages from the queue have already been processed
[◾◾◾◾◾◾◾◾◾◾◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️]19%
```
20 changes: 0 additions & 20 deletions poetry.lock

This file was deleted.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "messages"
version = "1.0.2"
version = "1.0.3"
description = "This package helps to easily and quickly generate beautiful messages for telegram bots using templates described in json."
authors = ["Bervinov Oleg <obervinov@pm.me>"]
maintainers = ["Bervinov Oleg <obervinov@pm.me>"]
Expand All @@ -18,7 +18,7 @@ include = ["CHANGELOG.md"]

[tool.poetry.dependencies]
python = "^3.10"
emoji = "^2.10.0"
emoji = "^2"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 95400ae

Please sign in to comment.