Changeset f916fca in rtems-docs


Ignore:
Timestamp:
01/18/16 22:53:44 (8 years ago)
Author:
Amar Takhar <amar@…>
Branches:
4.11, 5, master
Children:
4f81ff1
Parents:
d389819
git-author:
Amar Takhar <amar@…> (01/18/16 22:53:44)
git-committer:
Amar Takhar <verm@…> (05/03/16 00:51:24)
Message:

Add support for spellchecking with a custom dictionary.

To use:

  1. Install aspell
  2. waf spell <list of files>
    • waf spell mydoc.rst
    • waf spell *.rst

This uses a custom dictionary stored in common/spell/dict/. We should add all
RTEMS and programming terms to this to ensure we are consistent.

Amar.

Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • book/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure_path, cmd_build_path, cmd_options_path
     5from waf import cmd_configure_path, cmd_build_path, cmd_options_path, spell, cmd_spell
    66
    77
  • bsp_howto/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • c_user/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • common/waf.py

    rd389819 rf916fca  
    11import sys, os
     2from waflib.Build import BuildContext
    23
     4def cmd_spell(ctx):
     5        from waflib import Options
     6        from sys import argv
     7        from subprocess import call
     8
     9        Options.commands = None # stop warnings about knowing commands.
     10
     11        if not ctx.env.BIN_ASPELL:
     12                ctx.fatal("'aspell' is required please add binary to your path and re-run configure.")
     13
     14        if len(argv) < 3:
     15                ctx.fatal("Please supply at least one file name")
     16
     17        files = argv[2:]
     18
     19        path = ctx.path.parent.abspath()
     20
     21        # XXX: add error checking eg check if file exists.
     22        for file in files:
     23                cmd = ctx.env.BIN_ASPELL + ["-c", "--personal=%s/common/spell/dict/rtems" % path, "--extra-dicts=%s/common/spell/en_GB-ise-w_accents.multi" % path, file]
     24
     25                print "running:", cmd
     26                call(cmd)
     27
     28
     29class spell(BuildContext):
     30        __doc__ = "Check spelling.  Supply a list of files or a glob (*.rst)"
     31        cmd = 'spell'
     32        fun = 'cmd_spell'
    333
    434
    535def cmd_configure(ctx):
    6         ctx.find_program("sphinx-build", var="SPHINX_BUILD")
     36        ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD")
     37        ctx.find_program("aspell", var="BIN_ASPELL", mandatory=False)
    738
    839def cmd_build(ctx, conf_dir=".", source_dir="."):
     
    2253
    2354        ctx(
    24                 rule   = "${SPHINX_BUILD} -b html -c %s -j %d -d build/doctrees %s build/html" % (conf_dir, ctx.options.jobs, source_dir),
     55                rule   = "${BIN_SPHINX_BUILD} -b html -c %s -j %d -d build/doctrees %s build/html" % (conf_dir, ctx.options.jobs, source_dir),
    2556                cwd     = ctx.path.abspath(),
    2657                source =  ctx.path.ant_glob('**/*.rst'),# + ctx.path.ant_glob('conf.py'),
     
    6798
    6899        cmd_build(ctx, conf_dir="build", source_dir="build")
     100
     101
  • cpu_supplement/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • develenv/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • filesystem/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • networking/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • porting/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • posix1003_1/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • posix_users/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • rtemsconfig/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_options_path, cmd_configure_path, cmd_build_path
     5from waf import cmd_options_path, cmd_configure_path, cmd_build_path, spell, cmd_spell
    66
    77
  • shell/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
  • user/wscript

    rd389819 rf916fca  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure, cmd_build, spell, cmd_spell
    66
    77def configure(ctx):
Note: See TracChangeset for help on using the changeset viewer.