diff --git a/README-english.md b/README-english.md new file mode 100644 index 0000000..e2c2d9d --- /dev/null +++ b/README-english.md @@ -0,0 +1,299 @@ +# GSL: Statique Littérateur +------------------------------------------------------------------------ + +GSL is a multiple blogs/websites generator based on their domain, +written in bash, for minimal dependancies. The websites are nearly all +static, except for some includes pages, like listing posts, that nginx +can easily get, in your webserver. + +# Dependancies +------------------------------------------------------------------------ + +- bash +- coreutils +- curl (to check Posts links response) +- rsync + + +# GSL: Installation +------------------------------------------------------------------------ +In your System / +``` +git clone URL . +``` + +GSL does NOT use any sudo. To avoid errors, you must give permissions +to USER with chown -R to folders. + +## --Prefix for DOMAIN configuration (set according to user choice): +- HOME: ~/.config/gsl +- GLOBAL: /var/lib/gsl +- Folder: --Prefix/domains/ (created with $ gsl new) + +### DOMAIN Datas from Prefix: +- Folder: --Prefix/DOMAIN/ (Created by GSL) +- - Files: DOMAIN.conf, authors.db (Created by GSL) +- - Folder: --Prefix/DOMAIN/templates/ (css, logos...) (Created by GSL) + +## Destination Folder: /etc/gsl/ +- File: gsl.conf + +## Destination Folder: /var/lib/gsl/ +- Folder: db (Created by GSL) +- Folder: helps +- Folder: scripts +- File: README.md + +## Destination Folder: /var/log/gsl +- File: gsl.log (Created and managed by GSL $ gsl log clean...) + +## Destination Folder: /usr/local/bin +- File: gsl + +## Destination Folder: /usr/share/bash-completion/completions/gsl +- File: gsl + +# How to configure a DOMAIN folder, and create a Post +------------------------------------------------------------------------ + +When Adding a DOMAIN (example.com), GSL will ask you some questions. +Datas will be used to create a DOMAIN.conf file. GSL will also ask you +to set a folder where you will put your Posts, but you can create or add +ones too. + +## Set a DOMAIN +- add a DOMAIN name (if not alrady done) +``` +gsl new +``` + +Follow instructions when adding DOMAIN or see them again with +``` +gsl help new +gsl help install +``` + +## Set a DOMAIN folder for Posts (if not already done by GSL or You) + +- Add/Create or go into your folder of choice +- Save into that folder a blank file named gsl.DOMAIN (gsl.example.org) +so that GSL, knows this folder is for this DOMAIN website. + +## Create a new Post +The engine is written from scratch and looks like a mix of markdown and +ReStructuredText. It's very easy to learn and use. + +- Write a post in a file, using some "metas" that GSL will catch. +- Save your file with .gsl extension +- Start checking it, using: + +``` +gsl check +``` + +## Convert one or all Posts +If your Post has no error, you will have to deploy html +files and folders. You could install nginx, or lightweight darkhttpd +webserver on your PC to preview the website. You can also just open +index.html in your server folder, but you won't be able to see some extra +includes page, like Posts listing. + +To convert your Posts in HTML, use + +``` +gsl make +``` + +You can select a specific post, with autocompletion to check and make +only that specified one. + +# Create a Templates +------------------------------------------------------------------------ + +You will have to create some CSS (styles.css) in your /DOMAIN/templates/ +- HOME: ~/.config/gsl/domains/DOMAIN/templates/ +- GLOBAL: /var/lib/gsl/domains/DOMAIN/templates/ + +# How to Write a Post +------------------------------------------------------------------------ + +Post has 2 sections : Before and After #1. #1 is the FIRST Title of your +post. #(1-6) are HTML titles. +- Before #1 is used to set METAs HEADERS to configure your Post. +- From #1 is the CONTENT of your Post + +## NEEDED HEADERS (before #1) +Register METAs for HTML Page content + +``` +title: POST TITLE +slug: POST-TITLE (if space in slug GSL will convert them) +info: DESCRIPTION (about the Post) +author: NAME (must be registred ($ gsl author add) +date: YYYY-MM-DD +tags: TAG1,OTHER TAG2,TAG3 (comma separated) +``` + +### Admin Header +Admin can define specific type of content. If no type defined, GSL will +add at first line the default value: "type: post". + +TYPE: +- post < classic content +- page < used to define main index, 404, about... + +``` +type: TYPE +``` + +GSL will create html file according to slug. Do not add .html to slug. +- post < /slug/index.html +- page < /slug.html + +## Optional HEADERS (before #1) +Register METAs for CONTENT. " : " field separator + +``` +abbr: SHORT : LONG +file: NAME : FILENAME : Alt Text +link: NAME : URL : Alt Text +code: NBR : FILENAME : Alt Text +image: NBR : FILENAME : ALT-TEXT +``` + +## CONTENT Post: +In Content Post, markers (i.e. __My Great file) must be on the SAME line. +For ABBRs, just write SHORT in your content + +``` +# Paragraphs +At begining of new line, open with ( and close with ) +Set till 3 different classes with ( 1 ( 2 ( 3 +( 2 +This is a paragraph with class 2 +) + +# Register in Header. link: My Great Link : URL : Alt text +_My Great Link +_My Great Link+ # Open in new tab + +# Register in Header. file: My Great file : FILENAME : ALT-TEXT +__My Great file + +# Register in Header. image: 1 : FILENAME : ALT-TEXT +_image:1:[OPT l|r|c (left, right, center, alignment)] +_image:1:r + +# Block-Code File: Register in Header. code: 1 : FILENAME : Alt Text +_code:1 + +# Write in STRONG +**this strong content** +this un**believe**able content +this border**line** content + +# BOLD +*this bold content* +... + +# Write in ITALIC +/this em text/ + +# Inline-code (¤ = alt-gr + $ on FR keyboard) +¤push()¤ + +# Simple Blockquote: Use 3 "-" +--- +( +A simple great quote +) +--- + +# Advanced Blockquote +--- +_cite : Richard Matthew Stallman +_link : https://stallman.org/ +_lang : en +( +In the free/libre software movement, we develop software that respects +users' freedom, so we and you can escape from software that doesn't. I +could have made money this way, and perhaps amused myself writing code. +But I knew that at the end of my career, I would look back on years of +building walls to divide people, and feel I had spent my life making the +world a worse place +) +--- + +# For advanced blockquotes, you can also add, if known: +_year: 2021 +_book: Esperanza 64 + +# Create Lists +Use = to create an item. You can use infinite sub-items, but each Item +of a list MUST be on the same Line +( +Let's start a list += Item 1 is *great* +== sub-item 1 +== sub-item 2 +=== sub-sub-item 1 of sub-item 2 +== sub-item 3 += Item 2 +== sub-item 1 of Item 2 +This list is ended +) +``` + +# HELP COMMAND +``` +$ gsl [ARG] + readme : Show README.md instructions + help | -h [OPT] : This Help + install : Show process installation + new : Adding a DOMAIN + write | -w : How to write a Post + + new | -N : Add and configure a new DOMAIN + + log | -L [OPTS] : Show logs from all sessions + clean | -C : Logs saved to {DATE}.gsl.log and cleaned + -i | -w | -e : from levels (infos, warnings, errors) + -s : from last session only + [TERM] : [TERM] : case insensitive, regex 'T1.*T2' + (i.e. $ gsl log -e -s code) + + author | -A [OPT] : List authors from DOMAIN set in PWD folder + add : Add author(s) for DOMAIN + remove : Remove author(s) for DOMAIN + + edit | -E [FILE] : Open in default EDITOR [FILE] or with nano + db [FILE] : Show DB statuses from [FILE] + + sync [OPT] : Sync Templates to www and wip + wip : Only to wip server (also done with make) + www : Only to www server (also done with www) + + + check | -C [OPT] [FILE] : Check Posts errors from PWD folder or [FILE] + -F : Force check again + + make | -M [OPT] [FILE] : Convert Posts from PWD folder or [FILE] + to HTML file in server + -F : Force Make again + + post-list [OPT] [FILE] : Add post again from [FILE] to Last-Posts List + (When converting new post, it will be added) + Pin : Set Post from [FILE] to first in Last-Posts List + Add : Add Post from [FILE] to last in Last-Posts List + + www [OPT1] [OPT2] : Add/Remove Post from www server + [OPT1]: + add : Add all/[FILE] to www server + rmove : remove all/[FILE] from www server + [OPT2]: + all : Select all post with wip statuses + [FILE] : Select specific post (if wip status) + + version | -v : Show local versionn + -vv : Shown local and repo Versions +``` diff --git a/README.md b/README.md index 5d656ca..90b328c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ # GSL: Statique Littérateur ------------------------------------------------------------------------ -GSL is a multiple blogs/websites generator based on their domain, -written in bash, for minimal dependancies. The websites are nearly all -static, except for some includes pages, like listing posts, that nginx -can easily get, in your webserver. +GSL est un générateur de blogs/sites-web basé sur leur nom de domaine, +écrit en bash, afin de ne réduire ses dépendances au minimum. Les pages +générées sont presque entièrement statiques, à l'exception du module de +liste des derniers articles. Nginx peut être facilement configuré pour +interprêter ce module. -# Dependancies +# Dépendances ------------------------------------------------------------------------ - bash @@ -17,199 +18,232 @@ can easily get, in your webserver. # GSL: Installation ------------------------------------------------------------------------ -In your System / -``` -git clone URL . -``` +Une procédure d'installation via un setup est en cours de test. Il est +aussi possible et recommandé sous debian de l'installer grâce à son +paquet deb. -GSL does NOT use any sudo. To avoid errors, you must give permissions -to USER with chown -R to folders. +Pour une installation manuelle, clonez ce dépôt, et copiez les dossiers +déjà pré-établis dans le système. GSL n'utilise pas sudo, il vous faut +donc donner les droits aux dossiers (chown -R) à l'utilisateur +(sauf au dossier /usr/local/bin). Pour ce dossier, vous donnerez les droits +via chown USER:USER /usr/local/bin/gsl -## --Prefix for DOMAIN configuration (set according to user choice): +## Configuration du DOMAIN (selon le choix de l'utilistaeur via $ gsl new) : - HOME: ~/.config/gsl - GLOBAL: /var/lib/gsl -- Folder: --Prefix/domains/ (created with $ gsl new) +- Dossier: --Prefix/domains/ (créé par GSL via $ gsl new) -### DOMAIN Datas from Prefix: -- Folder: --Prefix/DOMAIN/ (Created by GSL) -- - Files: DOMAIN.conf, authors.db (Created by GSL) -- - Folder: --Prefix/DOMAIN/templates/ (css, logos...) (Created by GSL) +### Données du DOMAIN : +- Dossier: --Prefix/DOMAIN/ (créé par GSL) +- - Fichiers: DOMAIN.conf, authors.db (créé par GSL) +- - Dossier: --Prefix/DOMAIN/templates/ (créé par GSL - pour vos css, logos...) -## Destination Folder: /etc/gsl/ -- File: gsl.conf +## Dossier de configuration de GSL : /etc/gsl/ +- Fichier: gsl.conf -## Destination Folder: /var/lib/gsl/ -- Folder: db (Created by GSL) -- Folder: helps -- Folder: scripts -- File: README.md +## Dossier principal : /var/lib/gsl/ +- Folder: db (créé par GSL) +- Dossier: helps +- Dossier: scripts +- Fichier: README.md, README-english.md -## Destination Folder: /var/log/gsl -- File: gsl.log (Created and managed by GSL $ gsl log clean...) +## Dossier des logs: /var/log/gsl/ +- Fichier: gsl.log (créé et géré par GSL via $ gsl log [OPT]...) -## Destination Folder: /usr/local/bin -- File: gsl +## Dossier de l'éxécutable : /usr/local/bin/ +- Fichier: gsl -## Destination Folder: /usr/share/bash-completion/completions/gsl -- File: gsl +## Dossier d'autocomplétion : /usr/share/bash-completion/completions/gsl/ +- Fichier: gsl -# How to configure a DOMAIN folder, and create a Post +# Comment configurer un domaine ------------------------------------------------------------------------ -When Adding a DOMAIN (example.com), GSL will ask you some questions. -Datas will be used to create a DOMAIN.conf file. GSL will also ask you -to set a folder where you will put your Posts, but you can create or add -ones too. +Des questions vous seront posées lorsque vous voudrez ajouter un domaine +(exemple.com). Les données renseignées seront utilisées pour créer le +fichier DOMAIN.conf. Une question spécifique pour les fichier des articles +vous sera posée afin d'établir un dossier de stockage de vos articles. +Vous pourrez en créer à loisir autant que vous voulez plus tard. -## Set a DOMAIN -- add a DOMAIN name (if not alrady done) ``` +# helps +gsl help +gsl help new +gsl help install + +# Ajouter un domaine gsl new ``` -Follow instructions when adding DOMAIN or see them again with +## Définir un dossier pour les articles du DOMAIN +Si ce n'est pas déjà fait par GSL, ou que vous voulez ajouter un dossier +pour y stocker et convertir en HTML vos articles pour un DOMAIN prévis : + +- Ajouter/créer un dossier de votre choix +- Créer un fichier vide nommé gsl.DOMAIAN (gsl.exemple.com) + +## Ajouter un auteur ``` -gsl help new -gsl help install +cd MON-DOSSER-ARTICLES +gsl author add ``` -## Set a DOMAIN folder for Posts (if not already done by GSL or You) +## Créer un article +Le moteur de convertion est nouveau, et est un mélange entre markdown et +reSTructuredText. Il est simple à apprendre et à utiliser. -- Add/Create or go into your folder of choice -- Save into that folder a blank file named gsl.DOMAIN (gsl.example.org) -so that GSL, knows this folder is for this DOMAIN website. - -## Create a new Post -The engine is written from scratch and looks like a mix of markdown and -ReStructuredText. It's very easy to learn and use. - -- Write a post in a file, using some "metas" that GSL will catch. -- Save your file with .gsl extension -- Start checking it, using: +- Créer un fichier (monarticle).gsl (extension .gsl) +- Suivez le guide plus bas pour comprendre les notions +Vous devrez le faire valider par GSL : ``` gsl check ``` -## Convert one or all Posts -If your Post has no error, you will have to deploy html -files and folders. You could install nginx, or lightweight darkhttpd -webserver on your PC to preview the website. You can also just open -index.html in your server folder, but you won't be able to see some extra -includes page, like Posts listing. - -To convert your Posts in HTML, use +## Convertir un ou tous les articles +Si votre article n'a pas d'erreurs, vous pouvez le convertir en HTML. ``` gsl make ``` -You can select a specific post, with autocompletion to check and make -only that specified one. +Votre article sera prêt dans le dossier webserver (ex: /var/www/DOMAIN/wip) +Vous pourrez donc vérifier son rendu. -# Create a Templates +Si vous êtes satisfait, vous pouvez le déployer "officiellement" dans www + +``` +# Vous pouvez utiliser l'autocompletion pour les articles +gsl www add (monarticle.gsl) +``` + +# Créer un Template ------------------------------------------------------------------------ -You will have to create some CSS (styles.css) in your /DOMAIN/templates/ +Vous devrez pour que votre site soit à vôtre goût créer et définir les +styles dans styles.css. Placez ce fichier (en fonction du choix de votre +configuration du DOMAIN) dans : - HOME: ~/.config/gsl/domains/DOMAIN/templates/ - GLOBAL: /var/lib/gsl/domains/DOMAIN/templates/ -# How to Write a Post +Astuce: Une fois votre article créé, vous verrez dans sa source que +beaucoup d'éléments ont une class="acronymechoisi_***". Utilisez ces classes. +Pour mettre à jour et voir vos modifications + +``` +gsl sync +# ou (si vous modifier le header/footer) +gsl make -F +``` + +# Comment écrire un article ------------------------------------------------------------------------ -Post has 2 sections : Before and After #1. #1 is the FIRST Title of your -post. #(1-6) are HTML titles. -- Before #1 is used to set METAs HEADERS to configure your Post. -- From #1 is the CONTENT of your Post +Votre article doit contenir 2 sections. Les Metas avant #1 et +l'article à partir de ce repère (servant de titre h1). + +- METAS : configurer votre article (titre, date, liens...) +- ARTICLE : Contenue rédactionnel avec quelques marqueurs (gras...) + +## METAS obligatoires (avant #1) -## NEEDED HEADERS (before #1) -Register METAs for HTML Page content ``` title: POST TITLE -slug: POST-TITLE (if space in slug GSL will convert them) -info: DESCRIPTION (about the Post) -author: NAME (must be registred ($ gsl author add) +slug: POST-TITLE (si espaces, GSL les convertira en -) +info: DESCRIPTION (À propos de cet article) +author: NAME (doit être enregistré via ($ gsl author add) date: YYYY-MM-DD -tags: TAG1,OTHER TAG2,TAG3 (comma separated) +tags: TAG1,Mon TAG2,TAG3 (séparé par une virgule) ``` -### Admin Header -Admin can define specific type of content. If no type defined, GSL will -add at first line the default value: "type: post". +### Page ou Article ? +Vous pouvez spécifiez pour chaque article si c'est une page ou un article +Si non renseigné, GSL ajoutera le type: post (article) par défaut à la +première ligne de votre article TYPE: -- post < classic content -- page < used to define main index, 404, about... +- post < Article +- page < Page (créer vos pages: index, 404, about...) ``` type: TYPE ``` -GSL will create html file according to slug. Do not add .html to slug. -- post < /slug/index.html -- page < /slug.html +GSL créera vos fichier HTML selon le "slug" renseigné. Ne pas ajouter .html +Selon le type: -## Optional HEADERS (before #1) -Register METAs for CONTENT. " : " field separator +- post < /POST-TITLE/index.html +- page < /POST-TITLE.html + +## METAS optionnelles (avant #1) +Définir les marqueurs (abbr:, link:...) et utilisr " : " comme séparateur ``` -abbr: SHORT : LONG -file: NAME : FILENAME : Alt Text -link: NAME : URL : Alt Text -code: NBR : FILENAME : Alt Text -image: NBR : FILENAME : ALT-TEXT +abbr: COURT : LONG +file: NOM : NOM-DU-FICHIER : Text alternatif +link: NOM : URL : Text alternatif +code: NUMERO : NOM-DU-FICHIER : Text alternatif +image: NUMERO : NOM-DU-FICHIER : TEXT-ALTERNATIF ``` -## CONTENT Post: -In Content Post, markers (i.e. __My Great file) must be on the SAME line. -For ABBRs, just write SHORT in your content +## Contenu de l'article: +Les marqueurs (ex __Mon-super-fichier) doivent commencer et finir sur +la même ligne. Pour les abréviations (abbr:), écrivez juste (ex: COURT). + ``` -# Paragraphs -At begining of new line, open with ( and close with ) -Set till 3 different classes with ( 1 ( 2 ( 3 +# Paragraphes +Au début d'une nouvelle ligne, ouvrez avec ( et fermez avec ). +Vous pouvez utiliser 4 classes de paragraphes différentes : ( 1 ( 2 ( 3 ( 2 -This is a paragraph with class 2 +Paragraphe avec une classe 2 (css) ) -# Register in Header. link: My Great Link : URL : Alt text -_My Great Link -_My Great Link+ # Open in new tab +# Liens +(définir en METAS. ex: link: Mon lien : URL : Alt text) +_Mon lien +_Mon lien+ # Pour ouvrir dans un nouvel onglet -# Register in Header. file: My Great file : FILENAME : ALT-TEXT -__My Great file +# Fichiers +(définir en METAS. ex: file: Mon fichier : FILENAME : ALT-TEXT +__Mon fichier -# Register in Header. image: 1 : FILENAME : ALT-TEXT -_image:1:[OPT l|r|c (left, right, center, alignment)] +# Images +(définir en METAS. ex: image: 1 : FILENAME : ALT-TEXT +_image:1 _image:1:r -# Block-Code File: Register in Header. code: 1 : FILENAME : Alt Text +:[l|r|c] (gauche, droite, centre) + +# Block-Code depuis un fichier: +(définir en METAS code: 1 : FILENAME : Alt Text _code:1 -# Write in STRONG -**this strong content** -this un**believe**able content -this border**line** content +# Écrire en très gras +**c'est du surgras** +c'est in**défini**ssable +il ad**juge** : pas de pub ! -# BOLD -*this bold content* +# Gras +*c'est en gras* ... -# Write in ITALIC -/this em text/ +# Italique +écrire /en italique/ -# Inline-code (¤ = alt-gr + $ on FR keyboard) -¤push()¤ +# Code en ligne (¤ = alt-gr + $ sur clavier FR azerty) +¤gsl help -w¤ -# Simple Blockquote: Use 3 "-" +# Citation simple +(au début de la ligne, mettez 3x -) --- ( -A simple great quote +Une citation simple dans un paragraphe ) --- -# Advanced Blockquote +# Citation avancée --- _cite : Richard Matthew Stallman _link : https://stallman.org/ @@ -224,23 +258,24 @@ world a worse place ) --- -# For advanced blockquotes, you can also add, if known: +# Citation avancée : optionnel _year: 2021 _book: Esperanza 64 -# Create Lists -Use = to create an item. You can use infinite sub-items, but each Item -of a list MUST be on the same Line +# Créer des listes +(utilisez = pour définir l'arborescence). L'arborescence est "infie") +(chaque contenu de la liste doit être sur la même ligne) + ( -Let's start a list -= Item 1 is *great* -== sub-item 1 -== sub-item 2 -=== sub-sub-item 1 of sub-item 2 -== sub-item 3 -= Item 2 -== sub-item 1 of Item 2 -This list is ended +Voici une liste += Fruits : *mangez-en* +== Kiwis +== Fraises +=== pas mûres +== Bananes += Légumes +== Épinards +Fin de la liste ) ``` @@ -266,7 +301,7 @@ $ gsl [ARG] add : Add author(s) for DOMAIN remove : Remove author(s) for DOMAIN - edit | -E [FILE] [APP] : Open in default EDITOR [FILE] or with APP + edit | -E [FILE] : Open in default EDITOR [FILE] or with nano db [FILE] : Show DB statuses from [FILE] sync [OPT] : Sync Templates to www and wip diff --git a/control b/control index 974d80a..db50db1 100644 --- a/control +++ b/control @@ -1,5 +1,5 @@ Package: egsl -Version: 0.0.9 +Version: 0.0.10 Section: custom Priority: optional Architecture: all diff --git a/usr/local/bin/gsl b/usr/local/bin/gsl index 30bc618..267566b 100755 --- a/usr/local/bin/gsl +++ b/usr/local/bin/gsl @@ -1,5 +1,5 @@ #!/bin/bash -# Version: 0.0.9 +# Version: 0.0.10 # file: gsl # Folder: /usr/local/bin # By echolib @@ -208,15 +208,10 @@ case "$1" in && exit 1 gsl__if_file "$2" post - if ! [[ "$EDITOR" ]];then - if [[ "$3" ]];then - if__command "$3" - EDITOR="$3" - else + if ! [[ "$EDITOR" ]];then if__command nano EDITOR=`which nano` fi - fi gsl__logs_print \ "$gsl_log_i" \ @@ -235,6 +230,7 @@ case "$1" in gsl_post_hash_old=$gsl_post_hash $EDITOR $PWD/$gsl_this_post + gsl__get_sum "$PWD/$gsl_this_post" if (( $gsl_post_hash != $gsl_post_hash_old ));then gsl_log_infos="NEW > Hash: $gsl_post_hash | Size: $gsl_post_size" diff --git a/var/lib/gsl/README-english.md b/var/lib/gsl/README-english.md new file mode 100644 index 0000000..e2c2d9d --- /dev/null +++ b/var/lib/gsl/README-english.md @@ -0,0 +1,299 @@ +# GSL: Statique Littérateur +------------------------------------------------------------------------ + +GSL is a multiple blogs/websites generator based on their domain, +written in bash, for minimal dependancies. The websites are nearly all +static, except for some includes pages, like listing posts, that nginx +can easily get, in your webserver. + +# Dependancies +------------------------------------------------------------------------ + +- bash +- coreutils +- curl (to check Posts links response) +- rsync + + +# GSL: Installation +------------------------------------------------------------------------ +In your System / +``` +git clone URL . +``` + +GSL does NOT use any sudo. To avoid errors, you must give permissions +to USER with chown -R to folders. + +## --Prefix for DOMAIN configuration (set according to user choice): +- HOME: ~/.config/gsl +- GLOBAL: /var/lib/gsl +- Folder: --Prefix/domains/ (created with $ gsl new) + +### DOMAIN Datas from Prefix: +- Folder: --Prefix/DOMAIN/ (Created by GSL) +- - Files: DOMAIN.conf, authors.db (Created by GSL) +- - Folder: --Prefix/DOMAIN/templates/ (css, logos...) (Created by GSL) + +## Destination Folder: /etc/gsl/ +- File: gsl.conf + +## Destination Folder: /var/lib/gsl/ +- Folder: db (Created by GSL) +- Folder: helps +- Folder: scripts +- File: README.md + +## Destination Folder: /var/log/gsl +- File: gsl.log (Created and managed by GSL $ gsl log clean...) + +## Destination Folder: /usr/local/bin +- File: gsl + +## Destination Folder: /usr/share/bash-completion/completions/gsl +- File: gsl + +# How to configure a DOMAIN folder, and create a Post +------------------------------------------------------------------------ + +When Adding a DOMAIN (example.com), GSL will ask you some questions. +Datas will be used to create a DOMAIN.conf file. GSL will also ask you +to set a folder where you will put your Posts, but you can create or add +ones too. + +## Set a DOMAIN +- add a DOMAIN name (if not alrady done) +``` +gsl new +``` + +Follow instructions when adding DOMAIN or see them again with +``` +gsl help new +gsl help install +``` + +## Set a DOMAIN folder for Posts (if not already done by GSL or You) + +- Add/Create or go into your folder of choice +- Save into that folder a blank file named gsl.DOMAIN (gsl.example.org) +so that GSL, knows this folder is for this DOMAIN website. + +## Create a new Post +The engine is written from scratch and looks like a mix of markdown and +ReStructuredText. It's very easy to learn and use. + +- Write a post in a file, using some "metas" that GSL will catch. +- Save your file with .gsl extension +- Start checking it, using: + +``` +gsl check +``` + +## Convert one or all Posts +If your Post has no error, you will have to deploy html +files and folders. You could install nginx, or lightweight darkhttpd +webserver on your PC to preview the website. You can also just open +index.html in your server folder, but you won't be able to see some extra +includes page, like Posts listing. + +To convert your Posts in HTML, use + +``` +gsl make +``` + +You can select a specific post, with autocompletion to check and make +only that specified one. + +# Create a Templates +------------------------------------------------------------------------ + +You will have to create some CSS (styles.css) in your /DOMAIN/templates/ +- HOME: ~/.config/gsl/domains/DOMAIN/templates/ +- GLOBAL: /var/lib/gsl/domains/DOMAIN/templates/ + +# How to Write a Post +------------------------------------------------------------------------ + +Post has 2 sections : Before and After #1. #1 is the FIRST Title of your +post. #(1-6) are HTML titles. +- Before #1 is used to set METAs HEADERS to configure your Post. +- From #1 is the CONTENT of your Post + +## NEEDED HEADERS (before #1) +Register METAs for HTML Page content + +``` +title: POST TITLE +slug: POST-TITLE (if space in slug GSL will convert them) +info: DESCRIPTION (about the Post) +author: NAME (must be registred ($ gsl author add) +date: YYYY-MM-DD +tags: TAG1,OTHER TAG2,TAG3 (comma separated) +``` + +### Admin Header +Admin can define specific type of content. If no type defined, GSL will +add at first line the default value: "type: post". + +TYPE: +- post < classic content +- page < used to define main index, 404, about... + +``` +type: TYPE +``` + +GSL will create html file according to slug. Do not add .html to slug. +- post < /slug/index.html +- page < /slug.html + +## Optional HEADERS (before #1) +Register METAs for CONTENT. " : " field separator + +``` +abbr: SHORT : LONG +file: NAME : FILENAME : Alt Text +link: NAME : URL : Alt Text +code: NBR : FILENAME : Alt Text +image: NBR : FILENAME : ALT-TEXT +``` + +## CONTENT Post: +In Content Post, markers (i.e. __My Great file) must be on the SAME line. +For ABBRs, just write SHORT in your content + +``` +# Paragraphs +At begining of new line, open with ( and close with ) +Set till 3 different classes with ( 1 ( 2 ( 3 +( 2 +This is a paragraph with class 2 +) + +# Register in Header. link: My Great Link : URL : Alt text +_My Great Link +_My Great Link+ # Open in new tab + +# Register in Header. file: My Great file : FILENAME : ALT-TEXT +__My Great file + +# Register in Header. image: 1 : FILENAME : ALT-TEXT +_image:1:[OPT l|r|c (left, right, center, alignment)] +_image:1:r + +# Block-Code File: Register in Header. code: 1 : FILENAME : Alt Text +_code:1 + +# Write in STRONG +**this strong content** +this un**believe**able content +this border**line** content + +# BOLD +*this bold content* +... + +# Write in ITALIC +/this em text/ + +# Inline-code (¤ = alt-gr + $ on FR keyboard) +¤push()¤ + +# Simple Blockquote: Use 3 "-" +--- +( +A simple great quote +) +--- + +# Advanced Blockquote +--- +_cite : Richard Matthew Stallman +_link : https://stallman.org/ +_lang : en +( +In the free/libre software movement, we develop software that respects +users' freedom, so we and you can escape from software that doesn't. I +could have made money this way, and perhaps amused myself writing code. +But I knew that at the end of my career, I would look back on years of +building walls to divide people, and feel I had spent my life making the +world a worse place +) +--- + +# For advanced blockquotes, you can also add, if known: +_year: 2021 +_book: Esperanza 64 + +# Create Lists +Use = to create an item. You can use infinite sub-items, but each Item +of a list MUST be on the same Line +( +Let's start a list += Item 1 is *great* +== sub-item 1 +== sub-item 2 +=== sub-sub-item 1 of sub-item 2 +== sub-item 3 += Item 2 +== sub-item 1 of Item 2 +This list is ended +) +``` + +# HELP COMMAND +``` +$ gsl [ARG] + readme : Show README.md instructions + help | -h [OPT] : This Help + install : Show process installation + new : Adding a DOMAIN + write | -w : How to write a Post + + new | -N : Add and configure a new DOMAIN + + log | -L [OPTS] : Show logs from all sessions + clean | -C : Logs saved to {DATE}.gsl.log and cleaned + -i | -w | -e : from levels (infos, warnings, errors) + -s : from last session only + [TERM] : [TERM] : case insensitive, regex 'T1.*T2' + (i.e. $ gsl log -e -s code) + + author | -A [OPT] : List authors from DOMAIN set in PWD folder + add : Add author(s) for DOMAIN + remove : Remove author(s) for DOMAIN + + edit | -E [FILE] : Open in default EDITOR [FILE] or with nano + db [FILE] : Show DB statuses from [FILE] + + sync [OPT] : Sync Templates to www and wip + wip : Only to wip server (also done with make) + www : Only to www server (also done with www) + + + check | -C [OPT] [FILE] : Check Posts errors from PWD folder or [FILE] + -F : Force check again + + make | -M [OPT] [FILE] : Convert Posts from PWD folder or [FILE] + to HTML file in server + -F : Force Make again + + post-list [OPT] [FILE] : Add post again from [FILE] to Last-Posts List + (When converting new post, it will be added) + Pin : Set Post from [FILE] to first in Last-Posts List + Add : Add Post from [FILE] to last in Last-Posts List + + www [OPT1] [OPT2] : Add/Remove Post from www server + [OPT1]: + add : Add all/[FILE] to www server + rmove : remove all/[FILE] from www server + [OPT2]: + all : Select all post with wip statuses + [FILE] : Select specific post (if wip status) + + version | -v : Show local versionn + -vv : Shown local and repo Versions +``` diff --git a/var/lib/gsl/README.md b/var/lib/gsl/README.md index 5d656ca..90b328c 100644 --- a/var/lib/gsl/README.md +++ b/var/lib/gsl/README.md @@ -1,12 +1,13 @@ # GSL: Statique Littérateur ------------------------------------------------------------------------ -GSL is a multiple blogs/websites generator based on their domain, -written in bash, for minimal dependancies. The websites are nearly all -static, except for some includes pages, like listing posts, that nginx -can easily get, in your webserver. +GSL est un générateur de blogs/sites-web basé sur leur nom de domaine, +écrit en bash, afin de ne réduire ses dépendances au minimum. Les pages +générées sont presque entièrement statiques, à l'exception du module de +liste des derniers articles. Nginx peut être facilement configuré pour +interprêter ce module. -# Dependancies +# Dépendances ------------------------------------------------------------------------ - bash @@ -17,199 +18,232 @@ can easily get, in your webserver. # GSL: Installation ------------------------------------------------------------------------ -In your System / -``` -git clone URL . -``` +Une procédure d'installation via un setup est en cours de test. Il est +aussi possible et recommandé sous debian de l'installer grâce à son +paquet deb. -GSL does NOT use any sudo. To avoid errors, you must give permissions -to USER with chown -R to folders. +Pour une installation manuelle, clonez ce dépôt, et copiez les dossiers +déjà pré-établis dans le système. GSL n'utilise pas sudo, il vous faut +donc donner les droits aux dossiers (chown -R) à l'utilisateur +(sauf au dossier /usr/local/bin). Pour ce dossier, vous donnerez les droits +via chown USER:USER /usr/local/bin/gsl -## --Prefix for DOMAIN configuration (set according to user choice): +## Configuration du DOMAIN (selon le choix de l'utilistaeur via $ gsl new) : - HOME: ~/.config/gsl - GLOBAL: /var/lib/gsl -- Folder: --Prefix/domains/ (created with $ gsl new) +- Dossier: --Prefix/domains/ (créé par GSL via $ gsl new) -### DOMAIN Datas from Prefix: -- Folder: --Prefix/DOMAIN/ (Created by GSL) -- - Files: DOMAIN.conf, authors.db (Created by GSL) -- - Folder: --Prefix/DOMAIN/templates/ (css, logos...) (Created by GSL) +### Données du DOMAIN : +- Dossier: --Prefix/DOMAIN/ (créé par GSL) +- - Fichiers: DOMAIN.conf, authors.db (créé par GSL) +- - Dossier: --Prefix/DOMAIN/templates/ (créé par GSL - pour vos css, logos...) -## Destination Folder: /etc/gsl/ -- File: gsl.conf +## Dossier de configuration de GSL : /etc/gsl/ +- Fichier: gsl.conf -## Destination Folder: /var/lib/gsl/ -- Folder: db (Created by GSL) -- Folder: helps -- Folder: scripts -- File: README.md +## Dossier principal : /var/lib/gsl/ +- Folder: db (créé par GSL) +- Dossier: helps +- Dossier: scripts +- Fichier: README.md, README-english.md -## Destination Folder: /var/log/gsl -- File: gsl.log (Created and managed by GSL $ gsl log clean...) +## Dossier des logs: /var/log/gsl/ +- Fichier: gsl.log (créé et géré par GSL via $ gsl log [OPT]...) -## Destination Folder: /usr/local/bin -- File: gsl +## Dossier de l'éxécutable : /usr/local/bin/ +- Fichier: gsl -## Destination Folder: /usr/share/bash-completion/completions/gsl -- File: gsl +## Dossier d'autocomplétion : /usr/share/bash-completion/completions/gsl/ +- Fichier: gsl -# How to configure a DOMAIN folder, and create a Post +# Comment configurer un domaine ------------------------------------------------------------------------ -When Adding a DOMAIN (example.com), GSL will ask you some questions. -Datas will be used to create a DOMAIN.conf file. GSL will also ask you -to set a folder where you will put your Posts, but you can create or add -ones too. +Des questions vous seront posées lorsque vous voudrez ajouter un domaine +(exemple.com). Les données renseignées seront utilisées pour créer le +fichier DOMAIN.conf. Une question spécifique pour les fichier des articles +vous sera posée afin d'établir un dossier de stockage de vos articles. +Vous pourrez en créer à loisir autant que vous voulez plus tard. -## Set a DOMAIN -- add a DOMAIN name (if not alrady done) ``` +# helps +gsl help +gsl help new +gsl help install + +# Ajouter un domaine gsl new ``` -Follow instructions when adding DOMAIN or see them again with +## Définir un dossier pour les articles du DOMAIN +Si ce n'est pas déjà fait par GSL, ou que vous voulez ajouter un dossier +pour y stocker et convertir en HTML vos articles pour un DOMAIN prévis : + +- Ajouter/créer un dossier de votre choix +- Créer un fichier vide nommé gsl.DOMAIAN (gsl.exemple.com) + +## Ajouter un auteur ``` -gsl help new -gsl help install +cd MON-DOSSER-ARTICLES +gsl author add ``` -## Set a DOMAIN folder for Posts (if not already done by GSL or You) +## Créer un article +Le moteur de convertion est nouveau, et est un mélange entre markdown et +reSTructuredText. Il est simple à apprendre et à utiliser. -- Add/Create or go into your folder of choice -- Save into that folder a blank file named gsl.DOMAIN (gsl.example.org) -so that GSL, knows this folder is for this DOMAIN website. - -## Create a new Post -The engine is written from scratch and looks like a mix of markdown and -ReStructuredText. It's very easy to learn and use. - -- Write a post in a file, using some "metas" that GSL will catch. -- Save your file with .gsl extension -- Start checking it, using: +- Créer un fichier (monarticle).gsl (extension .gsl) +- Suivez le guide plus bas pour comprendre les notions +Vous devrez le faire valider par GSL : ``` gsl check ``` -## Convert one or all Posts -If your Post has no error, you will have to deploy html -files and folders. You could install nginx, or lightweight darkhttpd -webserver on your PC to preview the website. You can also just open -index.html in your server folder, but you won't be able to see some extra -includes page, like Posts listing. - -To convert your Posts in HTML, use +## Convertir un ou tous les articles +Si votre article n'a pas d'erreurs, vous pouvez le convertir en HTML. ``` gsl make ``` -You can select a specific post, with autocompletion to check and make -only that specified one. +Votre article sera prêt dans le dossier webserver (ex: /var/www/DOMAIN/wip) +Vous pourrez donc vérifier son rendu. -# Create a Templates +Si vous êtes satisfait, vous pouvez le déployer "officiellement" dans www + +``` +# Vous pouvez utiliser l'autocompletion pour les articles +gsl www add (monarticle.gsl) +``` + +# Créer un Template ------------------------------------------------------------------------ -You will have to create some CSS (styles.css) in your /DOMAIN/templates/ +Vous devrez pour que votre site soit à vôtre goût créer et définir les +styles dans styles.css. Placez ce fichier (en fonction du choix de votre +configuration du DOMAIN) dans : - HOME: ~/.config/gsl/domains/DOMAIN/templates/ - GLOBAL: /var/lib/gsl/domains/DOMAIN/templates/ -# How to Write a Post +Astuce: Une fois votre article créé, vous verrez dans sa source que +beaucoup d'éléments ont une class="acronymechoisi_***". Utilisez ces classes. +Pour mettre à jour et voir vos modifications + +``` +gsl sync +# ou (si vous modifier le header/footer) +gsl make -F +``` + +# Comment écrire un article ------------------------------------------------------------------------ -Post has 2 sections : Before and After #1. #1 is the FIRST Title of your -post. #(1-6) are HTML titles. -- Before #1 is used to set METAs HEADERS to configure your Post. -- From #1 is the CONTENT of your Post +Votre article doit contenir 2 sections. Les Metas avant #1 et +l'article à partir de ce repère (servant de titre h1). + +- METAS : configurer votre article (titre, date, liens...) +- ARTICLE : Contenue rédactionnel avec quelques marqueurs (gras...) + +## METAS obligatoires (avant #1) -## NEEDED HEADERS (before #1) -Register METAs for HTML Page content ``` title: POST TITLE -slug: POST-TITLE (if space in slug GSL will convert them) -info: DESCRIPTION (about the Post) -author: NAME (must be registred ($ gsl author add) +slug: POST-TITLE (si espaces, GSL les convertira en -) +info: DESCRIPTION (À propos de cet article) +author: NAME (doit être enregistré via ($ gsl author add) date: YYYY-MM-DD -tags: TAG1,OTHER TAG2,TAG3 (comma separated) +tags: TAG1,Mon TAG2,TAG3 (séparé par une virgule) ``` -### Admin Header -Admin can define specific type of content. If no type defined, GSL will -add at first line the default value: "type: post". +### Page ou Article ? +Vous pouvez spécifiez pour chaque article si c'est une page ou un article +Si non renseigné, GSL ajoutera le type: post (article) par défaut à la +première ligne de votre article TYPE: -- post < classic content -- page < used to define main index, 404, about... +- post < Article +- page < Page (créer vos pages: index, 404, about...) ``` type: TYPE ``` -GSL will create html file according to slug. Do not add .html to slug. -- post < /slug/index.html -- page < /slug.html +GSL créera vos fichier HTML selon le "slug" renseigné. Ne pas ajouter .html +Selon le type: -## Optional HEADERS (before #1) -Register METAs for CONTENT. " : " field separator +- post < /POST-TITLE/index.html +- page < /POST-TITLE.html + +## METAS optionnelles (avant #1) +Définir les marqueurs (abbr:, link:...) et utilisr " : " comme séparateur ``` -abbr: SHORT : LONG -file: NAME : FILENAME : Alt Text -link: NAME : URL : Alt Text -code: NBR : FILENAME : Alt Text -image: NBR : FILENAME : ALT-TEXT +abbr: COURT : LONG +file: NOM : NOM-DU-FICHIER : Text alternatif +link: NOM : URL : Text alternatif +code: NUMERO : NOM-DU-FICHIER : Text alternatif +image: NUMERO : NOM-DU-FICHIER : TEXT-ALTERNATIF ``` -## CONTENT Post: -In Content Post, markers (i.e. __My Great file) must be on the SAME line. -For ABBRs, just write SHORT in your content +## Contenu de l'article: +Les marqueurs (ex __Mon-super-fichier) doivent commencer et finir sur +la même ligne. Pour les abréviations (abbr:), écrivez juste (ex: COURT). + ``` -# Paragraphs -At begining of new line, open with ( and close with ) -Set till 3 different classes with ( 1 ( 2 ( 3 +# Paragraphes +Au début d'une nouvelle ligne, ouvrez avec ( et fermez avec ). +Vous pouvez utiliser 4 classes de paragraphes différentes : ( 1 ( 2 ( 3 ( 2 -This is a paragraph with class 2 +Paragraphe avec une classe 2 (css) ) -# Register in Header. link: My Great Link : URL : Alt text -_My Great Link -_My Great Link+ # Open in new tab +# Liens +(définir en METAS. ex: link: Mon lien : URL : Alt text) +_Mon lien +_Mon lien+ # Pour ouvrir dans un nouvel onglet -# Register in Header. file: My Great file : FILENAME : ALT-TEXT -__My Great file +# Fichiers +(définir en METAS. ex: file: Mon fichier : FILENAME : ALT-TEXT +__Mon fichier -# Register in Header. image: 1 : FILENAME : ALT-TEXT -_image:1:[OPT l|r|c (left, right, center, alignment)] +# Images +(définir en METAS. ex: image: 1 : FILENAME : ALT-TEXT +_image:1 _image:1:r -# Block-Code File: Register in Header. code: 1 : FILENAME : Alt Text +:[l|r|c] (gauche, droite, centre) + +# Block-Code depuis un fichier: +(définir en METAS code: 1 : FILENAME : Alt Text _code:1 -# Write in STRONG -**this strong content** -this un**believe**able content -this border**line** content +# Écrire en très gras +**c'est du surgras** +c'est in**défini**ssable +il ad**juge** : pas de pub ! -# BOLD -*this bold content* +# Gras +*c'est en gras* ... -# Write in ITALIC -/this em text/ +# Italique +écrire /en italique/ -# Inline-code (¤ = alt-gr + $ on FR keyboard) -¤push()¤ +# Code en ligne (¤ = alt-gr + $ sur clavier FR azerty) +¤gsl help -w¤ -# Simple Blockquote: Use 3 "-" +# Citation simple +(au début de la ligne, mettez 3x -) --- ( -A simple great quote +Une citation simple dans un paragraphe ) --- -# Advanced Blockquote +# Citation avancée --- _cite : Richard Matthew Stallman _link : https://stallman.org/ @@ -224,23 +258,24 @@ world a worse place ) --- -# For advanced blockquotes, you can also add, if known: +# Citation avancée : optionnel _year: 2021 _book: Esperanza 64 -# Create Lists -Use = to create an item. You can use infinite sub-items, but each Item -of a list MUST be on the same Line +# Créer des listes +(utilisez = pour définir l'arborescence). L'arborescence est "infie") +(chaque contenu de la liste doit être sur la même ligne) + ( -Let's start a list -= Item 1 is *great* -== sub-item 1 -== sub-item 2 -=== sub-sub-item 1 of sub-item 2 -== sub-item 3 -= Item 2 -== sub-item 1 of Item 2 -This list is ended +Voici une liste += Fruits : *mangez-en* +== Kiwis +== Fraises +=== pas mûres +== Bananes += Légumes +== Épinards +Fin de la liste ) ``` @@ -266,7 +301,7 @@ $ gsl [ARG] add : Add author(s) for DOMAIN remove : Remove author(s) for DOMAIN - edit | -E [FILE] [APP] : Open in default EDITOR [FILE] or with APP + edit | -E [FILE] : Open in default EDITOR [FILE] or with nano db [FILE] : Show DB statuses from [FILE] sync [OPT] : Sync Templates to www and wip diff --git a/var/lib/gsl/helps/gsl_help b/var/lib/gsl/helps/gsl_help index 04ff795..5e81793 100644 --- a/var/lib/gsl/helps/gsl_help +++ b/var/lib/gsl/helps/gsl_help @@ -20,7 +20,7 @@ $ gsl [ARG] add : Add author(s) for DOMAIN remove : Remove author(s) for DOMAIN - edit | -E [FILE] [APP] : Open in default EDITOR [FILE] or with APP + edit | -E [FILE] : Open in default EDITOR [FILE] or with nano db [FILE] : Show DB statuses from [FILE] sync [OPT] : Sync Templates to www and wip