summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Takhar <amar@rtems.org>2016-01-19 23:00:32 -0500
committerAmar Takhar <verm@darkbeer.org>2016-05-02 20:51:25 -0400
commited3794ea3926f3e8ee801eae908bb7557cb30637 (patch)
treeaa77923cc3709e697670b7bf72765dbcc0f6d2fb
parent9b495a2980fa43ad2fad1ce478e6f983a54fb42f (diff)
downloadrtems-docs-ed3794ea3926f3e8ee801eae908bb7557cb30637.tar.bz2
Add 'waf linkcheck' to check external references.
-rw-r--r--bsp_howto/wscript2
-rw-r--r--c_user/wscript2
-rw-r--r--common/waf.py16
-rw-r--r--cpu_supplement/wscript2
-rw-r--r--develenv/wscript2
-rw-r--r--filesystem/wscript2
-rw-r--r--networking/wscript2
-rw-r--r--posix1003_1/wscript2
-rw-r--r--posix_users/wscript2
-rw-r--r--shell/wscript2
-rw-r--r--user/wscript2
11 files changed, 25 insertions, 11 deletions
diff --git a/bsp_howto/wscript b/bsp_howto/wscript
index 8d66b28..4a5f474 100644
--- a/bsp_howto/wscript
+++ b/bsp_howto/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/c_user/wscript b/c_user/wscript
index 8d66b28..4a5f474 100644
--- a/c_user/wscript
+++ b/c_user/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/common/waf.py b/common/waf.py
index ef92a71..faf7ed5 100644
--- a/common/waf.py
+++ b/common/waf.py
@@ -29,12 +29,27 @@ def cmd_spell(ctx):
call(cmd)
+def cmd_linkcheck(ctx, conf_dir=".", source_dir="."):
+ ctx(
+ rule = "${BIN_SPHINX_BUILD} -b linkcheck -c %s -j %d -d build/doctrees %s build/linkcheck" % (conf_dir, ctx.options.jobs, source_dir),
+ cwd = ctx.path.abspath(),
+ source = ctx.path.ant_glob('**/*.rst'),
+ target = "linkcheck/output.txt"
+ )
+
+
class spell(BuildContext):
__doc__ = "Check spelling. Supply a list of files or a glob (*.rst)"
cmd = 'spell'
fun = 'cmd_spell'
+class linkcheck(BuildContext):
+ __doc__ = "Check all external URL references."
+ cmd = 'linkcheck'
+ fun = 'cmd_linkcheck'
+
+
def check_sphinx_version(ctx, minver):
version = ctx.cmd_and_log(ctx.env.BIN_SPHINX_BUILD + ['--version']).split(" ")[-1:][0]
ver = tuple(map(int, version.split(".")))
@@ -79,7 +94,6 @@ def doc_pdf(ctx, source_dir, conf_dir):
prompt = 0
)
-
def doc_singlehtml(ctx, source_dir, conf_dir):
if not ctx.env.BIN_INLINER:
ctx.fatal("Node inliner is required install with 'npm install -g inliner' (https://github.com/remy/inliner)")
diff --git a/cpu_supplement/wscript b/cpu_supplement/wscript
index 8d66b28..4a5f474 100644
--- a/cpu_supplement/wscript
+++ b/cpu_supplement/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/develenv/wscript b/develenv/wscript
index 8d66b28..4a5f474 100644
--- a/develenv/wscript
+++ b/develenv/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/filesystem/wscript b/filesystem/wscript
index 8d66b28..4a5f474 100644
--- a/filesystem/wscript
+++ b/filesystem/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/networking/wscript b/networking/wscript
index 8d66b28..4a5f474 100644
--- a/networking/wscript
+++ b/networking/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/posix1003_1/wscript b/posix1003_1/wscript
index 8d66b28..4a5f474 100644
--- a/posix1003_1/wscript
+++ b/posix1003_1/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/posix_users/wscript b/posix_users/wscript
index 8d66b28..4a5f474 100644
--- a/posix_users/wscript
+++ b/posix_users/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/shell/wscript b/shell/wscript
index 8d66b28..4a5f474 100644
--- a/shell/wscript
+++ b/shell/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck
diff --git a/user/wscript b/user/wscript
index 8d66b28..4a5f474 100644
--- a/user/wscript
+++ b/user/wscript
@@ -2,5 +2,5 @@ from sys import path
from os.path import abspath
path.append(abspath('../common/'))
-from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options
+from waf import cmd_configure as configure, cmd_build as build, spell, cmd_spell, cmd_options as options, linkcheck, cmd_linkcheck