Version 0.1.9

This commit is contained in:
Cyrille L 2022-06-28 22:56:48 +02:00
parent 56f0f9f69e
commit 00c6a4bebc
21 changed files with 638 additions and 409 deletions

View File

@ -4,6 +4,23 @@ GSL changes from releases. You can send an issue :
- repo: https://git.a-lec.org/echolib/gsl/-/issues - repo: https://git.a-lec.org/echolib/gsl/-/issues
- Contact xmpp: im@echolib.re - Contact xmpp: im@echolib.re
## [0.1.9]
### Added:
- gawk dependance
### Changes
- date: Format YYYY-MM-DD (in RAW article only)
- - new page|post follows this rule
- HTML markers
- - strong: '¤'
- - Inline-code: '`'
- - Bold: '*'
- - Emphasis: '\'
- - Cross: '×' ; was strike. Use it to customize your text with CSS
- - del: '~'
- new article creator ; gsl new page 404
## [0.1.8] ## [0.1.8]
- fix: logs field from sidebar - fix: logs field from sidebar
- Add: abbr 3rd field value. If set output HTML in lower case - Add: abbr 3rd field value. If set output HTML in lower case

View File

@ -14,8 +14,8 @@ facilement configuré pour interprêter ce module.
- bash - bash
- coreutils - coreutils
- curl (to check Posts links response) - curl (to check links response in articles)
- rsync, nano - rsync, nano, gawk
# GSL: Installation # GSL: Installation
@ -116,7 +116,7 @@ gsl sidebar add 3 monarticle.gsl
## Astuces ## Astuces
- Vous pouvez utiliser l'autocompletion pour les articles - Vous pouvez utiliser l'autocompletion pour les articles
- Reportez-vous à la documentation dans le dossier Help - Lisez les fichiers de la documentation dans le dossier Help
``` ```
gsl www add mona<TAB> gsl www add mona<TAB>
@ -143,6 +143,7 @@ $ gsl (ARG)
domain : Configure your DOMAIN domain : Configure your DOMAIN
author : Same as gsl author edit author : Same as gsl author edit
(TYPE) (NAME) : Create an article with (TYPE) named (NAME).gsl (TYPE) (NAME) : Create an article with (TYPE) named (NAME).gsl
: (TYPE) can be 'page' or 'post'
setdir | -D : Show current directory DOMAIN or set it setdir | -D : Show current directory DOMAIN or set it

View File

@ -1,10 +1,10 @@
Package: egsl Package: egsl
Version: 0.1.8 Version: 0.1.9
Section: custom Section: custom
Priority: optional Priority: optional
Architecture: all Architecture: all
Essential: no Essential: no
Depends: curl,rsync,nano Depends: curl,rsync,nano,gawk
Installed-Size: `du -ks usr|cut -f 1` Installed-Size: `du -ks usr|cut -f 1`
Maintainer: echolib <echolib@a-lec.org> Maintainer: echolib <echolib@a-lec.org>
Description: Echolib's 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. Description: Echolib's 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.

View File

@ -12,6 +12,7 @@ gsl_article_min_Size=180
# Show log by time|level (default: 'time'); not set = level # Show log by time|level (default: 'time'); not set = level
gsl_log_order=time gsl_log_order=time
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# # Directories Structure # # Directories Structure
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@ -25,6 +26,7 @@ gsl_dir_logs="/var/log/gsl"
gsl_dir_domains="$gsl_dir_lib/domains" gsl_dir_domains="$gsl_dir_lib/domains"
gsl_dir_db="$gsl_dir_lib/db" gsl_dir_db="$gsl_dir_lib/db"
#====================================================================== #======================================================================
# iNSTALLATION DEPENDANCIES # iNSTALLATION DEPENDANCIES
#====================================================================== #======================================================================
@ -69,6 +71,7 @@ $gsl_dir_db
$gsl_dir_logs $gsl_dir_logs
) )
#======================================================================= #=======================================================================
# Files # Files
#======================================================================= #=======================================================================
@ -80,6 +83,7 @@ NC="\e[0m"
CY="\e[33m" CY="\e[33m"
CR="\e[0;91m" CR="\e[0;91m"
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# LOGS settings # LOGS settings
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@ -98,6 +102,7 @@ gsl_log_act_image='NBR : FILENAME : ALT TEXT'
gsl_log_act_abbr='SHORT : LONG' gsl_log_act_abbr='SHORT : LONG'
gsl_log_act_link='NAME : URL : Alt-Text' gsl_log_act_link='NAME : URL : Alt-Text'
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# CONTENT Article markers # CONTENT Article markers
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@ -108,14 +113,9 @@ gsl_mark_image='_image'
gsl_mark_fcode='_code' gsl_mark_fcode='_code'
gsl_mark_fbrut='_brut' gsl_mark_fbrut='_brut'
gsl_mark_title='#' gsl_mark_title='#'
gsl_mark_bold='·'
gsl_mark_strong='•'
gsl_mark_em='”'
gsl_mark_icode="¤"
gsl_mark_list='=' gsl_mark_list='='
gsl_mark_listo="+" gsl_mark_listo='+'
gsl_mark_newline="|" gsl_mark_newline='|'
gsl_mark_strike="×"
gsl_mark_link='_' gsl_mark_link='_'
gsl_mark_blockquote='---' gsl_mark_blockquote='---'
gsl_mark_blockquote_cite='_cite :' gsl_mark_blockquote_cite='_cite :'
@ -124,6 +124,35 @@ gsl_mark_blockquote_link='_link :'
gsl_mark_blockquote_book='_book :' gsl_mark_blockquote_book='_book :'
gsl_mark_blockquote_lang='_lang :' gsl_mark_blockquote_lang='_lang :'
#----------------------------------------------------------------------
# bsis + icode
#----------------------------------------------------------------------
gsl_mark_icode='`'
icode_start='þ'
icode_close='Ł'
gsl_mark_bold='*'
bold_start='¶'
bold_close='ŧ'
gsl_mark_cross='×'
cross_start='ẞ'
cross_close='Ð'
gsl_mark_em='\'
em_start='ĸ'
em_close='ł'
gsl_mark_strong='¤'
strong_start='Ŋ'
strong_close='Ħ'
gsl_mark_del='~'
del_start='Ŧ'
del_close='ð'
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# HEADERS markers # HEADERS markers
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@ -146,11 +175,6 @@ gsl_marker_link='link:'
gsl_marker_flink='file:' gsl_marker_flink='file:'
# Closed HTML static code # Closed HTML static code
HTML_strike_close='</span>'
HTML_icode_close='</code>'
HTML_em_close='"</i>'
HTML_strong_close='</strong>'
HTML_bold_close='</b>'
HTML_br='<br />' HTML_br='<br />'
HTML_p_close='</p>' HTML_p_close='</p>'

View File

