2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-25 11:27:46 +00:00

23 Commits

Author SHA1 Message Date
Ben Pfaff
09fe18af2d xml2nroff: Fix formatting of action headers in ovs-actions(7) manpage.
The action headings were coming out all smashed together, like
"Theoutputaction".  This fixes them so that they appear correctly, like
"The output action".

The previous code stripped starting and ending spaces on a per-node
basis, so that "The ", "<code>output</code>", and " action" each got
stripped down to "The", "output", "action" after processing.  This
commit changes it so that stripping happens after concatenation, fixing
the problem.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-By: Timothy Redaelli <tredaelli@redhat.com>
Tested-By: Timothy Redaelli <tredaelli@redhat.com>
2021-05-06 09:56:42 -07:00
Ihar Hrachyshka
3865b07409 docs: handle multi line headers for nroff
Before the fix, headers split into multiple lines were producing bogus
quote characters in nroff output and failed to indent headers properly.

Specifically, it fixes a header and its indentation in
ovn-architecture(7).

Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2020-02-13 11:07:11 -08:00
Ben Pfaff
145a7e88bb python: Fix invalid escape sequences.
It appears that Python silently treats invalid escape sequences in
strings as literals, e.g. "\." is the same as "\\.".  Newer versions of
checkpatch complain, and it does seem reasonable to me to fix these.

Acked-by: Numan Siddique <nusiddiq@redhat.com>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-01-11 08:45:04 -08:00
Ben Pfaff
a31c38ad0b nroff: Fix fonts for h2, h3, h4.
Without this change, the fonts are wrong if a title contains formatting
like <code> or <var>.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-01-10 15:52:05 -08:00
Ben Pfaff
63187cff99 nroff: Increase width for .IP used for ordered lists.
The ordered lists that a .25in width produced looked OK in PostScript
or PDF output, but in text output every list item spanned two lines,
like this:

   1.
     First list item.
   2.
     Second list item.

With this change, they appear normally:

   1. First list item.
   2. Second list item.

Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-01-10 15:52:05 -08:00
Ben Pfaff
12b84d50e0 ovsdb: Improve documentation.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2017-12-14 11:21:42 -08:00
Jason Wessel
fa145f1a53 Python3 compatibility: fix integer problems
In python3 maxint is not defined, but maxsize is defined in both
python2 and python3.

The put_text() will not automatically use a value which came in as
float due to a pior math function and python3 will throw an exception.
The simple answer is to convert it with int() and move on.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-07-06 14:06:08 -07:00
Ben Pfaff
96fee5e0a2 ovs-fields: New manpage to document Open vSwitch and OpenFlow fields.
There is still plenty of opportunity for improvement, but this new
ovs-fields(7) manpage is much more comprehensive than ovs-ofctl(8)
could be.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2017-01-25 13:58:04 -08:00
Ben Pfaff
902323d32e nroff: Improve formatting of ASCII diagrams.
This makes diagrams in ASCII output look about as good as one might
reasonably expect, so that in ovn-architecture(7), for example, this:

. 9 bits: reserved (0)
. 15 bits: ingress port
. 16 bits: egress port
. 24 bits: datapath

now gets formatted as:

    9          15          16         24
+--------+------------+-----------+--------+
|reserved|ingress port|egress port|datapath|
+--------+------------+-----------+--------+
    0

which isn't perfect but certainly more evocative than a bulleted list.

This will be more useful in upcoming commits that start using diagrams more
frequently.

Signed-off-by: Ben Pfaff <blp@ovn.org>
2017-01-25 13:53:31 -08:00
Joe Stringer
44b8deff15 python: Fix nroff indentation for <dl> after <hN>.
When XML is used for writing manpages, in the case that there is a
header tag followed by <dl>, the nroff python utility indents the <dl>
tag (and children) an extra level which is unnecessary and makes the
formatting inconsistent between manpages written directly in nroff vs
manpages written in XML and converted to nroff. Fix the indentation by
removing the extraneous .RS / .RE tags added to generated nroff in this
case.

This fixes the formatting of ovn/utilities/ovn-nbctl.8 man page.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2017-01-06 12:38:01 -08:00
Russell Bryant
cb96c1b27e python: Convert dict iterators.
In Python 2, dict.items(), dict.keys(), and dict.values() returned a
list.  dict.iteritems(), dict.iterkeys(), and dict.itervalues() returned
an iterator.

As of Python 3, dict.iteritems(), dict.itervalues(), and dict.iterkeys()
are gone.  items(), keys(), and values() now return an iterator.

In the case where we want an iterator, we now use the six.iter*()
helpers.  If we want a list, we explicitly create a list from the
iterator.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2016-01-21 23:00:11 -05:00
Russell Bryant
37520ab386 python: Restrict line length to 79 chars.
Resolve pep8 error:

  E501 line too long (80 > 79 characters)

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2016-01-05 20:19:20 -05:00
Russell Bryant
bdca6c4b56 python: Resolve pep8 blank line errors.
Resolve pep8 errors E302 and E303:

  E302 expected 2 blank lines, found 1
  E303 too many blank lines (3)

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2016-01-05 18:13:47 -05:00
Russell Bryant
e8049bc5e8 python: Fix invalid varable/function references.
This code referred to "rows" where it meant to refer to "fetched_rows".
The patch resolves flake8 error:

  F821 undefined name 'rows'

python/build/nroff.py used a function fatal() that was not defined,
which raised the same type of error.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
2016-01-05 18:13:47 -05:00
Ben Pfaff
08258b507a nroff: Add support for <b>...</b> and <i>...</i> inline markup.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-09-29 16:57:09 -07:00
Ben Pfaff
41f17e52e0 nroff: Support inline XML inside <pre> blocks.
This is useful so that one can write, e.g.

<p>The following shows how to add 1 to variable <var>x</var>:</p>
<pre>
<var>x</var> = <var>x</var> + 1;
</pre>

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-09-29 16:56:32 -07:00
Ben Pfaff
dcd2143357 nroff: Allow comments in more contexts.
Reported-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
2015-08-26 08:54:09 -07:00
Ben Pfaff
d70bc2449c nroff: Add support for 'diagram' XML element for protocol headers.
This will be used in documentation for an upcoming change, to document
how Geneve OVN options are encoded.

The code in this change is from a series (not yet submitted) that makes
much more extensive use of it for documenting protocol headers.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-08-03 10:16:44 -07:00
Ben Pfaff
7202883c3a xml2nroff: Allow comments in block XML.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-12 15:38:48 -07:00
Ben Pfaff
4d9d1d9e72 nroff: Fix style of names.
The recommended Google Python style is multi_word_names, not
multiWordNames.

There are lots of other places where the style could be improved.
I started here because I was working in this code anyway and because
this code is only used at build time and not installed, so that it
can't break any third-party code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-07-06 21:05:51 -07:00
Ben Pfaff
7102846b86 nroff: Fix the escape of '.'.
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-06-23 11:06:51 -07:00
Ben Pfaff
d75ef07f40 ovn-nbctl: Take default database target from OVN_NB_DB in environment.
This makes life easier for testing at the point you start to separate your
environment into multiple machines.

Also work on the manpage a little.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
2015-06-16 08:23:12 -07:00
Ben Pfaff
7b8c46c8b5 ovsdb-doc: Factor out nroff formatting into a separate Python module.
This will make it cleaner to add another build-time program that generates
nroff from XML.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-02-19 11:11:30 -08:00