doc(using yanr): add doc

This commit is contained in:
Jérémy Dufraisse 2023-05-03 08:32:09 +02:00
parent 46a331a153
commit 3dd3438f44
3 changed files with 58 additions and 25 deletions

26
LISEZMOI.md Normal file
View File

@ -0,0 +1,26 @@
SeaCMS Default Theme
==================
- [English](README.md)
Ce paquet est le thème principal de SeaCMS.
**Attention : le nom SeaCMS va changer car il semble déjà utilisé dans d'autres pays**
## Auteurs
- Jérémy Dufraisse (2022-2023)
- Thatoo (2022-2023)
- Marion Bouder (2022-2023)
- Association Defis (2022-2023)
## Documentation
Quelques brides de documentation sont disponibles dans le fichier [doc/en/dev.md](doc/en/dev.md)
## Licence et garanties
Voir le fichier [LICENCE](./LICENCE) (et sa traduction française [LICENCE_FR](./LICENCE_FR))
**IMPORTANT**: Le fichier LICENCE file ne couvre pas le contenu des dossiers `vendor`. Voir le fichier LICENCE fournis dans chaque sous-dossier concerné par la bibliothèque importée.

View File

@ -1,42 +1,24 @@
SeaCMS Default Theme
==================
- [Français](#Fran%C3%A7ais)
- [English](#English)
## Français
Ce paquet est le thème principal de SeaCMS.
**Attention : le nom SeaCMS va changer car il semble déjà utilisé dans d'autres pays**
### Auteurs
- Jérémy Dufraisse (2022-2023)
- Thatoo (2022-2023)
- Marion Bouder (2022-2023)
- Association Defis (2022-2023)
### Licence et garanties
Voir le fichier [LICENCE](./LICENCE) (et sa traduction française [LICENCE_FR](./LICENCE_FR))
**IMPORTANT**: Le fichier LICENCE file ne couvre pas le contenu des dossiers `vendor`. Voir le fichier LICENCE fournis dans chaque sous-dossier concerné par la bibliothèque importée.
## English
- [Français](LISEZMOI.md)
This package is the main theme of SeaCMS.
**Warning : the name SeaCMS will change because it seems already uses in other countries**
### Authors
## Authors
- Jérémy Dufraisse (2022-2023)
- Thatoo (2022-2023)
- Marion Bouder (2022-2023)
- Association Defis (2022-2023)
### Licence and warranty
## Documentation
Some documentation is available into [doc/en/dev.md](doc/en/dev.md)
## Licence and warranty
See [LICENCE](./LICENCE) file (and french translation [LICENCE_FR](./LICENCE_FR))

25
doc/en/dev.md Normal file
View File

@ -0,0 +1,25 @@
# Documentation on development
## Using `yarn`
[`yarn`](https://yarnpkg.com) is a package manager running on [`nodejs`](https://nodejs.org). It is veru useful to manage `javascript` or `css` projects.
### Adding a new package
1. find the name of the wanted package on the website <https://www.npmjs.com>
2. on command line interface, on the root folder of this project, type `yarn add --dev name-of-the-package`
3. Identify the needed files into folder `node_modules/name-of-the-package` ; most of time, files are into folder `node_modules/name-of-the-package/dist`
4. modifify the file `js/extract-files-from-node-modules` to a new line for each file to import in the theme :
- `copySync('node_modules/name-of-the-package/dist/js/file.min.js','js/vendor/name-of-the-package/file.min.js',{ overwrite: true })` for `javascript` file
- `copySync('node_modules/name-of-the-package/dist/css/file.min.css','css/vendor/name-of-the-package/file.min.css',{ overwrite: true })` for `css` file
- do not forget `LICENCE` file of the package, `copySync('node_modules/name-of-the-package/dist/LICENCE','css/vendor/name-of-the-package/LICENCE',{ overwrite: true })` for `css` (and for `javascript`)
5. type `yarn install` in commpand line interface to start this script
6. add a new line in concerned `twig` file (example : `includes/_head.twig`) to use the new file (example : `<link href="{{ theme_url }}/css/vendor/name-of-the-package/file.min.css" rel="stylesheet" type="text/css" />`)
### Removing a new package
1. find the name of the wanted package into file `package.json`
2. on command line interface, on the root folder of this project, type `yarn remove name-of-the-package`
3. Identify the associated files into folders `js/vendor` and `css/vendor` and delete them
4. modifify the file `js/extract-files-from-node-modules` to remove lines related to this package
5. remove line in concerned `twig` file (example : `includes/_head.twig`) that uses the new file (example : `<link href="{{ theme_url }}/css/vendor/name-of-the-package/file.min.css" rel="stylesheet" type="text/css" />`)