Skip to content

Commit

Permalink
(small edits) (repository wide)
Browse files Browse the repository at this point in the history
  • Loading branch information
openandclose committed Aug 19, 2020
1 parent 4cad4e3 commit 6f3f208
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
24 changes: 10 additions & 14 deletions docs/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ General Section
checking strange extensions is a bit of work.
But I'm afraid sometimes it gets in the way.

(An example I found: some old unix software uses ``README.doc`` for README.)
(An example I found: some old unix software uses ``doc`` extension for text (like ``README.doc``).

.. confopt:: add_clean_tags \*

Expand Down Expand Up @@ -458,7 +458,8 @@ General Section
Run arbitrary command before each ``extract``.

There is a sample hook extractor for man pages. See `_man <topics.html#man>`__.
There are sample hook extractors.
See `_man <topics.html#man>`__ and `_pcode <topics.html#pcode>`__.

.. confopt:: post_each_cmd2

Expand Down Expand Up @@ -642,10 +643,6 @@ and only the options of that converter's section are used.
The files must be in ``css directory``,
just the filenames (not full path).

The script includes sample css ``sample.t.css``,
and as a special case, it can be abbreviated as ``sample``
(default).

.. confopt:: cnvopts

| (None)
Expand Down Expand Up @@ -738,14 +735,13 @@ So section names themselves can be arbitrary.
After ``select`` and ``exclude``, arbitrary functions can be called
if this option is specified.

**Selection**:

The functions must be top level ones.

It is searched in `user process directory <overview.html#dword-process_directory>`__
and the program's process directory, in order.

(The program includes ``sample.py``.
See `process.sample <api.html#module-tosixinch.process.sample>`__.)

If the function name is found in multiple modules
in user process directory, the program raises Error.

Expand All @@ -754,6 +750,8 @@ So section names themselves can be arbitrary.
the program interprets it as ``<module name>.<function name>``.
Two or more dots are not supported.

**Invocation**:

The first argument of the functions is always ``doc``,
which the program provides.
It is ``lxml.html`` DOM object (``HtmlElement``),
Expand All @@ -763,7 +761,7 @@ So section names themselves can be arbitrary.
The function can have additional arguments.
String after ``'?'`` (and before next ``'?'``) is interpreted as an argument.

For example, ``'aaa.bbb?cc?dd'`` is made into code
For example, ``'aaa.bbb?cc?dd'`` is made into code,
if ``'aaa.bbb'`` is found in user process directory:

.. code-block:: none
Expand All @@ -780,11 +778,9 @@ So section names themselves can be arbitrary.
just manipulate ``doc`` as you like.
The script uses the resultant ``doc`` subsequently.

See `API/process <api.html#process>`__ for included sample functions.

---
See `process.sample <api.html#module-tosixinch.process.sample>`__ for included sample functions.

An Example:
**Example**:

Let's say you want to change ``h3`` tag to ``div`` for http://somesite.com.

Expand Down
5 changes: 4 additions & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,10 @@ Users have to fill the value accordingly, if setting.

``'0'``, ``'no'``, ``'false'`` and ``'off'`` are interpreted as ``False``.

It accepts only one of the eight (case insensitive).
``''`` is interpreted as ``None``
(the same as ``False`` in many contexts. Normally do not use it. ).

It accepts only one of the nine (case insensitive).

.. dword:: COMMA

Expand Down
9 changes: 5 additions & 4 deletions docs/topics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,9 @@ It uses ``eval``, so be careful.)
**Running Module:**

If a command consists of one word, without 'dot',
and the module actually exists in `script directory <overview.html#dword-script_directory>`__,
the script runs the command as module internally
(as opposed to running it as a system subprocess).
and the file actually exists in `script directory <overview.html#dword-script_directory>`__,
the script runs the command as Python module internally
(as opposed to running it as an external system subprocess).

That is, if a cmd is ``['foo']``, for example::

Expand Down Expand Up @@ -527,7 +527,8 @@ In running subprocess, other return codes (not 0, 100, 101, 102) aborts the prog

In running module, any other return codes and values (not 0, 100, 101, 102)
are interpreted as 0.
(Python itself aborts the program if something went wrong.)
(It is to permit normal Python return value ``None``.
Python itself will abort the program if something goes wrong.)


Viewcmd
Expand Down
4 changes: 2 additions & 2 deletions tosixinch/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def add_cookie(cj, cookie):
return _add_cookie(cj, name, value, domain, path)


# file read and write ---------------------------
# file read and write ----------------------------

def make_directories(fname, on_error_exit=True):
if not _in_current_dir(fname):
Expand Down Expand Up @@ -199,7 +199,7 @@ def write(fname, text, platform=sys.platform):
return Writer(fname, text, platform).write()


# shell invocation ------------------------------
# shell invocation -------------------------------

def run_cmds(cmds, conf, site=None):
returncode = 0
Expand Down

0 comments on commit 6f3f208

Please sign in to comment.