From 9c62b22a26872d13048a5401fa4bce34507f91a3 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 12 Oct 2022 13:16:56 -0300 Subject: [PATCH] [DOCs] Added a mechanism to differentiate dev and master README --- docs/README.in | 2 ++ docs/replace_tags.pl | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/docs/README.in b/docs/README.in index 4d10596e..236f9078 100644 --- a/docs/README.in +++ b/docs/README.in @@ -7,6 +7,8 @@ [![PyPI version](https://img.shields.io/pypi/v/kibot?style=plastic)](https://pypi.org/project/kibot/) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg?style=plastic)](https://www.paypal.com/donate/?hosted_button_id=K2T86GDTTMRPL) +@doc_id@ + **Important for CI/CD**: - We are now uploading docker images to GitHub, the new tags are much more simple. Consult: [Usage for CI/CD](#usage-for-cicd) diff --git a/docs/replace_tags.pl b/docs/replace_tags.pl index 8b2c7748..5e237eba 100644 --- a/docs/replace_tags.pl +++ b/docs/replace_tags.pl @@ -9,6 +9,25 @@ $global_options=`../src/kibot --help-global-options`; $dependencies=`../src/kibot --help-dependencies --markdown`; $json_dep=`../src/kibot --help-dependencies --json`; $json_dep=~s/\n/\\\n/g; +$branch=`git rev-parse --abbrev-ref HEAD`; +chomp($branch); +if ($branch eq "dev") + { + $doc_id="# **This is the documentation for the current development KiBot, not yet released.**\n"; + } +else + { + open(FI, '../kibot/__init__.py'); + while () + { + if ($_ =~ /__version__\s+=\s+\'([^\']+)\'/) + { + $version = $1; + last; + } + } + $doc_id="# **This is the documentation for KiBot v$version for the current development read [here](https://github.com/INTI-CMNB/KiBot/tree/dev).**\n"; + } while (<>) { @@ -20,6 +39,7 @@ while (<>) $_ =~ s/\@global_options\@/$global_options/; $_ =~ s/\@dependencies\@/$dependencies/; $_ =~ s/\@json_dep\@/$json_dep/; + $_ =~ s/\@doc_id\@/$doc_id/; print $_; }