@ -46,8 +46,8 @@ title: POST TITLE
slug: MY-SLUG (si espaces, GSL les convertira en -) slug: MY-SLUG (si espaces, GSL les convertira en -)
info: DESCRIPTION (À propos de cet article) info: DESCRIPTION (À propos de cet article)
author: NAME (doit être enregistré via la commande: gsl author edit author: NAME (doit être enregistré via la commande: gsl author edit
date: YYYY-MM-DD (ou DD-MM-YYY si DOMAIN configuré en fr) date: YYYY-MM-DD
tags: TAG1,Mon TAG2 (séparé par une virgule) tags: TAG1,Mon TAG2 (séparés par une virgule)
``` ```
### Page ou Article ? ### Page ou Article ?
@ -68,10 +68,10 @@ Création HTML dans un dossier selon le slug: /MY-SLUG/index.html
``` ```
type: post type: post
slug: service/xmpp/configurer-gajim slug: turoriel/xmpp/configurer-gajim
``` ```
## METAS optionnelles (avant ```#1```) ## METAS optionnelles
Définir UN seul marqueur CSS par article pour personnaliser chaque Définir UN seul marqueur CSS par article pour personnaliser chaque
article avec sa propre CSS. article avec sa propre CSS.
@ -92,53 +92,60 @@ image: NUMERO : NOM-DU-FICHIER : TEXT-ALTERNATIF
``` ```
## Contenu de l'article ## Contenu de l'article
Les marqueurs (hors listes) *et leur contenu* (ex: ```·ceci est en gras·```) Les marqueurs (hors listes) et leur contenu (ex: ```*ceci est en gras*```)
**doivent être sur la même ligne**. **doivent être sur la même ligne**.
Les marqueurs à retenir et leur Combinaison de touches sur un clavier Les marqueurs à retenir et leur Combinaison de touches sur un clavier
azerty français azerty français par défaut
- Très gras: '•...•' (altgr + ;) - Gras: ```*...*```
- Gras: '·...·' (alt+gr + :) - Italique: ```\...\```
- Italique: '”...”' (altgr + n) - Code en ligne: "`...`" (altgr + 7)
- Barré: '×...×' (alt+gr + shift + ;) - Très gras: ```¤...¤``` (altgr + $)
- Code: '¤...¤' (altgr + $) - Barré: ```~...~``` (altgr + $)
- Personnalisé: ```×...×``` (altgr + shift + ;)
### Écrire en très gras ### Écrire en très gras
Dans l'article... Dans l'article...
``` ```
•c'est en super gras (strong)• ¤c'est en super gras (strong)¤
c'est in•défini•ssable
il ad•juge• : pas de pub !
``` ```
### Écrire en gras ### Écrire en gras
Dans l'article... Dans l'article...
``` ```
·Texte en gras· *Texte en gras*
``` ```
### Écrire en Italique ### Écrire en Italique
Dans l'article... Dans l'article...
``` ```
C'est ”en italique” C'est \en italique\
``` ```
### Créer un texte "barré" ### Créer un texte "barré"
Dans l'article... Dans l'article...
``` ```
La réunion aura lieu ×demain× dans une semaine La réunion aura lieu ~demain~ dans une semaine
``` ```
### Écrire un Code en ligne ### Écrire un Code en ligne
Dans l'article... Dans l'article...
``` ```
¤gsl help -w && echo "Be Happy"¤ `gsl help -w && echo "Be Happy"`
```
### Personnaliser un élément via CSS
Ce marqueur permet d'appliquer un ```<span class="xxx_cross">...</span>``` afin
dde personnaliser une partie spécifique d'un texte ciblé grâce à ses
propriétés CSS (voir la doc CSS)
```
Personnaliser ces ×jolis mots×
``` ```
### Abréviations ### Abréviations
@ -147,10 +154,9 @@ Définir en METAS...
- L'écriture longue de l'abréviation - L'écriture longue de l'abréviation
- Optionnel: valeur au choix pour forcer l'écriture HTML de "CSS" en minuscule - Optionnel: valeur au choix pour forcer l'écriture HTML de "CSS" en minuscule
``` ```
abbr: CSS : Cascading Style Sheets abbr: CSS : Cascading Style Sheets
abbr: POUET : Nom donnés aux message dans le fédivers : low abbr: POUET : Nom donnés aux messages dans le fédivers : low
``` ```
Dans l'article: Dans l'article:
@ -167,7 +173,7 @@ Ce POUET est chouette # Affiche "pouet" sur la page
Dans l'article... Dans l'article...
``` ```
( p3 ( p3
Paragraphe avec une classe p3 en css Paragraphe avec une classe p3 en CSS
) )
( (
@ -247,7 +253,7 @@ Images affichées l'une à côté de l'autre
``` ```
( (
_image:1 # Image 1, taille originale, sans lien _image:1 # Image 1, taille originale, sans lien
_image:2:r:+ # Image 2 classe right, taille originale, lien local _image:2:r:+ # Image 2, classe right, taille originale, lien local
_image:3:g:640px:https://echolib.re/ # Image 3, classe left, largeur 640px, hauteur déduite, lien externe _image:3:g:640px:https://echolib.re/ # Image 3, classe left, largeur 640px, hauteur déduite, lien externe
_image:4:maclass:320:200:+ # Image 4, classe maclass, largeur 320px, hauteur 200px, lien local _image:4:maclass:320:200:+ # Image 4, classe maclass, largeur 320px, hauteur 200px, lien local
_image:5:maclass:0:20%:https://echolib.re/ # Image 5, classe maclass, largeur déduite, hauteur 20%, lien externe _image:5:maclass:0:20%:https://echolib.re/ # Image 5, classe maclass, largeur déduite, hauteur 20%, lien externe
@ -305,7 +311,10 @@ Une citation simple dans un paragraphe
``` ```
### Citation avancée ### Citation avancée
Dans l'article... Stallman est une classe CSS Dans l'article...
"Stallman" est une classe CSS personnalisée
``` ```
--- Stallman --- Stallman
_cite : Richard Matthew Stallman _cite : Richard Matthew Stallman

View File

@ -15,6 +15,7 @@ $ gsl (ARG)
domain : Configure your DOMAIN domain : Configure your DOMAIN
author : Same as gsl author edit author : Same as gsl author edit
(TYPE) (NAME) : Create an article with (TYPE) named (NAME).gsl (TYPE) (NAME) : Create an article with (TYPE) named (NAME).gsl
: (TYPE) can be 'page' or 'post'
setdir | -D : Show current directory DOMAIN or set it setdir | -D : Show current directory DOMAIN or set it

View File

@ -23,8 +23,9 @@ X is 1 to 6 from current title
- bold: xxx_bold - bold: xxx_bold
- strong: xxx_strong - strong: xxx_strong
- emphasis: xxx_em - emphasis: xxx_em
- strike: xxx_strike (span) - cross: xxx_cross (span)
- inline code: xxx_icode - inline code: xxx_icode
- del: xxx_del
### Paragraphs ### Paragraphs
myclass is the content value used (i.e.```( myclass```) myclass is the content value used (i.e.```( myclass```)
@ -68,6 +69,9 @@ myclass is used on
- ```<figure>``` if "_cite" - ```<figure>``` if "_cite"
- - figure: xxx_quote-fig myclass - - figure: xxx_quote-fig myclass
### Write a code in line
If you want to use "`...`" in an inline-code, replace it with ```$(...)```
## Sidebar Content ## Sidebar Content
- aside: xxx_sidebar - aside: xxx_sidebar
- - div: xxx__wrapper - - div: xxx__wrapper
@ -91,5 +95,3 @@ myclass is used on
- footer: xxx_footer (ID) - footer: xxx_footer (ID)
- - div: xxx_footer-infos (ID) - - div: xxx_footer-infos (ID)
- - div: xxx_footer-about (ID) - - div: xxx_footer-about (ID)

View File

@ -1,17 +1,15 @@
## [0.1.6] ## [0.1.9]
### Fix: ### Added:
- invalid argument - gawk dependance
- site_css variable called in sidebar
- make : even if page created, article must be check if changed
- FR date on template only ; replace "-" with "/"
- Sidebar item link with add/replace
### Changes ### Changes
- images marker in content: use external http/ftp link - date: Format YYYY-MM-DD (in RAW article only)
- - No more needed unity: defaut "px" if not known in content marker - - new page|post follows this rule
- - See examples output HTML in help folder (how-to_Tips_And_Advises.md) - HTML markers
- - See main usage in help folder (comment_ecrire_article.md) - - strong: '¤'
- Ask to confirm both wip & www sync with gsl sync - - Inline-code: '`'
- - Bold: '*'
### Add - - Emphasis: '\'
- Stats : local link from slug (/...) counted after new check if added to www - - Cross: '×' ; was strike. Use it to customize your text with CSS
- - del: '~'
- new article creator ; gsl new page 404

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Version: 0.1.8 # Version: 0.1.9
# file: gsl # file: gsl
# Folder: /usr/local/bin # Folder: /usr/local/bin
# By echolib (XMPP: im@echolib.re) # By echolib (XMPP: im@echolib.re)

View File

@ -4,6 +4,23 @@ GSL changes from releases. You can send an issue :
- repo: https://git.a-lec.org/echolib/gsl/-/issues - repo: https://git.a-lec.org/echolib/gsl/-/issues
- Contact xmpp: im@echolib.re - Contact xmpp: im@echolib.re
## [0.1.9]
### Added:
- gawk dependance
### Changes
- date: Format YYYY-MM-DD (in RAW article only)
- - new page|post follows this rule
- HTML markers
- - strong: '¤'
- - Inline-code: '`'
- - Bold: '*'
- - Emphasis: '\'
- - Cross: '×' ; was strike. Use it to customize your text with CSS
- - del: '~'
- new article creator ; gsl new page 404
## [0.1.8] ## [0.1.8]
- fix: logs field from sidebar - fix: logs field from sidebar
- Add: abbr 3rd field value. If set output HTML in lower case - Add: abbr 3rd field value. If set output HTML in lower case

View File

@ -14,8 +14,8 @@ facilement configuré pour interprêter ce module.
- bash - bash
- coreutils - coreutils
- curl (to check Posts links response) - curl (to check links response in articles)
- rsync, nano - rsync, nano, gawk
# GSL: Installation # GSL: Installation
@ -116,7 +116,7 @@ gsl sidebar add 3 monarticle.gsl
## Astuces ## Astuces
- Vous pouvez utiliser l'autocompletion pour les articles - Vous pouvez utiliser l'autocompletion pour les articles
- Reportez-vous à la documentation dans le dossier Help - Lisez les fichiers de la documentation dans le dossier Help
``` ```
gsl www add mona<TAB> gsl www add mona<TAB>
@ -143,6 +143,7 @@ $ gsl (ARG)
domain : Configure your DOMAIN domain : Configure your DOMAIN
author : Same as gsl author edit author : Same as gsl author edit
(TYPE) (NAME) : Create an article with (TYPE) named (NAME).gsl (TYPE) (NAME) : Create an article with (TYPE) named (NAME).gsl
: (TYPE) can be 'page' or 'post'
setdir | -D : Show current directory DOMAIN or set it setdir | -D : Show current directory DOMAIN or set it

View File

@ -46,8 +46,8 @@ title: POST TITLE
slug: MY-SLUG (si espaces, GSL les convertira en -) slug: MY-SLUG (si espaces, GSL les convertira en -)
info: DESCRIPTION (À propos de cet article) info: DESCRIPTION (À propos de cet article)
author: NAME (doit être enregistré via la commande: gsl author edit author: NAME (doit être enregistré via la commande: gsl author edit
date: YYYY-MM-DD (ou DD-MM-YYY si DOMAIN configuré en fr) date: YYYY-MM-DD
tags: TAG1,Mon TAG2 (séparé par une virgule) tags: TAG1,Mon TAG2 (séparés par une virgule)
``` ```
### Page ou Article ? ### Page ou Article ?
@ -68,10 +68,10 @@ Création HTML dans un dossier selon le slug: /MY-SLUG/index.html
``` ```
type: post type: post
slug: service/xmpp/configurer-gajim slug: turoriel/xmpp/configurer-gajim
``` ```
## METAS optionnelles (avant ```#1```) ## METAS optionnelles
Définir UN seul marqueur CSS par article pour personnaliser chaque Définir UN seul marqueur CSS par article pour personnaliser chaque
article avec sa propre CSS. article avec sa propre CSS.
@ -92,53 +92,60 @@ image: NUMERO : NOM-DU-FICHIER : TEXT-ALTERNATIF
``` ```
## Contenu de l'article ## Contenu de l'article
Les marqueurs (hors listes) *et leur contenu* (ex: ```·ceci est en gras·```) Les marqueurs (hors listes) et leur contenu (ex: ```*ceci est en gras*```)
**doivent être sur la même ligne**. **doivent être sur la même ligne**.
Les marqueurs à retenir et leur Combinaison de touches sur un clavier Les marqueurs à retenir et leur Combinaison de touches sur un clavier
azerty français azerty français par défaut
- Très gras: '•...•' (altgr + ;) - Gras: ```*...*```
- Gras: '·...·' (alt+gr + :) - Italique: ```\...\```
- Italique: '”...”' (altgr + n) - Code en ligne: "`...`" (altgr + 7)
- Barré: '×...×' (alt+gr + shift + ;) - Très gras: ```¤...¤``` (altgr + $)
- Code: '¤...¤' (altgr + $) - Barré: ```~...~``` (altgr + $)
- Personnalisé: ```×...×``` (altgr + shift + ;)
### Écrire en très gras ### Écrire en très gras
Dans l'article... Dans l'article...
``` ```
•c'est en super gras (strong)• ¤c'est en super gras (strong)¤
c'est in•défini•ssable
il ad•juge• : pas de pub !
``` ```
### Écrire en gras ### Écrire en gras
Dans l'article... Dans l'article...
``` ```
·Texte en gras· *Texte en gras*
``` ```
### Écrire en Italique ### Écrire en Italique
Dans l'article... Dans l'article...
``` ```
C'est ”en italique” C'est \en italique\
``` ```
### Créer un texte "barré" ### Créer un texte "barré"
Dans l'article... Dans l'article...
``` ```
La réunion aura lieu ×demain× dans une semaine La réunion aura lieu ~demain~ dans une semaine
``` ```
### Écrire un Code en ligne ### Écrire un Code en ligne
Dans l'article... Dans l'article...
``` ```
¤gsl help -w && echo "Be Happy"¤ `gsl help -w && echo "Be Happy"`
```
### Personnaliser un élément via CSS
Ce marqueur permet d'appliquer un ```<span class="xxx_cross">...</span>``` afin
dde personnaliser une partie spécifique d'un texte ciblé grâce à ses
propriétés CSS (voir la doc CSS)
```
Personnaliser ces ×jolis mots×
``` ```
### Abréviations ### Abréviations
@ -147,10 +154,9 @@ Définir en METAS...
- L'écriture longue de l'abréviation - L'écriture longue de l'abréviation
- Optionnel: valeur au choix pour forcer l'écriture HTML de "CSS" en minuscule - Optionnel: valeur au choix pour forcer l'écriture HTML de "CSS" en minuscule
``` ```
abbr: CSS : Cascading Style Sheets abbr: CSS : Cascading Style Sheets
abbr: POUET : Nom donnés aux message dans le fédivers : low abbr: POUET : Nom donnés aux messages dans le fédivers : low
``` ```
Dans l'article: Dans l'article:
@ -167,7 +173,7 @@ Ce POUET est chouette # Affiche "pouet" sur la page
Dans l'article... Dans l'article...
``` ```
( p3 ( p3
Paragraphe avec une classe p3 en css Paragraphe avec une classe p3 en CSS
) )
( (
@ -247,7 +253,7 @@ Images affichées l'une à côté de l'autre
``` ```
( (
_image:1 # Image 1, taille originale, sans lien _image:1 # Image 1, taille originale, sans lien
_image:2:r:+ # Image 2 classe right, taille originale, lien local _image:2:r:+ # Image 2, classe right, taille originale, lien local
_image:3:g:640px:https://echolib.re/ # Image 3, classe left, largeur 640px, hauteur déduite, lien externe _image:3:g:640px:https://echolib.re/ # Image 3, classe left, largeur 640px, hauteur déduite, lien externe
_image:4:maclass:320:200:+ # Image 4, classe maclass, largeur 320px, hauteur 200px, lien local _image:4:maclass:320:200:+ # Image 4, classe maclass, largeur 320px, hauteur 200px, lien local
_image:5:maclass:0:20%:https://echolib.re/ # Image 5, classe maclass, largeur déduite, hauteur 20%, lien externe _image:5:maclass:0:20%:https://echolib.re/ # Image 5, classe maclass, largeur déduite, hauteur 20%, lien externe
@ -305,7 +311,10 @@ Une citation simple dans un paragraphe
``` ```
### Citation avancée ### Citation avancée
Dans l'article... Stallman est une classe CSS Dans l'article...
"Stallman" est une classe CSS personnalisée
``` ```
--- Stallman --- Stallman
_cite : Richard Matthew Stallman _cite : Richard Matthew Stallman

View File

@ -15,6 +15,7 @@ $ gsl (ARG)
domain : Configure your DOMAIN domain : Configure your DOMAIN
author : Same as gsl author edit author : Same as gsl author edit
(TYPE) (NAME) : Create an article with (TYPE) named (NAME).gsl (TYPE) (NAME) : Create an article with (TYPE) named (NAME).gsl
: (TYPE) can be 'page' or 'post'
setdir | -D : Show current directory DOMAIN or set it setdir | -D : Show current directory DOMAIN or set it

View File

@ -23,8 +23,9 @@ X is 1 to 6 from current title
- bold: xxx_bold - bold: xxx_bold
- strong: xxx_strong - strong: xxx_strong
- emphasis: xxx_em - emphasis: xxx_em
- strike: xxx_strike (span) - cross: xxx_cross (span)
- inline code: xxx_icode - inline code: xxx_icode
- del: xxx_del
### Paragraphs ### Paragraphs
myclass is the content value used (i.e.```( myclass```) myclass is the content value used (i.e.```( myclass```)
@ -68,6 +69,9 @@ myclass is used on
- ```<figure>``` if "_cite" - ```<figure>``` if "_cite"
- - figure: xxx_quote-fig myclass - - figure: xxx_quote-fig myclass
### Write a code in line
If you want to use "`...`" in an inline-code, replace it with ```$(...)```
## Sidebar Content ## Sidebar Content
- aside: xxx_sidebar - aside: xxx_sidebar
- - div: xxx__wrapper - - div: xxx__wrapper
@ -91,5 +95,3 @@ myclass is used on
- footer: xxx_footer (ID) - footer: xxx_footer (ID)
- - div: xxx_footer-infos (ID) - - div: xxx_footer-infos (ID)
- - div: xxx_footer-about (ID) - - div: xxx_footer-about (ID)

View File

@ -1,17 +1,15 @@
## [0.1.6] ## [0.1.9]
### Fix: ### Added:
- invalid argument - gawk dependance
- site_css variable called in sidebar
- make : even if page created, article must be check if changed
- FR date on template only ; replace "-" with "/"
- Sidebar item link with add/replace
### Changes ### Changes
- images marker in content: use external http/ftp link - date: Format YYYY-MM-DD (in RAW article only)
- - No more needed unity: defaut "px" if not known in content marker - - new page|post follows this rule
- - See examples output HTML in help folder (how-to_Tips_And_Advises.md) - HTML markers
- - See main usage in help folder (comment_ecrire_article.md) - - strong: '¤'
- Ask to confirm both wip & www sync with gsl sync - - Inline-code: '`'
- - Bold: '*'
### Add - - Emphasis: '\'
- Stats : local link from slug (/...) counted after new check if added to www - - Cross: '×' ; was strike. Use it to customize your text with CSS
- - del: '~'
- new article creator ; gsl new page 404

View File

@ -84,7 +84,12 @@ if [[ `grep -i "fr" <<<"$site_lang"` ]];then
gsl_by="par" gsl_by="par"
gsl_read="Lire l'article de" gsl_read="Lire l'article de"
gsl_rss_info="Tous les titres de" gsl_rss_info="Tous les titres de"
gsl_date="${article_Date//-//}"
# Convert date from INT to shit FR format (Yes, i love it...)
gsl_date_y=`awk -F- '{print $1}' <<<"$article_Date"`
gsl_date_m=`awk -F- '{print $2}' <<<"$article_Date"`
gsl_date_d=`awk -F- '{print $3}' <<<"$article_Date"`
gsl_date="$gsl_date_d/$gsl_date_m/$gsl_date_y"
else else
gsl_welcome="Welcome page of" gsl_welcome="Welcome page of"

View File

@ -209,6 +209,7 @@ stat_Strongs=$gsl_stat_strongs
stat_Bolds=$gsl_stat_bolds stat_Bolds=$gsl_stat_bolds
stat_Emphasis=$gsl_stat_italics stat_Emphasis=$gsl_stat_italics
stat_Strikes=$gsl_stat_strikes stat_Strikes=$gsl_stat_strikes
stat_Dels=$gsl_stat_dels
stat_Icodes=$gsl_stat_icodes stat_Icodes=$gsl_stat_icodes
stat_Lists=$gsl_stat_lists stat_Lists=$gsl_stat_lists
stat_Lists_Items=$gsl_list_items stat_Lists_Items=$gsl_list_items

View File

@ -158,7 +158,6 @@ gsl_dir_srv_www="$site_server/$site_ndd/www"
# Get arguments from COMMAND (new) # Get arguments from COMMAND (new)
#====================================================================== #======================================================================
new__OPTIONS() { new__OPTIONS() {
echo "$1 $2"
case "$1" in case "$1" in
domain) domain)
new__domain "$2" new__domain "$2"
@ -181,17 +180,16 @@ esac
#====================================================================== #======================================================================
# Create an "empty" article # Create a pre-filled article
#====================================================================== #======================================================================
new__article() { new__article() {
[[ -f "$2.gsl" ]] \ [[ -f "$2.gsl" ]] \
&& echo "! $2.gsl already exists" \ && echo "! $2.gsl already exists" \
&& exit && exit
[[ `grep -i "fr" <<<"$site_lang"` ]] \ cur_date=`date +%Y-%m-%d`
&& cur_date=`date +%d-%m-%Y` \
|| cur_date=`date +%Y-%m-%d`
touch "$2.gsl"
cat <<EONEWARTICLE > "$2.gsl" cat <<EONEWARTICLE > "$2.gsl"
type: $1 type: $1
#css: #css:
@ -202,7 +200,7 @@ author:
date: $cur_date date: $cur_date
tags: tags:
#abbr: COURT : LONG #abbr: COURT : Long : lower
#file: NOM : NOM-DU-FICHIER : Text alternatif #file: NOM : NOM-DU-FICHIER : Text alternatif
#link: NOM : URL : Text alternatif #link: NOM : URL : Text alternatif
#code: NUMERO : NOM-DU-FICHIER : Text alternatif #code: NUMERO : NOM-DU-FICHIER : Text alternatif
@ -210,12 +208,26 @@ tags:
#image: NUMERO : NOM-DU-FICHIER : TEXT-ALTERNATIF #image: NUMERO : NOM-DU-FICHIER : TEXT-ALTERNATIF
#1 #1
(
*Bold*
|
¤Strong¤
|
\Emphasis\ is good
|
×Custom×
|
~del~ restore
|
\`cat -n "$PWD/$gsl_postname.gsl"\`
|
)
EONEWARTICLE EONEWARTICLE
echo echo
cat "$2.gsl" cat "$2.gsl"
echo echo
gsl check "$2.gsl" echo "! This article has to be edited before check. You can use gsl edit $2.gsl"
exit exit
} }

View File

@ -67,7 +67,7 @@ case "$4" in
meta) meta)
check__meta_header "$3" check__meta_header "$3"
;; ;;
metas|content) metas|content)
case "$3" in case "$3" in
"title") check__titles ;; "title") check__titles ;;
@ -77,11 +77,6 @@ case "$4" in
"flink") check__file_link ;; "flink") check__file_link ;;
"fcode") check__file_code ;; "fcode") check__file_code ;;
"fbrut") check__file_brut ;; "fbrut") check__file_brut ;;
"icode") check__icode ;;
"strong") check__strong ;;
"bold") check__bold ;;
"em") check__emphasis ;;
"strike") check__strike ;;
esac esac
;; ;;
esac esac
@ -107,7 +102,7 @@ case "$1" in
# TYPE # TYPE
"$gsl_marker_type") "$gsl_marker_type")
gsl_post_type="$header_f1" gsl_post_type="$header_f1"
case "$gsl_post_type" in case "$gsl_post_type" in
page|post) page|post)
gsl__logs_print -i -h \ gsl__logs_print -i -h \
@ -123,7 +118,7 @@ case "$1" in
;; ;;
esac esac
;; ;;
# CSS # CSS
"$gsl_marker_css") "$gsl_marker_css")
gsl_post_css=" $header_f1" gsl_post_css=" $header_f1"
@ -132,49 +127,43 @@ case "$1" in
"Body template: $header_f1" \ "Body template: $header_f1" \
"$PWD/$gsl_post" "$PWD/$gsl_post"
;; ;;
# Title # Title
"$gsl_marker_title") "$gsl_marker_title")
gsl_post_title="$header_f1" gsl_post_title="$header_f1"
;; ;;
# DATE # DATE
"$gsl_marker_date") "$gsl_marker_date")
gsl_post_date="$header_f1" gsl_post_date="$header_f1"
if [[ `grep -i "fr" <<<"$site_lang"` ]];then case "$gsl_post_date" in
gsl_test_date='^[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]+$' [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])
gsl_log_content="DD-MM-YYYY" gsl_date_m=`awk -F- '{print $2}' <<<"$gsl_post_date"`
else if (( "$gsl_date_m" > 12 ));then
gsl_test_date='^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]+$' gsl__logs_print -e -h \
gsl_log_content="YYYY-MM-DD"
fi
if [[ "$gsl_post_date" =~ $gsl_test_date ]];then
gsl_date_m=`awk -F- '{print $2}' <<<"$gsl_post_date"`
(( "$gsl_date_m" > 12 )) \
&& gsl__logs_print -e -h \
"$1" \ "$1" \
"'$gsl_post_date' ; Month: $gsl_date_m > 12..." \ "'$gsl_post_date' ; Month: $gsl_date_m > 12..." \
"${PWD}/$gsl_post" "${PWD}/$gsl_post"
else return
gsl__logs_print -e -h \ fi
"$1" \
"Mismatch '$gsl_post_date' ; not $gsl_log_content" \ # timestamp date to db too (sidebar sort)
"${PWD}/$gsl_post" false_time=`date +%T`
fi
# timestamp date to db too (sidebar sort)
false_time=`date +%T`
if [[ `grep -i "fr" <<<"$site_lang"` ]];then
gsl_date_y=`awk -F- '{print $3}' <<<"$gsl_post_date"`
gsl_date_d=`awk -F- '{print $1}' <<<"$gsl_post_date"`
else
gsl_date_y=`awk -F- '{print $1}' <<<"$gsl_post_date"` gsl_date_y=`awk -F- '{print $1}' <<<"$gsl_post_date"`
gsl_date_d=`awk -F- '{print $3}' <<<"$gsl_post_date"` gsl_date_d=`awk -F- '{print $3}' <<<"$gsl_post_date"`
fi
date_epoch="$gsl_date_y-$gsl_date_m-$gsl_date_d $false_time" date_epoch="$gsl_date_y-$gsl_date_m-$gsl_date_d $false_time"
date_epoch=`date +%s -u -d "$date_epoch"` date_epoch=`date +%s -u -d "$date_epoch"`
;;
*)
gsl__logs_print -e -h \
"$1" \
"Mismatch '$gsl_post_date' ; not YYYY-MM-DD" \
"${PWD}/$gsl_post"
;;
esac
;; ;;
# SLUG # SLUG
@ -182,7 +171,7 @@ case "$1" in
gsl_post_slug="$header_f1" gsl_post_slug="$header_f1"
gsl_post_slug_src="$gsl_post_slug" gsl_post_slug_src="$gsl_post_slug"
gsl_hash_slug_src=`cksum <<<"$gsl_post_slug_src"` gsl_hash_slug_src=`cksum <<<"$gsl_post_slug_src"`
# Type page with "/" in # Type page with "/" in
if [[ "$gsl_post_type" == "page" ]] && \ if [[ "$gsl_post_type" == "page" ]] && \
[[ `grep '/' <<<"$gsl_post_slug"` ]];then [[ `grep '/' <<<"$gsl_post_slug"` ]];then
@ -192,10 +181,10 @@ case "$1" in
"Has '/' for type $gsl_post_type ; Replaced with '-'" \ "Has '/' for type $gsl_post_type ; Replaced with '-'" \
"${PWD}/$gsl_post" "${PWD}/$gsl_post"
fi fi
# Ensure no ending / for slug # Ensure no ending / for slug
gsl_post_slug=${gsl_post_slug/%\//} gsl_post_slug=${gsl_post_slug/%\//}
# Has space # Has space
gsl_post_slug=${gsl_post_slug// /-} gsl_post_slug=${gsl_post_slug// /-}
gsl_hash_slug=`cksum <<<"$gsl_post_slug"` gsl_hash_slug=`cksum <<<"$gsl_post_slug"`
@ -212,7 +201,7 @@ case "$1" in
article__sum "$gsl_post" article__sum "$gsl_post"
fi fi
# Already used slug # Already used slug
while read -r "file_db" while read -r "file_db"
do do
@ -309,36 +298,20 @@ read__line_with "^$gsl_marker_fbrut" "check" \
read__line_with "^#[1-6]" "check" \ read__line_with "^#[1-6]" "check" \
"title" "content" "$gsl_tmp_post" "title" "content" "$gsl_tmp_post"
# Check icode marks match
read__line_with "$gsl_mark_icode" "check" \
"icode" "content" "$gsl_tmp_post"
# Check strong marks match
read__line_with "$gsl_mark_strong" "check" \
"strong" "content" "$gsl_tmp_post"
# Check bold marks match
read__line_with "$gsl_mark_bold" "check" \
"bold" "content" "$gsl_tmp_post"
# Check emphasis marks match
read__line_with "$gsl_mark_em" "check" \
"em" "content" "$gsl_tmp_post"
# Check strike (line-through) marks match
read__line_with "$gsl_mark_strike" "check" \
"strike" "content" "$gsl_tmp_post"
# Independant modules # Independant modules
check__paragraphs "$gsl_tmp_post" # Check for paragraphs markers check__paragraphs "$gsl_tmp_post" # Check for paragraphs markers
check__lists "$gsl_tmp_post" # Check for lists markers check__lists "$gsl_tmp_post" # Check for lists markers
check__blockquote "$gsl_tmp_post" # Check for blockquote markers check__blockquote "$gsl_tmp_post" # Check for blockquote markers
check__bsis "$gsl_tmp_post" # Check paired & stats
check__icode "$gsl_tmp_post" # Check paired & stats for inline-code
# Errors => remove from DB and srv WIP # Errors => remove from DB and srv WIP
[[ "$gsl_checker_err" ]] \ [[ "$gsl_checker_err" ]] \
&& article_Errors="yes" \ && article_Errors="yes" \
|| article_Errors="no" || article_Errors="no"
Stat__words "$gsl_tmp_post" Stat__words "$gsl_tmp_post"
DB__set_status chk DB__set_status chk
@ -418,7 +391,7 @@ case "$header_f2" in
"$header_f2" 2>/dev/null \ "$header_f2" 2>/dev/null \
|| url_status="T"` || url_status="T"`
;; ;;
*) *)
url_status=NS url_status=NS
;; ;;
@ -440,7 +413,7 @@ case "$url_status" in
"No status ; ${header_f2:0:30}..." \ "No status ; ${header_f2:0:30}..." \
"${PWD}/$gsl_post" "${PWD}/$gsl_post"
;; ;;
T) T)
gsl__logs_print -w -h \ gsl__logs_print -w -h \
"$gsl_marker_link" \ "$gsl_marker_link" \
@ -734,110 +707,181 @@ printf '%s\n' \
#====================================================================== #======================================================================
# Check iCode marks match nbr + stats # Check bsis + stats
# $1: file (gsl_tmp_post)
#======================================================================
check__bsis() {
while read -r "ln" "gsl_line"
do
ln=$(( ln + $gsl_post_begin - 1 ))
unset line_has_bold \
line_has_strong \
line_has_em \
line_has_cross \
line_has_del
case "$gsl_line" in
*"$gsl_mark_bold"*|\
*"$gsl_mark_strike"*|\
*"$gsl_mark_em"*|\
*"$gsl_mark_strong"*|\
*"$gsl_mark_del"*)
check__bsis_stats
;;
esac
if [[ $line_has_bold ]];then
bold_paired=$(( $found_bold % 2 ))
if ! [[ "$bold_paired" -eq 0 ]];then
gsl__logs_print -e -c \
"Bold" \
"Line: $ln ; $found_bold '$gsl_mark_bold' ; not paired" \
"$PWD/$gsl_post"
else
gsl_stat_bolds=$(( gsl_stat_bolds + found_bold / 2 ))
fi
fi
if [[ $line_has_strong ]];then
strong_paired=$(( $found_strong % 2 ))
if ! [[ "$strong_paired" -eq 0 ]];then
gsl__logs_print -e -c \
"Strong" \
"Line: $ln ; $found_strong '$gsl_mark_strong' ; not paired" \
"$PWD/$gsl_post"
else
gsl_stat_strongs=$(( gsl_stat_strongs + found_strong / 2 ))
fi
fi
if [[ $line_has_em ]];then
em_paired=$(( $found_em % 2 ))
if ! [[ "$em_paired" -eq 0 ]];then
gsl__logs_print -e -c \
"Emphasis" \
"Line: $ln ; $found_em '$gsl_mark_em' ; not paired" \
"$PWD/$gsl_post"
else
gsl_stat_italics=$(( gsl_stat_italics + found_em / 2 ))
fi
fi
if [[ $line_has_cross ]];then
cross_paired=$(( $found_cross % 2 ))
if ! [[ "$cross_paired" -eq 0 ]];then
gsl__logs_print -e -c \
"Cross" \
"Line: $ln ; $found_cross '$gsl_mark_cross' ; not paired" \
"$PWD/$gsl_post"
else
gsl_stat_strikes=$(( gsl_stat_strikes + found_cross / 2 ))
fi
fi
if [[ $line_has_del ]];then
del_paired=$(( $found_del % 2 ))
if ! [[ "$del_paired" -eq 0 ]];then
gsl__logs_print -e -c \
"Del" \
"Line: $ln ; $found_del '$gsl_mark_del' ; not paired" \
"$PWD/$gsl_post"
else
gsl_stat_dels=$(( gsl_stat_dels + found_del / 2 ))
fi
fi
done < <(cat -n "$1")
}
check__bsis_stats() {
found_bold=0
found_strong=0
found_em=0
found_cross=0
found_del=0
for (( i=0; i<${#gsl_line}; i++ ))
do
case "${gsl_line:$i:1}" in
"$gsl_mark_icode")
[[ $code_open ]] \
&& unset code_open \
|| code_open=true
;;
"$gsl_mark_bold")
[[ $code_open ]] && continue
((found_bold++))
line_has_bold=true
;;
*"$gsl_mark_strong"*)
[[ $code_open ]] && continue
((found_strong++))
line_has_strong=true
;;
*"$gsl_mark_em"*)
[[ $code_open ]] && continue
((found_em++))
line_has_em=true
;;
*"$gsl_mark_cross"*)
[[ $code_open ]] && continue
((found_cross++))
line_has_cross=true
;;
*"$gsl_mark_del"*)
[[ $code_open ]] && continue
((found_del++))
line_has_del=true
;;
esac
done
}
#======================================================================
# Check iCode + stats
# $1: file (gsl_tmp_post)
#====================================================================== #======================================================================
check__icode() { check__icode() {
post_ln=$((ln + gsl_post_begin - 1)) while read -r "ln" "gsl_line"
mark_icode_nbr="${gsl_line//[^$gsl_mark_icode]}" do
mark_icode_nbr=${#mark_icode_nbr} ln=$(( ln + $gsl_post_begin - 1 ))
mark_icode_paired=$(( $mark_icode_nbr % 2 )) unset line_has_icode
case "$gsl_line" in
*"$gsl_mark_icode"*)
found_icode=0
for (( i=0; i<${#gsl_line}; i++ ))
do
case "${gsl_line:$i:1}" in
"$gsl_mark_icode")
((found_icode++))
line_has_icode=true
;;
esac
done
;;
esac
if [[ "$mark_icode_paired" -eq 0 ]];then if [[ $line_has_icode ]];then
stat_icode_nbr=$(( mark_icode_nbr / 2 )) icode_paired=$(( $found_icode % 2 ))
gsl_stat_icodes=$(( gsl_stat_icodes + stat_icode_nbr )) if ! [[ "$icode_paired" -eq 0 ]];then
gsl__logs_print -e -c \
"i-Code" \
"Line: $ln ; $found_icode '$gsl_mark_icode' ; not paired" \
"$PWD/$gsl_post"
else
gsl_stat_icodes=$(( gsl_stat_icodes + found_icode / 2 ))
fi
fi
else done < <(cat -n "$1")
gsl__logs_print -e -c \
"iCode" \
"Line: $post_ln ; '$gsl_mark_icode...$gsl_mark_icode' not paired" \
"$PWD/$gsl_post"
fi
}
#======================================================================
# Check stronng marks match nbr + stats
#======================================================================
check__strong() {
post_ln=$((ln + gsl_post_begin - 1))
mark_strong_nbr="${gsl_line//[^$gsl_mark_strong]}"
mark_strong_nbr=${#mark_strong_nbr}
mark_strong_paired=$(( $mark_strong_nbr % 2 ))
if [[ "$mark_strong_paired" -eq 0 ]];then
stat_strong_nbr=$(( mark_strong_nbr / 2 ))
gsl_stat_strongs=$(( gsl_stat_strongs + stat_strong_nbr ))
else
gsl__logs_print -e -c \
"Strong" \
"Line: $post_ln ; '$gsl_mark_strong...$gsl_mark_strong' not paired" \
"$PWD/$gsl_post"
fi
}
#======================================================================
# Check Bold marks match nbr + stats
#======================================================================
check__bold() {
post_ln=$((ln + gsl_post_begin - 1))
mark_bold_nbr="${gsl_line//[^$gsl_mark_bold]}"
mark_bold_nbr=${#mark_bold_nbr}
mark_bold_paired=$(( $mark_bold_nbr % 2 ))
if [[ "$mark_bold_paired" -eq 0 ]];then
stat_bold_nbr=$(( mark_bold_nbr / 2 ))
gsl_stat_bolds=$(( gsl_stat_bolds + stat_bold_nbr ))
else
gsl__logs_print -e -c \
"Bold" \
"Line: $post_ln ; '$gsl_mark_bold...$gsl_mark_bold' not paired" \
"$PWD/$gsl_post"
fi
}
#======================================================================
# Check Bold marks match nbr + stats
#======================================================================
check__emphasis() {
post_ln=$((ln + gsl_post_begin - 1))
mark_em_nbr="${gsl_line//[^$gsl_mark_em]}"
mark_em_nbr=${#mark_em_nbr}
mark_em_paired=$(( $mark_em_nbr % 2 ))
if [[ "$mark_em_paired" -eq 0 ]];then
stat_em_nbr=$(( mark_em_nbr / 2 ))
gsl_stat_italics=$(( gsl_stat_italics + stat_em_nbr ))
else
gsl__logs_print -e -c \
"Emphasis" \
"Line: $post_ln ; '$gsl_mark_em...$gsl_mark_em' not paired" \
"$PWD/$gsl_post"
fi
}
#======================================================================
# Check strike (lt) marks match nbr + stats
#======================================================================
check__strike() {
post_ln=$((ln + gsl_post_begin - 1))
mark_lt_nbr="${gsl_line//[^$gsl_mark_strike]}"
mark_lt_nbr=${#mark_lt_nbr}
mark_lt_paired=$(( $mark_lt_nbr % 2 ))
if [[ "$mark_lt_paired" -eq 0 ]];then
stat_lt_nbr=$(( mark_lt_nbr / 2 ))
gsl_stat_strikes=$(( gsl_stat_strikes + stat_lt_nbr ))
else
gsl__logs_print -e -c \
"Strike" \
"Line: $post_ln ; '$gsl_mark_strike...$gsl_mark_strike' not paired" \
"$PWD/$gsl_post"
fi
} }

View File

@ -17,7 +17,7 @@
# $3: file # $3: file
#====================================================================== #======================================================================
sidebar__OPTIONS() { sidebar__OPTIONS() {
# Check OPTIONS except for "latest" # Check OPTIONS except for "latest"
# --------------------------------- # ---------------------------------
sidebar__check_args() { sidebar__check_args() {
@ -29,7 +29,7 @@ sidebar__OPTIONS() {
&& gsl__invalid_option "$1" "position (1 to $site_max_list)" && gsl__invalid_option "$1" "position (1 to $site_max_list)"
position="$1" position="$1"
# file post # file post
if__file "$2" post if__file "$2" post
gsl_post="$2" gsl_post="$2"
@ -37,27 +37,26 @@ sidebar__OPTIONS() {
&& echo "! Article not check yet" \ && echo "! Article not check yet" \
&& exit && exit
} }
case "$1" in case "$1" in
add|-a) add|-a)
sidebar__check_args "$2" "$3" sidebar__check_args "$2" "$3"
;; ;;
replace|-r) replace|-r)
sidebar__check_args "$2" "$3" sidebar__check_args "$2" "$3"
;; ;;
latest|-l|oldest|-o) latest|-l|oldest|-o)
position="1 to $site_max_list" position="1 to $site_max_list"
;; ;;
*) *)
gsl__invalid_option "$1" "add|replace|latest|oldest" gsl__invalid_option "$1" "add|replace|latest|oldest"
;; ;;
esac esac
# Start process # Start process
create__HTML_translation
sidebar__create "$1" "$position" sidebar__create "$1" "$position"
} }
@ -166,7 +165,7 @@ do
gsl_force_make=true gsl_force_make=true
log_info_force="Force " log_info_force="Force "
;; ;;
*".gsl") *".gsl")
if__file "$2" post if__file "$2" post
gsl_post="$2" gsl_post="$2"
@ -232,16 +231,6 @@ fi
! [[ "$gsl_do_make" ]] && return ! [[ "$gsl_do_make" ]] && return
#----------------------------------------------------------------------
# Set HTML to replace first marker
# Closed HTML are static > in gsl.conf
#----------------------------------------------------------------------
HTML_icode_start="<code class=\"${site_css}_icode\">"
HTML_strong_start="<strong class=\"${site_css}_strong\">"
HTML_em_start="<i class=\"${site_css}_em\">"
HTML_strike_start="<span class=\"${site_css}_strike\">"
HTML_bold_start="<b class=\"${site_css}_bold\">"
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# makers modules # makers modules
#---------------------------------------------------------------------- #----------------------------------------------------------------------
@ -266,36 +255,24 @@ read__line_with "^$gsl_marker_link" "make" \
read__line_with "^$gsl_marker_flink" "make" \ read__line_with "^$gsl_marker_flink" "make" \
"flink" "metas" "$gsl_tmp_head" "flink" "metas" "$gsl_tmp_head"
#----------------------------------------------------------------------
# Convert words between marks (icode, strong, emphasis, bolds)
# If these markers are in inline code, replace by temp marker + sed back
# Strong
make__loop_line "$gsl_mark_strong" "between" "$gsl_tmp_post" \
"$HTML_strong_start" "$HTML_strong_close" "ß"
# Bold
make__loop_line "$gsl_mark_bold" "between" "$gsl_tmp_post" \
"$HTML_bold_start" "$HTML_bold_close" "ð"
# Emphasis
make__loop_line "$gsl_mark_em" "between" "$gsl_tmp_post" \
"$HTML_em_start" "$HTML_em_close" "đ"
# Strike
make__loop_line "$gsl_mark_strike" "between" "$gsl_tmp_post" \
"$HTML_strike_start" "$HTML_strike_close" "ŋ"
# ! At last do : iCodes
make__loop_line "$gsl_mark_icode" "between" "$gsl_tmp_post" \
"$HTML_icode_start" "$HTML_icode_close"
# For lines having markers in inline-code, replace temp markers
if [[ ${incode_line[@]} ]];then
for ln in ${incode_line[@]}
do
sed -i "${ln}s^ß^•^g" "$gsl_tmp_post" # Strong
sed -i "${ln}s^ð^·^g" "$gsl_tmp_post" # Bold
sed -i "${ln}s^đ^”^g" "$gsl_tmp_post" # Emphasis
sed -i "${ln}s^ŋ^×^g" "$gsl_tmp_post" # Strike
done
fi
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Method bsis (Bold, String, Italic, Strike)
# Same for inline_code, done after bsis
# Search all lines for bsis mark
## Read each letter from line, excluding ones inside inline_code
## Convert mark with specific special charcter
## Convert specific special character to HTML
#----------------------------------------------------------------------
# Convert bsis
make__bsis_search "$gsl_tmp_post"
make__bsis "$gsl_tmp_post"
# Convert inlinde_code
make__icode_convert "$gsl_tmp_post"
make__icode "$gsl_tmp_post"
#----------------------------------------------------------------------
# Image # Image
read__line_with "^$gsl_marker_image" "make" \ read__line_with "^$gsl_marker_image" "make" \
@ -331,25 +308,6 @@ DB__set_status "wip"
} }
#======================================================================
# Loop called by each content module, till nothing found
# $1: marker
# $2: mark (between)
# $3: file
# $4: HTML Start
# $5: HTML Close
# $6: Temp character replacement
#======================================================================
make__loop_line() {
read__line_with \
"$1" "make" \
"$2" "content" \
"$3" "$4" "$5" "$6"
! [[ "$gsl_line" ]] && return
}
#====================================================================== #======================================================================
# Filter content # Filter content
# Called from read__line_with() in gsl__do_commons # Called from read__line_with() in gsl__do_commons
@ -362,7 +320,6 @@ read__line_with \
make__headers_from_filter() { make__headers_from_filter() {
case "$2" in case "$2" in
title) make__titles "$3" ;; title) make__titles "$3" ;;
between) make__words "$1" "$2" "$3" "$4" "$5" "$6" ;;
abbr) make__abbrs "$5" "$gsl_tmp_post" ;; abbr) make__abbrs "$5" "$gsl_tmp_post" ;;
link|flink) make__links "$gsl_tmp_post" "$2" ;; link|flink) make__links "$gsl_tmp_post" "$2" ;;
fcode) make__file_codes "$gsl_tmp_post" ;; fcode) make__file_codes "$gsl_tmp_post" ;;
@ -835,7 +792,7 @@ do
"="*) list[$i]="ul" ;; "="*) list[$i]="ul" ;;
"+"*) list[$i]="ol" ;; "+"*) list[$i]="ol" ;;
esac esac
done < <(awk '($1 ~ "=" || $1 ~ "+" || $1 ~ ">>" ) \ done < <(awk '($1 ~ "=" || $1 ~ "+" || $1 ~ ">>") \
{print NR,$0}' \ {print NR,$0}' \
"$gsl_tmp_list_brut") "$gsl_tmp_list_brut")
@ -1220,3 +1177,197 @@ echo "</div>" >> "$1"
sed -i "s^NODIV^^g" "$1" sed -i "s^NODIV^^g" "$1"
sed -i "s^ENDIV^^g" "$1" sed -i "s^ENDIV^^g" "$1"
} }
#======================================================================
# bsis: Search all lines for bsis mark
# $1: file (gsl_tmp_post)
#======================================================================
make__bsis_search() {
while read -r "ln" "gsl_line"
do
case "$gsl_line" in
*"$gsl_mark_bold"*|\
*"$gsl_mark_strike"*|\
*"$gsl_mark_em"*|\
*"$gsl_mark_del"*|\
*"$gsl_mark_strong"*)
make__bsis_convert "$ln" "$1"
;;
esac
done < <(cat -n "$1")
}
#======================================================================
# Called from make__bsis_search
# bsis: Read each letter from line, excluding ones inside inline_code
# $1: line number
# $2: file (gsl_tmp_post)
#======================================================================
make__bsis_convert() {
for (( i=0; i<${#gsl_line}; i++ ))
do
case "${gsl_line:$i:1}" in
"$gsl_mark_icode")
if [[ $code_open ]];then
unset code_open
else
code_open=true
fi
;;
"$gsl_mark_bold")
[[ $code_open ]] && continue
if [[ $bold_open ]];then
sed -i -r "$1s|^(.{"$i"})"'\*'"|\1$bold_close|" "$2"
unset bold_open
else
sed -i -r "$1s|^(.{"$i"})"'\*'"|\1$bold_start|" "$2"
bold_open=true
article_has_bold=true
fi
;;
"$gsl_mark_cross")
[[ $code_open ]] && continue
if [[ $cross_open ]];then
sed -i -r "$1s|^(.{"$i"})"$gsl_mark_cross"|\1$cross_close|" "$2"
unset cross_open
else
sed -i -r "$1s|^(.{"$i"})"$gsl_mark_cross"|\1$cross_start|" "$2"
cross_open=true
article_has_cross=true
fi
;;
"$gsl_mark_del")
[[ $code_open ]] && continue
if [[ $del_open ]];then
sed -i -r "$1s|^(.{"$i"})"$gsl_mark_del"|\1$del_close|" "$2"
unset del_open
else
sed -i -r "$1s|^(.{"$i"})"$gsl_mark_del"|\1$del_start|" "$2"
del_open=true
article_has_del=true
fi
;;
"$gsl_mark_em")
[[ $code_open ]] && continue
if [[ $em_open ]];then
sed -i -r "$1s|^(.{"$i"})"'\\'"|\1$em_close|" "$2"
unset em_open
else
sed -i -r "$1s|^(.{"$i"})"'\\'"|\1$em_start|" "$2"
em_open=true
article_has_em=true
fi
;;
"$gsl_mark_strong")
[[ $code_open ]] && continue
if [[ $strong_open ]];then
sed -i -r "$1s|^(.{"$i"})"'¤'"|\1$strong_close|" "$2"
unset strong_open
else
sed -i -r "$1s|^(.{"$i"})"'¤'"|\1$strong_start|" "$2"
strong_open=true
article_has_strong=true
fi
;;
esac
done
}
#======================================================================
# bsis: Convert specific characters to HTML
# $1: file (gsl_tmp_post)
#======================================================================
make__bsis() {
if [[ $article_has_bold ]];then
HTML_bold_start="<b class=\"${site_css}_bold\">"
sed -i "s^$bold_start^$HTML_bold_start^g" "$1"
sed -i "s^$bold_close^</b>^g" "$1"
fi
if [[ $article_has_em ]];then
HTML_em_start="<i class=\"${site_css}_em\">"
sed -i "s^$em_start^$HTML_em_start^g" "$1"
sed -i "s^$em_close^</i>^g" "$1"
fi
if [[ $article_has_cross ]];then
HTML_cross_start="<span class=\"${site_css}_cross\">"
sed -i "s^$cross_start^$HTML_cross_start^g" "$1"
sed -i "s^$cross_close^</span>^g" "$1"
fi
if [[ $article_has_del ]];then
HTML_del_start="<del class=\"${site_css}_del\">"
sed -i "s^$del_start^$HTML_del_start^g" "$1"
sed -i "s^$del_close^</del>^g" "$1"
fi
if [[ $article_has_strong ]];then
HTML_strong_start="<strong class=\"${site_css}_strong\">"
sed -i "s^$strong_start^$HTML_strong_start^g" "$1"
sed -i "s^$strong_close^</strong>^g" "$1"
fi
}
#======================================================================
# inline-code: Read each letter from line, convert to specific character
# $1: file (gsl_tmp_post)
#======================================================================
make__icode_convert() {
while read -r "ln" "gsl_line"
do
case "$gsl_line" in
*"$gsl_mark_icode"*)
for (( i=0; i<${#gsl_line}; i++ ))
do
case "${gsl_line:$i:1}" in
"$gsl_mark_icode")
if [[ $icode_open ]];then
sed -i -r "${ln}s|^(.{"$i"})"$gsl_mark_icode"|\1$icode_close|" "$1"
unset icode_open
else
sed -i -r "${ln}s|^(.{"$i"})"$gsl_mark_icode"|\1$icode_start|" "$1"
icode_open=true
article_has_icode=true
fi
;;
esac
done
;;
esac
done < <(cat -n "$1")
}
#======================================================================
# inline-code: Convert specific characters to HTML <code>
# $1: file (gsl_tmp_post)
#======================================================================
make__icode() {
if [[ $article_has_icode ]];then
HTML_icode_start="<code class=\"${site_css}_icode\">"
sed -i "s^$icode_start^$HTML_icode_start^g" "$1"
sed -i "s^$icode_close^</code>^g" "$1"
fi
}

View File

@ -13,7 +13,7 @@
posts__loop() { posts__loop() {
for gsl_post in `ls -1 *.gsl 2>/dev/null` for gsl_post in `ls -1 *.gsl 2>/dev/null`
do do
# Do specific asked Post # Do specific asked Post
[[ "$gsl_this_post" ]] && ! [[ "$gsl_post" == "$gsl_this_post" ]] \ [[ "$gsl_this_post" ]] && ! [[ "$gsl_post" == "$gsl_this_post" ]] \
&& continue && continue
@ -40,7 +40,7 @@ do
www) WWW__OPTIONS "$2" ;; www) WWW__OPTIONS "$2" ;;
wip) WIP__remove ;; # wip command is only a remove case || make wip) WIP__remove ;; # wip command is only a remove case || make
esac esac
# In DB, show logs for server # In DB, show logs for server
if [[ "$article_Type" ]];then if [[ "$article_Type" ]];then
if [[ $article_new_hash ]];then if [[ $article_new_hash ]];then
@ -154,67 +154,3 @@ gsl__logs_print -i -A -src \
"Hash: $article_Hash ; Size: $article_Size" \ "Hash: $article_Hash ; Size: $article_Size" \
"${PWD}/$1" "${PWD}/$1"
} }
#======================================================================
# Get arguments from COMMAND (create)
# $2: post type
# $3: post name
#======================================================================
new__article_OPTIONS() {
gsl__find_domain
author__check || exit 0
# exit if no postname
! [[ "$3" ]] \
&& gsl__invalid_option "$3" "Please set a name for your $2"
gsl_postname="$3"
case "$gsl_postname" in
*".gsl") gsl_postname=${gsl_postname/%.gsl/}
esac
# File exists
[[ -f "$gsl_postname.gsl" ]] \
&& echo "! $PWD/$gsl_postname.gsl already exists..." \
&& exit
gsl_proc="create"
[[ `grep -i "fr" <<<"$gsl_site_lang"` ]] \
&& gsl_today=`printf '%(%d-%m-%Y)T'` \
|| gsl_today=`date +%F`
gsl_post="$gsl_postname.gsl"
log__process_begin "Create $2"
touch "$PWD/$gsl_post"
cat << EONEWP >> "$PWD/$gsl_post"
type: $2
title:
slug:
info:
author:
tags:
date: $gsl_today
# Uncomment and fill
#link: NAME : URL : Alt-Text
#image: NBR : URI : ALT-TEXT
#abbr: SHORT : LONG
#1
·Bold· •Strong• ”Emphasis” ×Stile× ¤cat -n "$PWD/$gsl_postname.gsl"¤
EONEWP
get__post_sum "$gsl_post"
gsl__logs_print -i -f -src \
"Hash: $gsl_post_hash ; Size: $gsl_post_size" \
"$PWD/$gsl_post"
log__process_end "Create $2"
cat -n "$PWD/$gsl_post"
echo
gsl check "$gsl_post"
exit
}