Changeset 9b5801a in rtems-docs


Ignore:
Timestamp:
01/19/16 05:27:45 (8 years ago)
Author:
Amar Takhar <amar@…>
Branches:
4.11, 5, master
Children:
14bbcb1
Parents:
0abc59d
git-author:
Amar Takhar <amar@…> (01/19/16 05:27:45)
git-committer:
Amar Takhar <verm@…> (05/03/16 00:51:24)
Message:

Add PDF generation support use with --pdf

Files:
1 added
25 edited
1 moved

Legend:

Unmodified
Added
Removed
  • book/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'book.tex', u'RTEMS Book', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • bsp_howto/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'bsp_howto.tex', u'RTEMS BSP Howto Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • bsp_howto/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • c_user/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • common/conf.py

    r0abc59d r9b5801a  
    189189latex_use_parts = True
    190190
    191 latex_additional_files = ['rtems.sty', 'logo.pdf']
     191latex_additional_files = ['../common/rtemsstyle.sty', '../common/logo.pdf']
    192192
    193193latex_use_modindex = False
  • common/waf.py

    r0abc59d r9b5801a  
    3434
    3535def cmd_configure(ctx):
    36         ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD")
     36        ctx.load('tex')
     37
     38        if not ctx.env.PDFLATEX:
     39                conf.fatal('The program LaTex is required')
     40
     41        ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory=True)
     42#       ctx.find_program("pdflatex", var="BIN_PDFLATEX", mandatory=True)
    3743        ctx.find_program("aspell", var="BIN_ASPELL", mandatory=False)
     44
    3845
    3946def cmd_build(ctx, conf_dir=".", source_dir="."):
    4047        srcnode = ctx.srcnode.abspath()
    4148
    42         # Copy resources.
    43         for dir in ["_static", "_templates"]:
    44                 files = ctx.path.parent.find_node("common").ant_glob("%s/*" % dir)
    45                 ctx.path.get_bld().make_node(dir).mkdir() # dirs
     49        if ctx.options.pdf:
    4650
    4751                ctx(
    48                         features    = "subst",
    49                         is_copy     = True,
    50                         source      = files,
    51                         target      = [ctx.bldnode.find_node(dir).get_bld().make_node(x.name) for x in files]
     52                        rule    = "${BIN_SPHINX_BUILD} -b latex -c %s -j %d -d build/doctrees %s build/latex" % (conf_dir, ctx.options.jobs, source_dir),
     53                        cwd             = ctx.path.abspath(),
     54                        source  = ctx.path.ant_glob('**/*.rst'),
     55                        target  = "latex/%s.tex" % ctx.path.name
    5256                )
    5357
    54         ctx(
    55                 rule   = "${BIN_SPHINX_BUILD} -b html -c %s -j %d -d build/doctrees %s build/html" % (conf_dir, ctx.options.jobs, source_dir),
    56                 cwd     = ctx.path.abspath(),
    57                 source =  ctx.path.ant_glob('**/*.rst'),# + ctx.path.ant_glob('conf.py'),
    58                 target = ctx.path.find_or_declare('html/index.html')
    59         )
     58                ctx.add_group()
     59
     60                ctx(
     61                        features        = 'tex',
     62                        cwd                     = "%s/latex/" % ctx.path.get_bld().abspath(),
     63                        type            = 'pdflatex',
     64                        source          = ctx.bldnode.find_or_declare("latex/%s.tex" % ctx.path.name),
     65                        prompt          = 0
     66                )
     67
     68        else:
     69        # Copy HTML resources.
     70                for dir in ["_static", "_templates"]:
     71                        files = ctx.path.parent.find_node("common").ant_glob("%s/*" % dir)
     72                        ctx.path.get_bld().make_node(dir).mkdir() # dirs
     73
     74                        ctx(
     75                                features    = "subst",
     76                                is_copy     = True,
     77                                source      = files,
     78                                target      = [ctx.bldnode.find_node(dir).get_bld().make_node(x.name) for x in files]
     79                        )
     80
     81                ctx(
     82                        rule   = "${BIN_SPHINX_BUILD} -b html -c %s -j %d -d build/doctrees %s build/html" % (conf_dir, ctx.options.jobs, source_dir),
     83                        cwd     = ctx.path.abspath(),
     84                        source =  ctx.path.ant_glob('**/*.rst'),# + ctx.path.ant_glob('conf.py'),
     85                        target = ctx.path.find_or_declare('html/index.html')
     86                )
     87
     88def cmd_options(ctx):
     89        ctx.add_option('--pdf', action='store_true', default=False, help="Build PDF.")
    6090
    6191def cmd_options_path(ctx):
    62         ctx.add_option('--rtems-path-py', type='string', help="Path to py/ in RTEMS.")
     92        cmd_options(ctx)
     93        ctx.add_option('--rtems-path-py', type='string', help="Full path to py/ in RTEMS source repository.")
    6394
    6495
  • cpu_supplement/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'cpu_supplement.tex', u'RTEMS CPU Supplement Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • cpu_supplement/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • develenv/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'develenv.tex', u'RTEMS Development Environment Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • develenv/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • filesystem/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'filesystem.tex', u'RTEMS Filesystem Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • filesystem/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • networking/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'networking.tex', u'RTEMS Networking Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • networking/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • porting/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'porting.tex', u'RTEMS Porting Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • porting/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • posix1003_1/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'posix1003_1.tex', u'RTEMS POSIX 1003_1 Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • posix1003_1/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • posix_users/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'posix_users.tex', u'RTEMS POSIX Users Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • posix_users/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • rtemsconfig/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'rtemsconfig.tex', u'RTEMS RTEMS Config Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • shell/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'shell.tex', u'RTEMS Shell Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • shell/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
  • user/conf.py

    r0abc59d r9b5801a  
    77release = '5.0'
    88
     9latex_documents = [
     10        ('index', 'user.tex', u'RTEMS User Documentation', u'RTEMS Documentation Project', 'manual'),
     11]
     12
  • user/wscript

    r0abc59d r9b5801a  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build, spell, cmd_spell
     5from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
    66
    7 def configure(ctx):
    8         cmd_configure(ctx)
    9 
    10 def build(ctx):
    11         cmd_build(ctx)
Note: See TracChangeset for help on using the changeset viewer.