From c12b0622b46901e3e6441826d224a995fa455eb5 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 18 Apr 2023 17:35:05 +0200 Subject: [PATCH] org: replace version references with org-babel blocks This way we have fewer lines to edit multiple when making releases. * doc/org/index.org, doc/org/init.el.in, doc/org/install.org, doc/org/setup.org, doc/org/tools.org: Use org-babel instead of macros for release version and links. --- doc/org/index.org | 2 +- doc/org/init.el.in | 2 +- doc/org/install.org | 4 ++-- doc/org/setup.org | 20 ++++++++++++++++---- doc/org/tools.org | 6 +++--- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/doc/org/index.org b/doc/org/index.org index 9af23dba4..08fa16a3d 100644 --- a/doc/org/index.org +++ b/doc/org/index.org @@ -37,7 +37,7 @@ checking. It has the following notable features: * Latest version -The latest version is *{{{LASTRELEASE}}}* and was released on +The latest version is *call_SPOT_VERSION()* and was released on *{{{LASTDATE}}}*. Please see the [[file:install.org][download and installation instructions]]. * Documentation diff --git a/doc/org/init.el.in b/doc/org/init.el.in index 4258a95f7..c46363096 100644 --- a/doc/org/init.el.in +++ b/doc/org/init.el.in @@ -160,7 +160,7 @@ up.html points to index.html, then the result is: (setq body res) (not cmp))) (concat "#+TITLE: " title - "\n#+SETUPFILE: setup.org\n#+HTML_LINK_UP: index.html\n\n" + "\n#+INCLUDE: setup.org\n#+HTML_LINK_UP: index.html\n\n" body))) (setq org-publish-project-alist diff --git a/doc/org/install.org b/doc/org/install.org index dc492af57..b65c02074 100644 --- a/doc/org/install.org +++ b/doc/org/install.org @@ -9,9 +9,9 @@ :CUSTOM_ID: tar :END: -The latest release of Spot is version {{{LASTRELEASE}}}: +The latest release of Spot is version call_SPOT_VERSION() and was released on {{{LASTDATE}}}: -- {{{LASTTARBALL}}} (see also the {{{LASTNEWS}}}) +- call_TARBALL_LINK() (see also the call_NEWS_LINK()) Past releases can be found [[https://www.lrde.epita.fr/dload/spot/][in the same directory]]. If you are interested in /future/ releases, you can always peek at the [[https://gitlab.lre.epita.fr/spot/spot/-/jobs/artifacts/next/browse?job=make-dist][last diff --git a/doc/org/setup.org b/doc/org/setup.org index 7b6a4fa70..974272774 100644 --- a/doc/org/setup.org +++ b/doc/org/setup.org @@ -1,11 +1,23 @@ #+OPTIONS: H:2 num:nil toc:t html-postamble:nil ^:nil #+EMAIL: spot@lrde.epita.fr #+HTML_LINK_HOME: index.html -#+MACRO: SPOTVERSION 2.11.4 -#+MACRO: LASTRELEASE 2.11.4 -#+MACRO: LASTTARBALL [[http://www.lrde.epita.fr/dload/spot/spot-2.11.3.tar.gz][=spot-2.11.4.tar.gz=]] -#+MACRO: LASTNEWS [[https://gitlab.lre.epita.fr/spot/spot/blob/spot-2-11-3/NEWS][summary of the changes]] #+MACRO: LASTDATE 2023-02-10 +#+NAME: SPOT_VERSION +#+BEGIN_SRC python :exports none :results value :wrap org +return "2.11.4" +#+END_SRC + +#+NAME: TARBALL_LINK +#+BEGIN_SRC python :exports none :var version=SPOT_VERSION :results output :wrap org + print(f"[[http://www.lrde.epita.fr/dload/spot/spot-{version}.tar.gz][=spot-{version}.tar.gz=]]") +#+END_SRC + +#+NAME: NEWS_LINK +#+BEGIN_SRC python :exports none :var version=SPOT_VERSION :results output :wrap org + version = version.replace('.', '-') + print(f"[[https://gitlab.lre.epita.fr/spot/spot/blob/spot-{version}/NEWS][summary of the changes]]") +#+END_SRC + #+ATTR_HTML: :id spotlogo [[file:spot2.svg]] diff --git a/doc/org/tools.org b/doc/org/tools.org index 5227f1b4e..46ca38ccd 100644 --- a/doc/org/tools.org +++ b/doc/org/tools.org @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -#+TITLE: Command-line tools installed by Spot {{{SPOTVERSION}}} -#+DESCRIPTION: List of all the command-line tools installed by Spot {{{SPOTVERSION}}} #+INCLUDE: setup.org +#+TITLE: Command-line tools installed by Spot +#+DESCRIPTION: List of all the command-line tools installed by Spot #+HTML_LINK_UP: index.html #+PROPERTY: header-args:sh :results verbatim :exports both This document introduces command-line tools that are installed with -the Spot library. We give some examples to highlight possible +Spot call_SPOT_VERSION(). We give some examples to highlight possible use-cases but shall not attempt to cover all features exhaustively (please check the man pages for further inspiration).