* File download when using "source" as a style.
 * Improves the regex.
 * Fixes 404 page text decoration, adds reload message.
 * Links to download htmgem-master.zip.
 * Links CHANGELOG and COPYING into index.gmi.
 * Styles improvement, creation of raw.css.
 * Rewording of texts
 -----BEGIN PGP SIGNATURE-----
 
 iQJQBAABCgA6FiEEzDX71ob8wkH7CWZFqiQlK53WhPAFAmBN4eQcHGNocmlzdG9w
 aGUuaGVucnlAc2Jnb2Rpbi5mcgAKCRCqJCUrndaE8DRsD/9q4LvoRI5Rw47UvS2J
 GfEtFBW11H1sFRmXkaxsqO3OIyv5gbAtHTCkxVFn8AbTLTjqiVhLXB/PF9a+tLRm
 PC0DWpFeKtCqi/pdBaIx1KRqSfcWF2EQNVW+V607nmv/Qv8mlxMsZboOVCihQpPR
 yAIaGu/tZgjBMeVoprDSECKS0CraFUQHasi9O4791MMPuQRM76nAr2zUvQPm1kj0
 CM6x+zPAdACN/nIWbtjslB23hXHMxkBQpaLrmIDMv4Em1TVgU41d/80BbAf2kOve
 QVnjtATGtZZKWMIPppIxSvTBftAhFNyB2gYFt7V/E0tSXvNy9Rdec2ShjxO/5Fc/
 c1DCJbllUZ41UNf2On1MNrJANq+EbOjAuPKO1hwEEOjLdzJQkLdfSD4nz0GDsc3j
 BFYidJ5jc5Kq3yWa6ysH4cDqCZirC78Q/jRMMJPaR9ylMWpxnDXTmS2mcot7esys
 iY70G8b04Xsy29PHyors7UtN8ezBTaTgL9VtBK7TnfGT6tSqlSnbrx+4K+DFf7ia
 PAXT/+dlp1QyYdysl0cuUU8oICYMnOsSSflBUQHrBHNMzhXUMQjkkF27aukzNbJ3
 PU7SUFLukTctx2Wbe3Upe5wZG05toCgOYcOhBeFisFK00w82nBSP/zGEovaCMrYC
 UhUktfmU6mwKhnGtpMKYOYUZNQ==
 =WwgD
 -----END PGP SIGNATURE-----

Merge tag 'v1.1.0' into dev

v1.1.0

* File download when using "source" as a style.
* Improves the regex.
* Fixes 404 page text decoration, adds reload message.
* Links to download htmgem-master.zip.
* Links CHANGELOG and COPYING into index.gmi.
* Styles improvement, creation of raw.css.
* Rewording of texts
This commit is contained in:
Christophe HENRY 2021-03-14 11:44:08 +01:00
commit d12192bb1f
8 changed files with 36 additions and 16 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
*.swp

View File

@ -1,8 +1,8 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
=> https://keepachangelog.com/en/1.0.0/ The format is based on keep a Changelog.
=> https://semver.org/spec/v2.0.0.html And this project adheres to Semantic Versioning.
## [Unreleased] v3
* cgi-bin? Handle user input
@ -32,6 +32,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.
* Proxy: https://thewebsite.tld/htmgem/proxy/[gemini://]capsule.tld/path/file.gmi
* Search for {pages}.css from the current directory to the root. Empty css file means dont search and go to default.
## [1.1.0] - 2021-03-14
* File download when using "source" as a style.
* Improves the regex.
* Fixes 404 page text decoration, adds reload message.
* Links to download htmgem-master.zip.
* Links CHANGELOG and COPYING into index.gmi.
* Styles improvement, creation of raw.css.
* Rewording of texts.
## [1.0.0] - 2021-03-10
* Improves presentation and installation page.
* Adds stylesheets and download of pages source code.

View File

@ -1,3 +1,4 @@
^^^
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
@ -51,7 +52,8 @@ code of the modified version.
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
t//his license.
The precise terms and conditions for copying, distribution and
modification follow.

View File

