to <email>.
Can't do this globally. Some of the links are odd (i.e,. the link
is not their e-mail address but is their name, eg
<ulink url="mailto:nik@freebsd.org">Nik Clayton</ulink>
which would turn to
<email>Nik Clayton</email>
which isn't very useful. Ignore these ones, and do the others.
(i.e., the ones that look like
<ulink url="mailto:nik@freebsd.org">nik@freebsd.org</ulink>
)
This Emacs regexp does the job.
Search for: <ulink\s-+url="mailto[^>]+>\([^<]+\)</ulink>
Replace with: <email>\1</email>
Step 2. A lot of the <email>...</email> sets will have '<' and '>' embedded
in them (as entities). These can be removed, since the stylesheet
will add them;
Search for: <email><\([^&]+\)></email>
Replace with: <email>\1</email>
Step 3. The trick now is to turn
<ulink url="mailto:nik@freebsd.org">Nik Clayton</ulink>
into
Nik Clayton <email>nik@freebsd.org</email>
This step could (possibly) have been done first, and then steps
1 and 2 could be done globally. I haven't done this because of
concerns about the ordering of names within languages. This
transformation is fairly simple in English, I've no idea what
it's like in Japanese.
Search for: <ulink\s-+url="mailto:\([^"]+\)">\([^<]+\)</ulink>
Replace with: \2 <email>\1</email>
Step 4. Remove leading and trailing spaces that may have slipped in
Search for: <email>\s-+
Replace with: <email>
Search for: \s-+</email>
Replace with: </email>
<literal remap=..> -> <literal>
<command remap=..> -> <command>
Or deleted <emphasis ..> altogether in some cases.
More redundant <para>..</para>'s removed.
things.
I'm now working through from the beginning of the handbook to end,
correcting as I go. I'll commit in chunks of 5,000 lines (or
thereabouts).
Most of the changes fall into the following categories.
* <emphasis remap=bf> --> <emphasis>
* Spurious <para>s around <*list>s deleted (but not reformatted)
"C-c -" in Emacs SGML mode (when the point is on an element starting
or end tags) will delete that element's starting or end tags.
* Marked smileys with <!-- smiley --> for possible future deletion
* Deleting <emphasis>, around
<term><emphasis>...</emphasis></term> -> <term>...</term>
* Fine tuning markup choices in some cases
- <filename>C:</filename> -> <devicename>C:</devicename>
* Extra <note>s here and there.
* Some <*list>s to <procedure> (and <listitem>s to <step>)
* ASCII emphasis converted to <emphasis>
i.e., do it like *this* -> do it like <emphasis>this</emphasis>
* <symbol> -> <replaceable>
There are very few whitespace changes, although a few have probably
cropped up. The vast majority of the whitespace changes will happen in
one megacommit, hopefully some time next week.
This does the first 5,000 lines or so.
this (in Emacs) by searching for
\s-+</para>
and replacing with
</para>
Do this for all occurences *except* where the element immediately before
the </para> is one of <itemizedlist>, <orderedlist>, <variablelist>,
<procedure>. The <para>...</para> wrapping these elements is mostly
redundant, and will be removed later.
<para> There is some leading space here.</para>
Get rid of it, doing an emacs search/replace for
<para> +\([^ ]\)
and replacing with
<para>\1
This can be done globally.
Some parts of the handbook had single spaces after stops, some had double
or triple. While the typographical convention for monospaced fonts may
be to use double spaces after them, that doesn't apply here. TeX will
ignore them, as will HTML. If we need them for a plain text version of the
Handbook then the stylesheet / conversion mechanism can insert them
as necessary.
Searching for
_\([;:!\.\?,]\) +_
in Emacs and replacing with
_\1 _
(ignore the '_', they're just to delineate the regexps) does the job
quite nicely. However, you can't do this everywhere, since some of the
double spaces might be in program listings or other literal sections
(e.g., the BSD Copyright), so you need to sit and bounce on the 'y' or
'n' key as appropriate for each occurance of a stop.
In some cases <informalexample> wasn't appropriate, and the markup was
changed to <programlisting> or other.
In some cases there were spurious <para> elements before and after the
<informalexample>. These were removed.
Reformatted text within <screen> elements because the whitespace *is*
significant.
Added <prompt> and <userinput> elements within <screen> where necessary.
If I spotted inappropriate use of markup within the immediate vicinity
of the <informalexample> elements then I fixed that (mostly the use of
<emphasis remap="...">).
This is part one of these changes -- there's a load of them, and this
goes up to line 11,284 or thereabouts, roughly one third of the way
through.
contract, start contract, work too many hours per day) I'm back working
on the DocBook conversion :-)
Create two new entities, prompt.root and prompt.user. Use these where the
user is shown an OS prompt, to indicate whether they should be a normal
user or do it as root.
Everything else that looks like a prompt (e.g., C:\> which occurs here
and there) is also marked up as <prompt>.
and near it. Most of the time this consisted of replacing the <emphasis>
with <replaceable> or <userinput>. Sometimes <screen> is the wrong element
to use, and will need replacing with something like <programlisting> or
<literallayout>.
command(number)) from the variety of different existing markup
(which included <command>, <emphasis>, and <ulink>s to man2html
CGI scripts) to a common format, which is
<citerefentry>
<refentrytitle>command</refentrytitle>
<manvolnum>number</manvolnum>
</citerefentry>
although in the interests of keeping the changes as simple as possible
for the translators, the above was flattened on to one line.
to link to it any more, and the version on my website is currently more
up to date. An AltaVista search to see if any one else had linked to it
didn't turn up anything, so I think this is pretty safe. I'll 'cvs remove'
the directory and its files shortly.
them with the correct markup.
The only quotes left now are either around items for which I'm not 100%
sure which element to use, or in literal blocks as part of commands the
user types in.
so I can check my progress, partly so that others can offer comments on
the result of the conversion.
See <URL:http://www.freebsd.org/~nik/handbook/book01.htm> for the first
results. Keep in mind that the conversion has not been fine tuned in any
way. That said, comments are welcome.