public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-07 13:00 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-07 13:00 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1b682d4a33213cd83381fdcb68c8d1c16bea9e2e

commit 1b682d4a33213cd83381fdcb68c8d1c16bea9e2e
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 60 ++++++++++++++++++++++++---------------------------------
 1 file changed, 25 insertions(+), 35 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..d3945180202 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -207,7 +197,7 @@ INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/_build/html/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +216,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
                                                '/_build/html/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-08 14:42 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-08 14:42 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:156c7c7d21271b782a8115b354da91cccd4be0a5

commit 156c7c7d21271b782a8115b354da91cccd4be0a5
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 75 ++++++++++++++++++++++++---------------------------------
 1 file changed, 31 insertions(+), 44 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..f80fdabc8b0 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -181,13 +171,10 @@ OuterLinkColor={rgb}{0.0, 0.2, 0.6},
 
 latex_table_style = ['colorrows']
 
-texinfo_cross_references = False
+# makeindex is much common on older systems
+latex_use_xindy = False
 
-texinfo_elements = {'preamble': """
-@definfoenclose strong,*,*
-@definfoenclose emph,','
-"""
-}
+texinfo_cross_references = False
 
 # Use default as RTD theme uses default as well
 pygments_style = 'bw' if MONOCHROMATIC else 'default'
@@ -201,13 +188,13 @@ linkcheck_ignore = [
 ]
 
 USER_LEVEL_DOCS = ('install', 'gcc', 'gfortran', 'cpp', 'gnat_rm', 'gnat_ugn',
-                   'gccgo', 'libgomp', 'libquadmath', 'libgccjit')
-INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
+                   'gccgo', 'gdc', 'libgomp', 'libquadmath', 'libitm', 'libgccjit')
+INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style', 'libiberty')
 
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +213,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-08 14:35 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-08 14:35 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:19b05a8daf89cab0a9f61347bee9d11b336bb986

commit 19b05a8daf89cab0a9f61347bee9d11b336bb986
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 75 ++++++++++++++++++++++++---------------------------------
 1 file changed, 31 insertions(+), 44 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..f80fdabc8b0 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -181,13 +171,10 @@ OuterLinkColor={rgb}{0.0, 0.2, 0.6},
 
 latex_table_style = ['colorrows']
 
-texinfo_cross_references = False
+# makeindex is much common on older systems
+latex_use_xindy = False
 
-texinfo_elements = {'preamble': """
-@definfoenclose strong,*,*
-@definfoenclose emph,','
-"""
-}
+texinfo_cross_references = False
 
 # Use default as RTD theme uses default as well
 pygments_style = 'bw' if MONOCHROMATIC else 'default'
@@ -201,13 +188,13 @@ linkcheck_ignore = [
 ]
 
 USER_LEVEL_DOCS = ('install', 'gcc', 'gfortran', 'cpp', 'gnat_rm', 'gnat_ugn',
-                   'gccgo', 'libgomp', 'libquadmath', 'libgccjit')
-INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
+                   'gccgo', 'gdc', 'libgomp', 'libquadmath', 'libitm', 'libgccjit')
+INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style', 'libiberty')
 
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +213,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-08 14:34 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-08 14:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4e616f472d4339829552ab1ced674a49a2b18627

commit 4e616f472d4339829552ab1ced674a49a2b18627
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 75 ++++++++++++++++++++++++---------------------------------
 1 file changed, 31 insertions(+), 44 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..eb93e4bb69d 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -181,13 +171,10 @@ OuterLinkColor={rgb}{0.0, 0.2, 0.6},
 
 latex_table_style = ['colorrows']
 
-texinfo_cross_references = False
+# makeindex is much common on older systems
+latex_use_xindy = False
 
-texinfo_elements = {'preamble': """
-@definfoenclose strong,*,*
-@definfoenclose emph,','
-"""
-}
+texinfo_cross_references = False
 
 # Use default as RTD theme uses default as well
 pygments_style = 'bw' if MONOCHROMATIC else 'default'
