Changeset 5ce8e43 in rtems-docs


Ignore:
Timestamp:
Aug 21, 2018, 3:41:51 AM (11 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
471c5e3
Parents:
9bfda06
git-author:
Chris Johns <chrisj@…> (08/21/18 03:41:51)
git-committer:
Chris Johns <chrisj@…> (08/21/18 03:47:40)
Message:

build: Fix indexing so it works on HTML and PDF.

  • Remove all genindex.rst files, these are generated and should not exist in our source.
  • Fix the HTML templates so the local specialisation works.
  • Add a index link to the sidebar for HTML.

Note, there is no TOC entry for the index in the PDF output and I
cannot figure out how to add one.

Closes #3503

Files:
12 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • bsp-howto/index.rst

    r9bfda06 r5ce8e43  
    6262        command
    6363
    64         genindex
     64* :ref:`genindex`
  • c-user/index.rst

    r9bfda06 r5ce8e43  
    8484        zreferences
    8585
    86         genindex
     86* :ref:`genindex`
  • common/_templates/layout.html

    r9bfda06 r5ce8e43  
    11{# Import the theme's layout. #}
    22{% extends "!layout.html" %}
    3 
     3{% block sidebartitle %}
     4    <a href="https://docs.rtems.org/">RTEMS Documentation Project</a>
     5    {{ super() }}
     6{% endblock %}
     7{% block menu %}
     8  {{ super() }}
     9  <a class="reference internal" href="genindex.html">Index</a>
     10{% endblock %}
    411{# Custom CSS overrides #}
    5 {% set bootswatch_css_custom = ['_static/my-styles.css'] %}
     12{% set css_files = ['_static/my-styles.css'] %}
  • common/conf.py

    r9bfda06 r5ce8e43  
    3535
    3636# Add any paths that contain templates here, relative to this directory.
    37 templates_path = ['build/_templates']
     37#templates_path = ['build/_templates']
    3838
    3939# The suffix of source filenames.
     
    203203\newcommand{\rtemscopyright}{%s}
    204204\usepackage{rtemsstyle}
    205 ''' % (copyright)
     205''' % (copyright),
     206    'printindex': r'\footnotesize\raggedright\printindex',
     207    'parsedliteralwraps': True,
    206208}
    207209
  • common/rtemsstyle.sty

    r9bfda06 r5ce8e43  
    1010
    1111\renewenvironment{tabulary}{\underscoresplit\oldtabulary}{\endoldtabulary\endunderscoresplit}
    12 
    13 \let\oldprintindex\printindex
    14 
    15 \renewenvironment{printindex}{\underscoresplit\oldprintindex}
    1612
    1713\usepackage{minted}
  • common/sphinx_rtd_theme_rtems/layout.html

    r9bfda06 r5ce8e43  
    77  {%- set titlesuffix = "" %}
    88{%- endif %}
    9 
    10 {# Custom CSS overrides #}
    11 {% set extra_css_files = ['_static/my-styles.css'] %}
    129
    1310<!DOCTYPE html>
  • common/waf.py

    r9bfda06 r5ce8e43  
    1 import sys, os, re
     1#
     2# RTEMS Documentation Project
     3#
     4# Waf build support.
     5#
     6
     7
     8from __future__ import print_function
     9
     10import os
     11import re
     12import sys
     13
    214from waflib.Build import BuildContext
    315
     
    2537    return '-Drelease="%s" -Dversion="%s"' % (ctx.env.VERSION, ctx.env.VERSION)
    2638
    27 def sphinx_cmdline(ctx, build_type, conf_dir, doctrees, source_dir, output_dir):
    28     rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s ${SRC}" % \
     39def sphinx_cmdline(ctx, build_type, conf_dir, doctrees,
     40                   source_dir, output_dir, configs = []):
     41    cfgs = ''
     42    for c in configs:
     43        cfgs += ' -D %s=%s' % (c, configs[c])
     44    rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s %s ${SRC}" % \
    2945           (sphinx_verbose(ctx), build_type, conf_dir, version_cmdline(ctx),
    30             doctrees, source_dir, output_dir)
     46            doctrees, cfgs, source_dir, output_dir)
    3147    return rule
    3248
     
    141157    fnode.mkdir()
    142158    local_packages = latex.local_packages()
     159    targets = []
    143160    if local_packages is not None:
    144161        srcs = [os.path.join(base, p) for p in local_packages]
    145         ctx(
    146             features = "subst",
     162        targets += [fnode.make_node(p) for p in local_packages]
     163        ctx(features = "subst",
    147164            is_copy  = True,
    148165            source   = srcs,
    149             target   = [fnode.make_node(p) for p in local_packages]
    150         )
    151     ctx(
    152         features = "subst",
     166            target   = targets)
     167    targets += [fnode.make_node('rtemsextrafonts.sty')]
     168    ctx(features = "subst",
    153169        is_copy  = True,
    154170        source   = os.path.join(base, ctx.env.RTEMSEXTRAFONTS),
    155         target   = fnode.make_node('rtemsextrafonts.sty')
    156     )
     171        target   = fnode.make_node('rtemsextrafonts.sty'))
     172    return targets
    157173
    158174def html_resources(ctx, buildtype):
     175    extra_source = []
    159176    for dir_name in ["_static", "_templates"]:
    160177        files = ctx.path.parent.find_node("common").ant_glob("%s/*" % dir_name)
    161178        fnode = ctx.path.get_bld().make_node(os.path.join(buildtype, dir_name))
     179        targets = [fnode.make_node(x.name) for x in files]
     180        extra_source += targets
    162181        fnode.mkdir() # dirs
    163         ctx(
    164             features = "subst",
     182        ctx(features = "subst",
    165183            is_copy  = True,
    166184            source   = files,
    167             target   = [fnode.make_node(x.name) for x in files]
    168         )
    169 
    170     # copy images
    171 #    ctx.path.get_bld().make_node("images").mkdir()
    172 #    files = ctx.path.parent.ant_glob("images/**")
    173 #    ctx(
    174 #        features    = "subst",
    175 #        is_copy     = True,
    176 #        source      = files,
    177 #        target      = [x.srcpath().replace("../", "") for x in files]
    178 #    )
    179 
     185            target   = targets)
     186        ctx.add_group()
     187    return extra_source
    180188
    181189def check_sphinx_extension(ctx, extension):
     
    196204        ctx.fatal('The configuration failed')
    197205    ctx.end_msg('found')
    198 
    199206
    200207def cmd_configure(ctx):
     
    257264    buildtype = 'latex'
    258265    build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
    259     pdf_resources(ctx, buildtype)
     266    resources = pdf_resources(ctx, buildtype)
    260267    rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir)
    261268    ctx(
     
    263270        cwd          = ctx.path,
    264271        source       = ctx.path.ant_glob('**/*.rst') + extra_source,
     272        depends_on   = extra_source,
    265273        target       = ctx.path.find_or_declare("%s/%s.tex" % (buildtype,
    266274                                                               ctx.path.name))
     
    307315    buildtype = 'singlehtml'
    308316    build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
    309     html_resources(ctx, buildtype)
     317    resource = html_resources(ctx, buildtype)
    310318    rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir)
    311319    ctx(
     
    313321        cwd          = ctx.path,
    314322        source       = ctx.path.ant_glob('**/*.rst') + extra_source,
     323        depends_on   = resources,
    315324        target       = ctx.path.find_or_declare("%s/index.html" % (buildtype)),
    316325        install_path = None
     
    327336    buildtype = 'html'
    328337    build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
    329     html_resources(ctx, buildtype)
    330     rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir)
     338    resources = html_resources(ctx, buildtype)
     339    templates = os.path.join(str(ctx.path.get_bld()), buildtype, '_templates')
     340    configs = { 'templates_path': templates }
     341    rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir, configs)
    331342    ctx(
    332343        rule         = rule,
    333344        cwd          = ctx.path,
    334345        source       = ctx.path.ant_glob('**/*.rst') + extra_source,
     346        depends_on   = resources,
    335347        target       = ctx.path.find_or_declare('%s/index.html' % buildtype),
    336348        install_path = None
  • cpu-supplement/index.rst

    r9bfda06 r5ce8e43  
    6262        sparc64
    6363        zreferences
     64
     65* :ref:`genindex`
  • develenv/index.rst

    r9bfda06 r5ce8e43  
    4848        command
    4949
    50         genindex
     50* :ref:`genindex`
  • eclipse/index.rst

    r9bfda06 r5ce8e43  
    5151        glossary
    5252
    53         genindex
     53* :ref:`genindex`
  • filesystem/index.rst

    r9bfda06 r5ce8e43  
    5353        command_and_variable
    5454
    55         genindex
     55* :ref:`genindex`
  • networking/index.rst

    r9bfda06 r5ce8e43  
    5353        command
    5454
    55         genindex
     55* :ref:`genindex`
  • porting/index.rst

    r9bfda06 r5ce8e43  
    5555        command
    5656
    57         genindex
     57* :ref:`genindex`
  • posix-compliance/index.rst

    r9bfda06 r5ce8e43  
    4949        zreferences
    5050
    51         genindex
     51* :ref:`genindex`
  • posix-users/index.rst

    r9bfda06 r5ce8e43  
    6868        command
    6969
    70         genindex
     70* :ref:`genindex`
  • rsb/index.rst

    r9bfda06 r5ce8e43  
    6363        bug-reporting
    6464
    65         genindex
     65* :ref:`genindex`
  • shell/index.rst

    r9bfda06 r5ce8e43  
    5656        concept
    5757
    58         genindex
     58* :ref:`genindex`
  • user/index.rst

    r9bfda06 r5ce8e43  
    6060        glossary/index
    6161
    62         genindex
     62* :ref:`genindex`
Note: See TracChangeset for help on using the changeset viewer.