@ -38,7 +38,7 @@ h1, h2, h3 {
}
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
blockquote {
@ -95,9 +95,7 @@ a.mailto:before {
}
pre {
background-color: #eee;
margin: 0 -1rem;
padding: 1rem;
overflow-x: auto;
}

View File

@ -7,7 +7,7 @@
=> index.gmi|simple simple.css
=> index.gmi|htmgem htmgem.css
=> index.gmi|terminal terminal.css
=> index.gmi|pre pre.css
=> index.gmi|pre code source préformaté
Simple ligne de texte

View File

@ -15,10 +15,15 @@ Gemini est un nouveau protocole internet qui :
```
=> https://gemini.circumlunar.space/
=> https://framagit.org/Sbgodin/htmgem Page du projet de HtmGem : code source, rapports de bug, commentaires…
=> https://framagit.org/Sbgodin/htmgem/-/archive/master/htmgem-master.zip Téléchargez htmgem-master.zip pour linstaller
=> https://framagit.org/Sbgodin/htmgem Code source, rapports de bug, commentaires…
=> https://gmi.sbgodin.fr/htmgem Page principale de HtmGem via le web
=> gemini://gmi.sbgodin.fr/htmgem Page principale de HtmGem via Gemini
=> CHANGELOG.gmi Journal des modifications (//changelog//)
=> COPYING.gmi GNU Affero General Public License (AGPLv3)
———————————————————— ————————————————————
# Installation
@ -72,7 +77,7 @@ Linstallation est terminée 🥳 La suite du texte donne des informations com
Par défaut, le style est incorporé dans chaque page récupérée par le navigateur web. Le même style est utilisé pour toutes les pages, //htmgem/css/htmgem.css//, sauf lorsquun fichier ayant le même nom que la page mais avec lextension **.css** existe dans le même répertoire. Dans ce cas, il est utilisé.
Lorsque loption css est activé dans la configuration (voir //rewrite// plus haut) dautres comportements sont possibles :
Lorsque loption css est activé dans la configuration (voir //rewrite// plus haut) dautres comportements sont possibles. **Attention**, cela ne fonctionnera pas avec un client Gemini puisque HtmGem nest accessible que via un navigateur web.
* &style=**htmgem** : Utilise le style par défaut, mais en tant que fichier externe.
* &style=**none** : La page HTML est envoyée sans style.
* &style=**<autre nom>** : Le fichier htmgem/css/<autre nom>.css est utilisé en tant que style externe.

View File

@ -69,9 +69,9 @@ if (empty($fileContents)) {
$text404 = <<<EOF
# ⚠ Page non trouvée
**$url**
**$url**
=> $url 🔄
=> $url Recharger 🔄
=> /
EOF;
@ -301,7 +301,14 @@ $page_title = @$matches[1];
**/
if ("source" == $style) {
echo $fileContents;
$basename = basename($filePath);
header("Cache-Control: public");
header("Content-Disposition: attachment; filename=$basename");
header("Content-Type: text/plain");
header("Content-Transfer-Encoding: binary");
header('Content-Length: ' . filesize($filePath));
readfile($filePath);
exit();
} elseif ("pre" == $style) {
$fileContents = htmlspecialchars($fileContents, ENT_HTML5|ENT_NOQUOTES, "UTF-8", false);
echo <<<EOL

View File

@ -43,10 +43,10 @@ Les blocs préformatés sont des lignes encadrées par un ``` sur une ligne avan
Il ne peut exister quun lien par ligne. Et la ligne est dédiée à ça ! Voici par exemple un lien vers le site centralisant pour le moment les informations sur Gemini :
^=> gemini://gemini.circumlunar.space/docs/specification.gmi Spécifications de Gemini
=> gemini://gemini.circumlunar.space/docs/specification.gmi Spécifications de Gemini
=> gemini://gemini.circumlunar.space/docs/specification.gmi Spécifications de Gemini
=> gemini://gemini.circumlunar.space/docs/specification.gmi Spécifications de Gemini
^=> https://gemini.circumlunar.space/docs/specification.gmi
=> https://gemini.circumlunar.space/docs/specification.gmi
=> https://gemini.circumlunar.space/docs/specification.gmi
# Décoration du texte