@@ -201,13 +188,13 @@ linkcheck_ignore = [
 ]
 
 USER_LEVEL_DOCS = ('install', 'gcc', 'gfortran', 'cpp', 'gnat_rm', 'gnat_ugn',
-                   'gccgo', 'libgomp', 'libquadmath', 'libgccjit')
-INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
+                   'gccgo', 'gdc', 'libgomp', 'libquadmath', 'libitm', 'libgccjit')
+INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style', 'libibery')
 
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +213,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-08 12:06 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-08 12:06 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:077d00e58d7120b7266e9371e974938738cb17c0

commit 077d00e58d7120b7266e9371e974938738cb17c0
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 71 +++++++++++++++++++++++----------------------------------
 1 file changed, 29 insertions(+), 42 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..2f97ca0a47b 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -181,13 +171,10 @@ OuterLinkColor={rgb}{0.0, 0.2, 0.6},
 
 latex_table_style = ['colorrows']
 
-texinfo_cross_references = False
+# makeindex is much common on older systems
+latex_use_xindy = False
 
-texinfo_elements = {'preamble': """
-@definfoenclose strong,*,*
-@definfoenclose emph,','
-"""
-}
+texinfo_cross_references = False
 
 # Use default as RTD theme uses default as well
 pygments_style = 'bw' if MONOCHROMATIC else 'default'
@@ -207,7 +194,7 @@ INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +213,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-08 11:38 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-08 11:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:875c62e40ba94f6a72e3b3db8f3591391e307c5c

commit 875c62e40ba94f6a72e3b3db8f3591391e307c5c
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 71 +++++++++++++++++++++++----------------------------------
 1 file changed, 29 insertions(+), 42 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..2f97ca0a47b 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -181,13 +171,10 @@ OuterLinkColor={rgb}{0.0, 0.2, 0.6},
 
 latex_table_style = ['colorrows']
 
-texinfo_cross_references = False
+# makeindex is much common on older systems
+latex_use_xindy = False
 
-texinfo_elements = {'preamble': """
-@definfoenclose strong,*,*
-@definfoenclose emph,','
-"""
-}
+texinfo_cross_references = False
 
 # Use default as RTD theme uses default as well
 pygments_style = 'bw' if MONOCHROMATIC else 'default'
@@ -207,7 +194,7 @@ INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +213,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-08 10:20 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-08 10:20 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5af0dacb78f0fca4e79e3933da09c9516d3a11d9

commit 5af0dacb78f0fca4e79e3933da09c9516d3a11d9
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 71 +++++++++++++++++++++++----------------------------------
 1 file changed, 29 insertions(+), 42 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..2f97ca0a47b 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -181,13 +171,10 @@ OuterLinkColor={rgb}{0.0, 0.2, 0.6},
 
 latex_table_style = ['colorrows']
 
-texinfo_cross_references = False
+# makeindex is much common on older systems
+latex_use_xindy = False
 
-texinfo_elements = {'preamble': """
-@definfoenclose strong,*,*
-@definfoenclose emph,','
-"""
-}
+texinfo_cross_references = False
 
 # Use default as RTD theme uses default as well
 pygments_style = 'bw' if MONOCHROMATIC else 'default'
@@ -207,7 +194,7 @@ INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +213,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-07 14:33 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-07 14:33 UTC (permalink / raw)
  To: gcc-cvs

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

commit fe5fcdfa08e85573fb55b715be5d5805847b3444
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 68 ++++++++++++++++++++++-----------------------------------
 1 file changed, 26 insertions(+), 42 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..3c26f2a5b3b 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -183,12 +173,6 @@ latex_table_style = ['colorrows']
 
 texinfo_cross_references = False
 
-texinfo_elements = {'preamble': """
-@definfoenclose strong,*,*
-@definfoenclose emph,','
-"""
-}
-
 # Use default as RTD theme uses default as well
 pygments_style = 'bw' if MONOCHROMATIC else 'default'
 
@@ -207,7 +191,7 @@ INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +210,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-07 14:18 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-07 14:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9bac3d4d5e85d5a5f83d6f19919a26d8ec396f01

