public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/sphinx-v7)] fixup! sphinx, ada: port to Sphinx
Date: Mon, 26 Sep 2022 13:37:00 +0000 (GMT)	[thread overview]
Message-ID: <20220926133700.1B8063858004@sourceware.org> (raw)

https://gcc.gnu.org/g:f4802feb2426496cd950a2444c24b6e24c76c915

commit f4802feb2426496cd950a2444c24b6e24c76c915
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Sep 26 15:35:21 2022 +0200

    fixup! sphinx,ada: port to Sphinx

Diff:
---
 gcc/ada/doc/gnat-style/conf.py   |  2 +-
 gcc/ada/doc/gnat_rm/conf.py      |  2 +-
 gcc/ada/doc/gnat_ugn/conf.py     |  2 +-
 gcc/ada/doc/share/adabaseconf.py | 18 +++++++-----------
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/gcc/ada/doc/gnat-style/conf.py b/gcc/ada/doc/gnat-style/conf.py
index ab2edf58968..6c2ef2aeb38 100644
--- a/gcc/ada/doc/gnat-style/conf.py
+++ b/gcc/ada/doc/gnat-style/conf.py
@@ -8,7 +8,7 @@ from adabaseconf import *
 project = 'GNAT Coding Style: A Guide for GNAT Developers'
 authors = 'AdaCore'
 
-set_latex_elements(project)
+set_latex_elements(latex_elements, project)
 
 # Grouping the document tree into Texinfo files. List of tuples
 # (source start file, target name, title, author,
diff --git a/gcc/ada/doc/gnat_rm/conf.py b/gcc/ada/doc/gnat_rm/conf.py
index 2d04d40c344..e3de6bd46b4 100644
--- a/gcc/ada/doc/gnat_rm/conf.py
+++ b/gcc/ada/doc/gnat_rm/conf.py
@@ -8,7 +8,7 @@ from adabaseconf import *
 project = 'GNAT Reference Manual'
 authors = 'AdaCore'
 
-set_latex_elements(project)
+set_latex_elements(latex_elements, project)
 
 # Grouping the document tree into Texinfo files. List of tuples
 # (source start file, target name, title, author,
diff --git a/gcc/ada/doc/gnat_ugn/conf.py b/gcc/ada/doc/gnat_ugn/conf.py
index f4a4a058156..9ebaf49f64e 100644
--- a/gcc/ada/doc/gnat_ugn/conf.py
+++ b/gcc/ada/doc/gnat_ugn/conf.py
@@ -8,7 +8,7 @@ from adabaseconf import *
 project = "GNAT User's Guide for Native Platforms"
 authors = 'AdaCore'
 
-set_latex_elements(project)
+set_latex_elements(latex_elements, project)
 
 # Grouping the document tree into Texinfo files. List of tuples
 # (source start file, target name, title, author,
diff --git a/gcc/ada/doc/share/adabaseconf.py b/gcc/ada/doc/share/adabaseconf.py
index ce97ff80f7d..4a80a838c63 100644
--- a/gcc/ada/doc/share/adabaseconf.py
+++ b/gcc/ada/doc/share/adabaseconf.py
@@ -15,7 +15,6 @@ import ada_latex_elements
 
 import ada_pygments
 
-texi_fsf = True  # Set to False when FSF doc is switched to sphinx by default
 gnatvsn_content = read_file('ada/gnatvsn.ads')
 
 
@@ -26,10 +25,7 @@ def get_gnat_version():
     if m:
         return m.group(1).strip()
     else:
-        if texi_fsf:
-            return ''
-        else:
-            return gcc_BASEVER
+        return gcc_BASEVER
 
 
 def get_gnat_build_type():
@@ -54,7 +50,7 @@ if os.path.isfile('adacore_transparent.png'):
 if os.path.isfile('favicon.ico'):
     html_favicon = 'favicon.ico'
 
-latex_additional_files = ['gnat.sty']
+latex_additional_files = ['../share/gnat.sty']
 
 copyright_macros = {
     'date': time.strftime('%b %d, %Y'),
@@ -65,19 +61,19 @@ copyright_macros = {
     'version': version}
 
 
-def set_latex_elements(title):
-    global latex_elements
-
-    latex_elements = {
+def set_latex_elements(latex_elements, title):
+    elements = {
         'preamble': '\\usepackage{gnat}\n' +
         ada_latex_elements.TOC_DEPTH +
         ada_latex_elements.PAGE_BLANK +
         ada_latex_elements.TOC_CMD +
         ada_latex_elements.LATEX_HYPHEN +
-        ada_latex_elements.ENCLOSE +
         ada_latex_elements.doc_settings(title, get_gnat_version()),
         'tableofcontents': ada_latex_elements.TOC % copyright_macros
     }
+    for key, value in elements.items():
+        latex_elements.setdefault(key, '')
+        latex_elements[key] += value
 
 
 def setup(app):

                 reply	other threads:[~2022-09-26 13:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220926133700.1B8063858004@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).