Changeset c935a2c in rtems-docs


Ignore:
Timestamp:
08/03/22 04:13:09 (17 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
e551cc7
Parents:
f4377b4
git-author:
Chris Johns <chrisj@…> (08/03/22 04:13:09)
git-committer:
Chris Johns <chrisj@…> (08/03/22 04:28:19)
Message:

building: Add support for an RTEMS version number

  • Support using a version number for RTEMS documentation

Updates #4695

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • README.txt

    rf4377b4 rc935a2c  
    505505   user prompt and '#' is a 'root' prompt.
    506506
     507   Do not embed the version or version major number in the literal
     508   commands or examples. Use the replacements listed in 10.
     509
    5075106. Use the directives for 'note', 'warning', and 'topic'. Do not add 'TIP',
    508511   'Important' or 'Warning' to the text. Let the mark-up language handle
     
    583586     gsoc         : https://devel.rtems.org/wiki/GSoC/
    584587     socis        : https://devel.rtems.org/wiki/SOCIS/
     588
     58910. Use the following to embed the version number in any part of the
     590    documentation source:
     591
     592     1. @rtems-version@
     593
     594        The complete version string of the documentation.
     595
     596     2. @rtems-ver-major@
     597
     598        The version major number.
     599
     600     2. @rtems-ver-minor@
     601
     602        The version minor number.
     603
     604     2. @rtems-ver-revision@
     605
     606        The version revision number.
     607
     608    The replacement happens during the source read phase of the build
     609    and is not context specific. The subsituation will happen in code
     610    blocks and other normally quoated area.
     611
     612    It is a requirement these be used then embedded commands or
     613    related text in the documentation to let the documentatoin track
     614    the release. For example `microblaze-rtems6-gdb` should be written
     615    as `microblaze-rtems@rtems-ver-major@-gdb`.
  • common/conf.py

    rf4377b4 rc935a2c  
    1 import version as rtems_version
     1import datetime
    22
    33extensions = [
     
    3131# General information about the project.
    3232project = u'RTEMS Documentation Project'
    33 copyright = u'1988, 2020 RTEMS Project and contributors'
     33copyright = u'1988, ' + str(datetime.datetime.now().year) + ' RTEMS Project and contributors'
    3434
    3535# The version info for the project you're documenting, acts as replacement for
     
    3838#
    3939# The short X.Y version.
    40 version = rtems_version.version()
     40#version = rtems_version.version()
    4141
    4242# The full version, including alpha/beta/rc tags.
    43 release = rtems_version.string()
    44 
    45 major = rtems_version.major()
    46 minor = rtems_version.minor()
    47 revision = rtems_version.revision()
     43#release = rtems_version.string()
    4844
    4945# The language for content autogenerated by Sphinx. Refer to documentation
  • common/rtemsdomain.py

    rf4377b4 rc935a2c  
    88from sphinx.util.nodes import make_refnode
    99from sphinx.util.docfields import Field, TypedField
     10
     11import version as rtems_version
    1012
    1113"""
     
    3133
    3234role_url = {
    33         "trac":                         ("Trac",                                "https://devel.rtems.org"),
    34         "devel":                        ("Developer Site",              "https://devel.rtems.org"),
    35         "www":                          ("RTEMS Home",                  "https://www.rtems.org/"),
    36         "buildbot":                     ("Buildbot Instance",   "https://buildbot.rtems.org/"),
    37         "builder":                      ("Builder Site",                "https://builder.rtems.org/"),
    38         "docs":                         ("Documentation Site",  "https://docs.rtems.org/"),
    39         "lists":                        ("Mailing Lists",               "https://lists.rtems.org/"),
    40         "git":                          ("Git Repositories",    "https://git.rtems.org/"),
    41         "ftp":                          ("FTP File Server",     "https://ftp.rtems.org/"),
    42         "review":                       ("Gerrit Code Review",  "https://review.rtems.org/"),
    43         "bugs":                         ("Bugs Database",               "https://devel.rtems.org/wiki/Bugs/"),
    44         "gsoc":                         ("Google Summer of Code", "https://devel.rtems.org/wiki/GSoC/"),
    45         "socis":                        ("ESA SOCIS",                   "https://devel.rtems.org/wiki/SOCIS/")
     35        "trac":         ("Trac",                        "https://devel.rtems.org"),
     36        "devel":        ("Developer Site",              "https://devel.rtems.org"),
     37        "www":          ("RTEMS Home",                  "https://www.rtems.org/"),
     38        "buildbot":     ("Buildbot Instance",           "https://buildbot.rtems.org/"),
     39        "builder":      ("Builder Site",                "https://builder.rtems.org/"),
     40        "docs":         ("Documentation Site",          "https://docs.rtems.org/"),
     41        "lists":        ("Mailing Lists",               "https://lists.rtems.org/"),
     42        "git":          ("Git Repositories",            "https://git.rtems.org/"),
     43        "ftp":          ("FTP File Server",             "https://ftp.rtems.org/"),
     44        "review":       ("Gerrit Code Review",          "https://review.rtems.org/"),
     45        "bugs":         ("Bugs Database",               "https://devel.rtems.org/wiki/Bugs/"),
     46        "gsoc":         ("Google Summer of Code",       "https://devel.rtems.org/wiki/GSoC/"),
     47        "socis":        ("ESA SOCIS",                   "https://devel.rtems.org/wiki/SOCIS/")
    4648}
    4749
    4850
    4951role_list = {
    50         "announce":     ("Announce Mailing List",                       "https://lists.rtems.org/mailman/listinfo/announce/"),
    51         "bugs":         ("Bugs Mailing List",                           "https://lists.rtems.org/mailman/listinfo/bugs/"),
    52         "devel":        ("Developers Mailing List",                     "https://lists.rtems.org/mailman/listinfo/devel/"),
    53         "build":        ("Build Logs",                                  "https://lists.rtems.org/mailman/listinfo/build"),
    54         "users":        ("Users Mailing List",                          "https://lists.rtems.org/mailman/listinfo/users/"),
     52        "announce":     ("Announce Mailing List",               "https://lists.rtems.org/mailman/listinfo/announce/"),
     53        "bugs":         ("Bugs Mailing List",                   "https://lists.rtems.org/mailman/listinfo/bugs/"),
     54        "devel":        ("Developers Mailing List",             "https://lists.rtems.org/mailman/listinfo/devel/"),
     55        "build":        ("Build Logs",                          "https://lists.rtems.org/mailman/listinfo/build"),
     56        "users":        ("Users Mailing List",                  "https://lists.rtems.org/mailman/listinfo/users/"),
    5557        "vc":           ("Version Control Mailing List",        "https://lists.rtems.org/mailman/listinfo/vc/"),
    5658}
     
    120122
    121123
     124def rtems_replace(app, docname, source):
     125        dump = False
     126        line = source[0]
     127        for key in app.config.replacements:
     128                line = line.replace(key, app.config.replacements[key])
     129        source[0] = line
     130
     131replacements = {
     132}
    122133
    123134def setup(app):
     135        app.add_config_value('rtems_major', str(app.config.overrides['rtems_major']), True)
     136        app.add_config_value('rtems_minor', str(app.config.overrides['rtems_minor']), True)
     137        app.add_config_value('rtems_revision', str(app.config.overrides['rtems_revision']), True)
     138        major = str(app.config.overrides['rtems_major'])
     139        minor = str(app.config.overrides['rtems_minor'])
     140        revision = str(app.config.overrides['rtems_revision'])
     141        if revision.isdigit():
     142                majminrev = major + '.' + minor + '.' + revision
     143        else:
     144                majminrev = major + '.' + revision
     145        replacements["@rtems-version@"] = str(app.config.overrides['version'])
     146        replacements["@rtems-ver-major@"] = major
     147        replacements["@rtems-ver-minor@"] = minor
     148        replacements["@rtems-ver-revision@"] = revision
     149        replacements["@rtems-ver-majminrev@"] = majminrev
     150        app.add_config_value('replacements', replacements, True)
     151        app.connect('source-read', rtems_replace)
    124152        app.add_domain(RTEMSDomain)
    125153        return {'version': "1.0", 'parallel_read_safe': True}
  • common/version.py

    rf4377b4 rc935a2c  
    112112def get(ctx, rtems_major_version):
    113113    global _version
     114    global _major
     115    global _minor
     116    global _revision
    114117    global _date
    115118    global _released
     
    185188
    186189def revision():
    187     return revision
     190    return _revision
    188191
    189192def date():
Note: See TracChangeset for help on using the changeset viewer.