commit 9bac3d4d5e85d5a5f83d6f19919a26d8ec396f01
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 70 ++++++++++++++++++++++-----------------------------------
 1 file changed, 27 insertions(+), 43 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..6993ba5eef6 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -183,12 +173,6 @@ latex_table_style = ['colorrows']
 
 texinfo_cross_references = False
 
-texinfo_elements = {'preamble': """
-@definfoenclose strong,*,*
-@definfoenclose emph,','
-"""
-}
-
 # Use default as RTD theme uses default as well
 pygments_style = 'bw' if MONOCHROMATIC else 'default'
 
@@ -200,14 +184,14 @@ linkcheck_ignore = [
     'https://github.com/.*#.*'
 ]
 
-USER_LEVEL_DOCS = ('install', 'gcc', 'gfortran', 'cpp', 'gnat_rm', 'gnat_ugn',
+USER_LEVEL_DOCS = ('install', 'gcc', 'fortran', 'cpp', 'gnat_rm', 'gnat_ugn',
                    'gccgo', 'libgomp', 'libquadmath', 'libgccjit')
 INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
 
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +210,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-07 14:06 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-07 14:06 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:233740b7049cc5af56edd0ccca188826a416cec0

commit 233740b7049cc5af56edd0ccca188826a416cec0
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 64 ++++++++++++++++++++++++---------------------------------
 1 file changed, 27 insertions(+), 37 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..47fa305c28b 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',
@@ -200,14 +190,14 @@ linkcheck_ignore = [
     'https://github.com/.*#.*'
 ]
 
-USER_LEVEL_DOCS = ('install', 'gcc', 'gfortran', 'cpp', 'gnat_rm', 'gnat_ugn',
+USER_LEVEL_DOCS = ('install', 'gcc', 'fortran', 'cpp', 'gnat_rm', 'gnat_ugn',
                    'gccgo', 'libgomp', 'libquadmath', 'libgccjit')
 INTERNAL_DOCS = ('gccint', 'cppinternals', 'gfc-internals', 'gnat-style')
 
 # Cross manual reference mapping
 intersphinx_mapping = {}
 for manual in USER_LEVEL_DOCS + INTERNAL_DOCS:
-    intersphinx_mapping[manual] = (f'https://splichal.eu/scripts/sphinx/{manual}/_build/html/', None)
+    intersphinx_mapping[manual] = (f'https://gcc.gnu.org/onlinedocs/{manual}/', None)
 
 # Custom references
 extlinks = {
@@ -226,5 +216,5 @@ def set_common(name, module):
         module['todo_include_todos'] = True
         module['tags'].add('development')
 
-    html_theme_options['source_edit_link'] = f'https://splichal.eu/scripts/sphinx/{name}' \
-                                               '/_build/html/_sources/{filename}.txt'
+    html_theme_options['source_edit_link'] = f'https://gcc.gnu.org/onlinedocs/{name}' \
+                                               '/_sources/{filename}.txt'

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file
@ 2022-11-07 12:37 Martin Liska
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Liska @ 2022-11-07 12:37 UTC (permalink / raw)
  To: gcc-cvs

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

commit aa8d1b621b3b43e00ed9496f03433d0ebf9c3c64
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Nov 7 12:59:25 2022 +0100

    sphinx: update baseconf.py file
    
    ChangeLog:
    
            * doc/baseconf.py: Port to GCC sources.

Diff:
---
 doc/baseconf.py | 56 +++++++++++++++++++++++---------------------------------
 1 file changed, 23 insertions(+), 33 deletions(-)

diff --git a/doc/baseconf.py b/doc/baseconf.py
index 2eea8298dae..d3a60d7dabc 100644
--- a/doc/baseconf.py
+++ b/doc/baseconf.py
@@ -11,7 +11,7 @@
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
 import os
-import subprocess
+import time
 import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
@@ -22,28 +22,16 @@ sys.setrecursionlimit(2000)
 
 # The full version, including alpha/beta/rc tags
 
-# FIXME
 folder = os.path.dirname(os.path.realpath(__file__))
-gcc_srcdir = os.path.join(folder, './objdir')
+gcc_srcdir = os.path.join(folder, '..', 'gcc')
 
-
-def __read_file(name):
+def read_file(name):
     path = os.path.join(gcc_srcdir, name)
     if os.path.exists(path):
         return open(path).read().strip()
     else:
         return ''
 
-
-def __get_git_revision():
-    try:
-        r = subprocess.check_output('git rev-parse --short HEAD', shell=True, encoding='utf8',
-                                    stderr=subprocess.DEVNULL)
-        return r.strip()
-    except subprocess.CalledProcessError:
-        return None
-
-
 def __get_builder_name():
     if '-b' in sys.argv:
         return sys.argv[sys.argv.index('-b') + 1]
@@ -51,15 +39,17 @@ def __get_builder_name():
         return None
 
 
-gcc_BASEVER = __read_file('BASE-VER')
-gcc_DEVPHASE = __read_file('DEV-PHASE')
-gcc_DATESTAMP = __read_file('DATESTAMP')
-gcc_REVISION = __read_file('REVISION')
+gcc_BASEVER = read_file('BASE-VER')
+gcc_DEVPHASE = read_file('DEV-PHASE')
+gcc_DATESTAMP = read_file('DATESTAMP')
+gcc_REVISION = read_file('REVISION')
 
-VERSION_PACKAGE = os.getenv('VERSION_PACKAGE', '(GCC)')
-BUGURL = os.getenv('BUGURL', 'https://gcc.gnu.org/bugs/')
+VERSION_PACKAGE = os.getenv('VERSION_PACKAGE')
+BUGURL = os.getenv('BUGURL')
 MONOCHROMATIC = os.getenv('MONOCHROMATIC')
 
+YEAR = time.strftime('%Y')
+
 # The short X.Y version.
 version = gcc_BASEVER
 
@@ -80,10 +70,14 @@ needs_sphinx = '5.3'
 
 rst_epilog = '''
 .. |gcc_version| replace:: %s
-.. |package_version| replace:: %s
-.. |bugurl| replace:: %s
-.. |needs_sphinx| replace:: %s
-''' % (gcc_BASEVER, VERSION_PACKAGE, BUGURL, needs_sphinx)
+.. |needs_sphinx| replace:: %s\n
+''' % (gcc_BASEVER, needs_sphinx)
+
+if BUGURL:
+    rst_epilog += '.. |bugurl| replace:: %s\n' % BUGURL
+
+if VERSION_PACKAGE:
+    rst_epilog += '.. |package_version| replace:: %s\n' % VERSION_PACKAGE
 
 # -- General configuration ---------------------------------------------------
 
@@ -130,18 +124,14 @@ html_theme_options = {
     'navigation_with_keys': True,
 }
 
-html_logo = '../logo.svg'
+html_logo = os.path.join(folder, 'logo.svg')
 
-html_favicon = '../favicon.ico'
+html_favicon = os.path.join(folder, 'favicon.ico')
 
 html_last_updated_fmt = ''
 
-html_context = {
-    'commit': __get_git_revision()
-}
-
 html_static_path = [
-    '../_static'
+    os.path.join(folder, '_static')
 ]
 
 html_css_files = [
@@ -159,7 +149,7 @@ suppress_warnings = [
 # Use xelatex by default
 latex_engine = 'xelatex'
 
-latex_logo = '../logo.pdf'
+latex_logo = os.path.join(folder, 'logo.pdf')
 
 latex_elements = {
     'pointsize': '11pt',

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-11-08 14:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-07 13:00 [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: update baseconf.py file Martin Liska
  -- strict thread matches above, loose matches on Subject: below --
2022-11-08 14:42 Martin Liska
2022-11-08 14:35 Martin Liska
2022-11-08 14:34 Martin Liska
2022-11-08 12:06 Martin Liska
2022-11-08 11:38 Martin Liska
2022-11-08 10:20 Martin Liska
2022-11-07 14:33 Martin Liska
2022-11-07 14:18 Martin Liska
2022-11-07 14:06 Martin Liska
2022-11-07 12:37 Martin Liska

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).