mirror of
https://git.rtems.org/rtems-docs/
synced 2025-05-14 07:39:15 +08:00
Add PDF generation support use with --pdf
This commit is contained in:
parent
0abc59dffc
commit
9b5801a6e6
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'book.tex', u'RTEMS Book', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'bsp_howto.tex', u'RTEMS BSP Howto Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
12
c_user/conf.py
Normal file
12
c_user/conf.py
Normal file
@ -0,0 +1,12 @@
|
||||
import sys, os
|
||||
sys.path.append(os.path.abspath('../common/'))
|
||||
|
||||
from conf import *
|
||||
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'c_user.tex', u'RTEMS C User Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -188,7 +188,7 @@ latex_elements = {
|
||||
|
||||
latex_use_parts = True
|
||||
|
||||
latex_additional_files = ['rtems.sty', 'logo.pdf']
|
||||
latex_additional_files = ['../common/rtemsstyle.sty', '../common/logo.pdf']
|
||||
|
||||
latex_use_modindex = False
|
||||
|
||||
|
@ -33,33 +33,64 @@ class spell(BuildContext):
|
||||
|
||||
|
||||
def cmd_configure(ctx):
|
||||
ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD")
|
||||
ctx.load('tex')
|
||||
|
||||
if not ctx.env.PDFLATEX:
|
||||
conf.fatal('The program LaTex is required')
|
||||
|
||||
ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory=True)
|
||||
# ctx.find_program("pdflatex", var="BIN_PDFLATEX", mandatory=True)
|
||||
ctx.find_program("aspell", var="BIN_ASPELL", mandatory=False)
|
||||
|
||||
|
||||
def cmd_build(ctx, conf_dir=".", source_dir="."):
|
||||
srcnode = ctx.srcnode.abspath()
|
||||
|
||||
# Copy resources.
|
||||
for dir in ["_static", "_templates"]:
|
||||
files = ctx.path.parent.find_node("common").ant_glob("%s/*" % dir)
|
||||
ctx.path.get_bld().make_node(dir).mkdir() # dirs
|
||||
if ctx.options.pdf:
|
||||
|
||||
ctx(
|
||||
features = "subst",
|
||||
is_copy = True,
|
||||
source = files,
|
||||
target = [ctx.bldnode.find_node(dir).get_bld().make_node(x.name) for x in files]
|
||||
rule = "${BIN_SPHINX_BUILD} -b latex -c %s -j %d -d build/doctrees %s build/latex" % (conf_dir, ctx.options.jobs, source_dir),
|
||||
cwd = ctx.path.abspath(),
|
||||
source = ctx.path.ant_glob('**/*.rst'),
|
||||
target = "latex/%s.tex" % ctx.path.name
|
||||
)
|
||||
|
||||
ctx(
|
||||
rule = "${BIN_SPHINX_BUILD} -b html -c %s -j %d -d build/doctrees %s build/html" % (conf_dir, ctx.options.jobs, source_dir),
|
||||
cwd = ctx.path.abspath(),
|
||||
source = ctx.path.ant_glob('**/*.rst'),# + ctx.path.ant_glob('conf.py'),
|
||||
target = ctx.path.find_or_declare('html/index.html')
|
||||
)
|
||||
ctx.add_group()
|
||||
|
||||
ctx(
|
||||
features = 'tex',
|
||||
cwd = "%s/latex/" % ctx.path.get_bld().abspath(),
|
||||
type = 'pdflatex',
|
||||
source = ctx.bldnode.find_or_declare("latex/%s.tex" % ctx.path.name),
|
||||
prompt = 0
|
||||
)
|
||||
|
||||
else:
|
||||
# Copy HTML resources.
|
||||
for dir in ["_static", "_templates"]:
|
||||
files = ctx.path.parent.find_node("common").ant_glob("%s/*" % dir)
|
||||
ctx.path.get_bld().make_node(dir).mkdir() # dirs
|
||||
|
||||
ctx(
|
||||
features = "subst",
|
||||
is_copy = True,
|
||||
source = files,
|
||||
target = [ctx.bldnode.find_node(dir).get_bld().make_node(x.name) for x in files]
|
||||
)
|
||||
|
||||
ctx(
|
||||
rule = "${BIN_SPHINX_BUILD} -b html -c %s -j %d -d build/doctrees %s build/html" % (conf_dir, ctx.options.jobs, source_dir),
|
||||
cwd = ctx.path.abspath(),
|
||||
source = ctx.path.ant_glob('**/*.rst'),# + ctx.path.ant_glob('conf.py'),
|
||||
target = ctx.path.find_or_declare('html/index.html')
|
||||
)
|
||||
|
||||
def cmd_options(ctx):
|
||||
ctx.add_option('--pdf', action='store_true', default=False, help="Build PDF.")
|
||||
|
||||
def cmd_options_path(ctx):
|
||||
ctx.add_option('--rtems-path-py', type='string', help="Path to py/ in RTEMS.")
|
||||
cmd_options(ctx)
|
||||
ctx.add_option('--rtems-path-py', type='string', help="Full path to py/ in RTEMS source repository.")
|
||||
|
||||
|
||||
def cmd_configure_path(ctx):
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'cpu_supplement.tex', u'RTEMS CPU Supplement Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'develenv.tex', u'RTEMS Development Environment Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'filesystem.tex', u'RTEMS Filesystem Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'networking.tex', u'RTEMS Networking Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'porting.tex', u'RTEMS Porting Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'posix1003_1.tex', u'RTEMS POSIX 1003_1 Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'posix_users.tex', u'RTEMS POSIX Users Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'rtemsconfig.tex', u'RTEMS RTEMS Config Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'shell.tex', u'RTEMS Shell Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
@ -6,3 +6,7 @@ from conf import *
|
||||
version = '1.0'
|
||||
release = '5.0'
|
||||
|
||||
latex_documents = [
|
||||
('index', 'user.tex', u'RTEMS User Documentation', u'RTEMS Documentation Project', 'manual'),
|
||||
]
|
||||
|
||||
|
@ -2,10 +2,5 @@ from sys import path
|
||||
from os.path import abspath
|
||||
path.append(abspath('../common/'))
|
||||
|
||||
from waf import cmd_configure, cmd_build, spell, cmd_spell
|
||||
from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
|
||||
|
||||
def configure(ctx):
|
||||
cmd_configure(ctx)
|
||||
|
||||
def build(ctx):
|
||||
cmd_build(ctx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user