Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: Rewrite from PHP to Python
- Loading branch information
Showing
53 changed files
with
1,893 additions
and
2,553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
images/ | ||
geany_run_script.sh | ||
.httmp | ||
.shaarli.opml | ||
images.json | ||
# Files | ||
.coverage | ||
|
||
# Folders | ||
data/ | ||
sync.sh | ||
test.php | ||
.mypy_cache/ | ||
__pycache__/ | ||
.pytest_cache/ | ||
venv/ | ||
|
||
# Keep those | ||
!tests/data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,77 @@ | ||
ShaarlImages | ||
=== | ||
# Shaarlimages | ||
|
||
Shaarlimages, la galerie des shaarlis ! | ||
|
||
Démo : [shaarlimages.net](http://shaarlimages.net) | ||
URL : [shaarlimages.net](https://shaarlimages.net) | ||
|
||
Informations | ||
--- | ||
## Production | ||
|
||
Copy all files from the `host` folder to the [PythonAnywhere](https://www.pythonanywhere.com) hosting account. | ||
|
||
Details: | ||
- Python version: `3.10` | ||
- Force HTTPS: enabled | ||
- Web app type: Bottle | ||
|
||
Check [Batteries Included](https://www.pythonanywhere.com/batteries_included/) to know what modules are already provided. | ||
|
||
## Development | ||
|
||
### Installation | ||
|
||
```console | ||
$ python3.10 -m venv venv | ||
$ . venv/bin/activate | ||
$ python -m pip install -U pip | ||
$ python -m pip install -r requirements-dev.txt | ||
``` | ||
|
||
### Quality | ||
|
||
```console | ||
$ ./checks.sh | ||
``` | ||
|
||
### Tests | ||
|
||
```console | ||
$ python -m pytest --doctest-modules host tests | ||
``` | ||
|
||
### Local Server | ||
|
||
```console | ||
$ python server.py | ||
``` | ||
|
||
-- | ||
|
||
### Informations | ||
|
||
Suite à [cette requête](http://sebsauvage.net/paste/?b1176a415f9bbe17#CIT+sEj+1tsMW8IAWBipoVJiNBcgLt81Gm79rxuiVnU). | ||
Cette galerie s'inspire honteusement de [celle-ci](http://www.chromatic.io/FQrLQsb), et repose | ||
sur le principe de [partition linéaire](http://www.crispymtn.com/stories/the-algorithm-for-a-perfectly-balanced-photo-gallery) (pas de perte d'espace). | ||
Le code javascript a été largement inspiré par celui de [jakobholmelund / fitpicsjs](https://github.com/jakobholmelund/fitpicsjs), | ||
amélioré et porté en javascript natif (plus besoin de grosses bibliothèques telles que jQuery, Prototype, ...). | ||
|
||
|
||
Ajouter un shaarli | ||
--- | ||
### Ajouter un shaarli | ||
|
||
J'utilise la liste d'export de [shaarli.fr](http://shaarli.fr/opml?mod=opml), donc il vous suffira d'être ajouté sur ce site pour que vous soyez pris en compte. | ||
|
||
|
||
Améliorations possibles | ||
--- | ||
### Améliorations possibles | ||
|
||
Dans l'immédiat, la couleur de fond pour chaque image est calculée (couleur moyenne dominante) et une image est ajoutée par dessus pour le grain. Bien que ça rende pas trop mal, il faudrait revoir le mécanisme pour se rapprocher un peu plus de [cette galerie](http://www.chromatic.io/FQrLQsb). | ||
Pour le reste, libre à vous de forker, bidouiller et proposer des patches ;) | ||
|
||
Pré-requis | ||
--- | ||
|
||
Pour auto-héberger une galerie, en l'état, il vous faudra PHP, la bibliothèque GD et cURL. | ||
|
||
Détails techniques | ||
--- | ||
### Détails techniques | ||
|
||
Reportez-vous au dépôt [Galinear](https://github.com/BoboTiG/galinear) pour plus d'informations. Il s'agit du système de la galerie seul, plus facile pour bidouiller. | ||
|
||
Remerciements | ||
--- | ||
### Remerciements | ||
|
||
Séb pour avoir mis au point [shaarli ;](http://sebsauvage.net/wiki/doku.php?id=php:shaarli) | ||
Bronco pour l'inspiration ([feed2array](http://www.warriordudimanche.net/article178/feed2array-obtenir-un-flux-rss-atom-sous-forme-de-tableau)) ; | ||
Jakob Holmelund pour la [base javascript](https://github.com/jakobholmelund/fitpicsjs) de la partition linéaire ; | ||
Chromatic.io pour l'[inspiration](http://www.chromatic.io/FQrLQsb) ; | ||
Et tous les contributeurs et testeurs de l'ombre :) | ||
- Séb pour avoir mis au point [shaarli ;](http://sebsauvage.net/wiki/doku.php?id=php:shaarli) | ||
- Bronco pour l'inspiration ([feed2array](http://www.warriordudimanche.net/article178/feed2array-obtenir-un-flux-rss-atom-sous-forme-de-tableau)) ; | ||
- Jakob Holmelund pour la [base javascript](https://github.com/jakobholmelund/fitpicsjs) de la partition linéaire ; | ||
- Chromatic.io pour l'[inspiration](http://www.chromatic.io/FQrLQsb) ; | ||
- Et tous les contributeurs et testeurs de l'ombre :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
|
||
[ ] Mise en cache des recherches | ||
[ ] Pagination en JS (pour ne plus avoir à recharger images.json) | ||
[ ] Ne charger les images que lorsqu'elles sont dans la zone visible de l'écran | ||
|
||
D'autres idées d'amélioration ? | ||
- [ ] Mise en cache des recherches |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.