mirror of
https://git.rtems.org/rtems-docs/
synced 2025-05-14 07:39:15 +08:00
Add 'waf linkcheck' to check external references.
This commit is contained in:
parent
9b495a2980
commit
ed3794ea39
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)")
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user