mirror of
https://git.rtems.org/rtems-docs/
synced 2025-05-15 07:16:37 +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'
|
version = '1.0'
|
||||||
release = '5.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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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_use_parts = True
|
||||||
|
|
||||||
latex_additional_files = ['rtems.sty', 'logo.pdf']
|
latex_additional_files = ['../common/rtemsstyle.sty', '../common/logo.pdf']
|
||||||
|
|
||||||
latex_use_modindex = False
|
latex_use_modindex = False
|
||||||
|
|
||||||
|
@ -33,13 +33,40 @@ class spell(BuildContext):
|
|||||||
|
|
||||||
|
|
||||||
def cmd_configure(ctx):
|
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)
|
ctx.find_program("aspell", var="BIN_ASPELL", mandatory=False)
|
||||||
|
|
||||||
|
|
||||||
def cmd_build(ctx, conf_dir=".", source_dir="."):
|
def cmd_build(ctx, conf_dir=".", source_dir="."):
|
||||||
srcnode = ctx.srcnode.abspath()
|
srcnode = ctx.srcnode.abspath()
|
||||||
|
|
||||||
# Copy resources.
|
if ctx.options.pdf:
|
||||||
|
|
||||||
|
ctx(
|
||||||
|
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.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"]:
|
for dir in ["_static", "_templates"]:
|
||||||
files = ctx.path.parent.find_node("common").ant_glob("%s/*" % dir)
|
files = ctx.path.parent.find_node("common").ant_glob("%s/*" % dir)
|
||||||
ctx.path.get_bld().make_node(dir).mkdir() # dirs
|
ctx.path.get_bld().make_node(dir).mkdir() # dirs
|
||||||
@ -58,8 +85,12 @@ def cmd_build(ctx, conf_dir=".", source_dir="."):
|
|||||||
target = ctx.path.find_or_declare('html/index.html')
|
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):
|
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):
|
def cmd_configure_path(ctx):
|
||||||
|
@ -6,3 +6,7 @@ from conf import *
|
|||||||
version = '1.0'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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'
|
version = '1.0'
|
||||||
release = '5.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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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'
|
version = '1.0'
|
||||||
release = '5.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
|
from os.path import abspath
|
||||||
path.append(abspath('../common/'))
|
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