1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-07 08:03:35 +02:00

Standardize formatting of :set examples in :help.

This commit is contained in:
Kris Maglione
2010-12-17 09:04:46 -05:00
parent 7386117f00
commit 714870525e
6 changed files with 47 additions and 22 deletions

View File

@@ -454,6 +454,31 @@
</span> </span>
</xsl:template> </xsl:template>
<xsl:template match="dactyl:se" mode="help-2">
<xsl:variable name="nodes" xmlns="&xmlns.dactyl;">
<ex>:set</ex>
<xsl:text> </xsl:text>
<link topic="'{@opt}'"><hl key="HelpOpt"><xsl:value-of select="@opt"/></hl></link>
<xsl:choose>
<xsl:when test="@op and @op != ''"><xsl:value-of select="@op"/></xsl:when>
<xsl:otherwise>=</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="@*|node()"/>
</xsl:variable>
<xsl:apply-templates select="exsl:node-set($nodes)" mode="help-1"/>
</xsl:template>
<xsl:template match="dactyl:set" mode="help-2">
<xsl:variable name="nodes">
<code xmlns="&xmlns.dactyl;">
<se opt="{@opt}" op="{@op}">
<xsl:copy-of select="@*|node()"/>
</se>
</code>
</xsl:variable>
<xsl:apply-templates select="exsl:node-set($nodes)" mode="help-1"/>
</xsl:template>
<xsl:template match="dactyl:description | dactyl:example | dactyl:spec" mode="help-2"> <xsl:template match="dactyl:description | dactyl:example | dactyl:spec" mode="help-2">
<div> <div>
<xsl:if test="self::dactyl:description"><xsl:attribute name="dactyl:highlight">HelpDescription</xsl:attribute></xsl:if> <xsl:if test="self::dactyl:description"><xsl:attribute name="dactyl:highlight">HelpDescription</xsl:attribute></xsl:if>

View File

@@ -99,8 +99,8 @@
<p>Set the filetype to mail when editing email at Gmail:</p> <p>Set the filetype to mail when editing email at Gmail:</p>
<code><ex>:autocmd LocationChange</ex> !<str delim="'">mail\.google\.com</str> <ex>:set editor=<str>gvim -f</str></ex> <code><ex>:autocmd LocationChange</ex> !<str delim="'">mail\.google\.com</str> <se opt="editor"><str>gvim -f</str></se>
<ex>:autocmd LocationChange</ex> <str delim="'">mail\.google\.com</str> <ex>:set editor=<str>gvim -f -c 'set ft=mail'</str></ex></code> <ex>:autocmd LocationChange</ex> <str delim="'">mail\.google\.com</str> <se opt="editor"><str>gvim -f -c 'set ft=mail'</str></se></code>
</document> </document>

View File

@@ -386,7 +386,7 @@
<p>works like</p> <p>works like</p>
<code><ex>:map \h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code> <code><ex>:map \h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code>
<p>but after</p> <p>but after</p>
<code><ex>:set mapleader=<str>,</str></ex></code> <set opt="mapleader"><str>,</str></set>
<p>it works like</p> <p>it works like</p>
<code><ex>:map ,h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code> <code><ex>:map ,h</ex> <ex>:echo <str>Hello</str><k name="CR"/></ex></code>
</description> </description>

View File

@@ -151,11 +151,11 @@
<p>For list options, toggle the specified values.</p> <p>For list options, toggle the specified values.</p>
<p>If the option is a list, the given values are toggled. Given,</p> <p>If the option is a list, the given values are toggled. Given,</p>
<code><ex>:set opt=foo,bar</ex></code> <set opt="opt"><str delim="">foo</str>,<str delim="">bar</str></set>
<p>then,</p> <p>then,</p>
<code><ex>:set opt!=foo,baz</ex></code> <set opt="opt" op="!="><str delim="">foo</str>,<str delim="">baz</str></set>
<p>has the same result as</p> <p>has the same result as</p>
<code><ex>:set opt=bar,baz</ex></code> <set opt="opt"><str delim="">bar</str>,<str delim="">baz</str></set>
</description> </description>
</item> </item>
@@ -517,7 +517,7 @@
</dl> </dl>
<p> <p>
The order is important, such that <ex>:set complete=bsf</ex> will The order is important, such that <se opt="complete"><str delim="">bsf</str></se> will
list bookmarks followed by matching quick searches and then list bookmarks followed by matching quick searches and then
matching files. matching files.
</p> </p>
@@ -978,13 +978,13 @@
For example, to prepend to the default value of this option to load For example, to prepend to the default value of this option to load
all plugins except for <em>foobar-plugin</em>, you could use: all plugins except for <em>foobar-plugin</em>, you could use:
</p> </p>
<code><ex>:se lpl^=</ex>!<str delim="'">foobar-plugin</str></code> <set opt="loadplugins" op="^=">!<str delim="'">foobar-plugin</str></set>
<p> <p>
Alternatively, you can specify which plugins to load and which to Alternatively, you can specify which plugins to load and which to
omit in your <tt><t>&dactyl.name;rc</t></tt> using something like omit in your <tt><t>&dactyl.name;rc</t></tt> using something like
the following: the following:
</p> </p>
<code><ex>:set loadplugins=</ex>!<str delim="'">foo|bar</str>,<str delim="'">\.(js|&dactyl.fileExt;)$</str></code> <set opt="loadplugins">!<str delim="'">foo|bar</str>,<str delim="'">\.(js|&dactyl.fileExt;)$</str></set>
<p> <p>
That will load all plugins but <em>foo</em> and <em>bar</em>. That will load all plugins but <em>foo</em> and <em>bar</em>.
</p> </p>
@@ -1135,7 +1135,7 @@
through directly to &dactyl.host;, and are not processed through directly to &dactyl.host;, and are not processed
by &dactyl.appName; in any way. by &dactyl.appName; in any way.
</p> </p>
<example><ex>:set passkeys+=</ex><str delim="'">https://mail\.google\.com/</str>:<str delim="">jk<k name="Return"/></str></example> <example><set opt="passkeys" op="+="><str delim="'">https://mail\.google\.com/</str>:<str delim="">jk<k name="Return"/></str></set></example>
</description> </description>
</item> </item>
@@ -1225,7 +1225,7 @@
<p>Example:</p> <p>Example:</p>
<code><ex>:set runtimepath=~/my&dactyl.name;,~/.&dactyl.name;</ex></code> <set opt="runtimepath"><str delim="">~/my&dactyl.name;</str>,<str delim="">~/.&dactyl.name;</str></set>
<p> <p>
This will search for plugins in both This will search for plugins in both
@@ -1427,7 +1427,7 @@
Set the application name shown after the current page title in Set the application name shown after the current page title in
&dactyl.host;'s title bar. &dactyl.host;'s title bar.
</p> </p>
<example><ex>:set titlestring=<str>Mozilla &dactyl.host;</str></ex></example> <example><set opt="titlestring"><str>Mozilla &dactyl.host;</str></set></example>
</description> </description>
</item> </item>
@@ -1443,7 +1443,7 @@
are never split. With the default value, the following will open are never split. With the default value, the following will open
three URLs in the current tab and two new background tabs, three URLs in the current tab and two new background tabs,
</p> </p>
<code><ex>:open google Linux | wikipedia Arch Linux | imdb March of the Penguins</ex></code> <code><ex>:open <str delim="">google Linux</str> | <str delim="">wikipedia Arch Linux</str> | <str delim="">imdb Serenity</str></ex></code>
</description> </description>
</item> </item>
@@ -1540,7 +1540,7 @@
the following will ignore object files and Vim swap files: the following will ignore object files and Vim swap files:
</p> </p>
<code><ex>:set wildignore=<str delim="'">\.o$</str>,<str delim="'">^\..*\.s[a-z]{2}$</str></ex></code> <set opt="wildignore"><str delim="'">\.o$</str>,<str delim="'">^\..*\.s[a-z]{2}$</str></set>
<note>Unlike Vim, each pattern is a regular expression rather than a glob.</note> <note>Unlike Vim, each pattern is a regular expression rather than a glob.</note>
</description> </description>

View File

@@ -27,13 +27,13 @@
navigation, and tool bars by default. If you find it uncomfortable to work navigation, and tool bars by default. If you find it uncomfortable to work
without them, you can re-enable them by typing without them, you can re-enable them by typing
</p> </p>
<code><ex>:set</ex> <link topic="'guioptions'"><hl key="HelpOpt">guioptions</hl></link><hl key="HelpEx">+=mT</hl><k name="Return"/></code> <set opt="guioptions" op="+="><str delim="">mT</str><k name="Return"/></set>
<p> <p>
If you have trouble remembering commands or keyboard shortcuts, you can If you have trouble remembering commands or keyboard shortcuts, you can
bring up this help page at any time by typing <ex>:help</ex> or bring up this help page at any time by typing <ex>:help</ex> or
<k name="F1"/>. If you find that you don't like &dactyl.appName; at all, <k name="F1"/>. If you find that you don't like &dactyl.appName; at all,
you can disable it by typing <ex>:extdisable &dactyl.appName;</ex> or you can disable it by typing <ex>:extdisable <str delim="">&dactyl.appName;</str></ex> or
delete it entirely by typing <ex>:extdelete &dactyl.appName;</ex> delete it entirely by typing <ex>:extdelete <str delim="">&dactyl.appName;</str></ex>
</p> </p>
<h2 tag="overview">Help topics</h2> <h2 tag="overview">Help topics</h2>
@@ -151,7 +151,7 @@
<li>Hit-a-hint like navigation of links (start with <k>f</k> to follow a link)</li> <li>Hit-a-hint like navigation of links (start with <k>f</k> to follow a link)</li>
<li>Advanced completion of bookmark and history URLs</li> <li>Advanced completion of bookmark and history URLs</li>
<li>Vim-like status line with a Wget-like progress bar</li> <li>Vim-like status line with a Wget-like progress bar</li>
<li>Minimal GUI (easily hide superfluous menubar and toolbar with <ex>:set guioptions=</ex>)</li> <li>Minimal GUI (easily hide superfluous menubar and toolbar with <se opt="guioptions"/>)</li>
<li>Ability to <ex>:source</ex> JavaScript, CSS, and &dactyl.appName; command files</li> <li>Ability to <ex>:source</ex> JavaScript, CSS, and &dactyl.appName; command files</li>
<li>Easy quick searches (see <ex>:open</ex>)</li> <li>Easy quick searches (see <ex>:open</ex>)</li>
<li>Count supported for many commands (<em>3</em><k name="C-o"/> will go back 3 pages)</li> <li>Count supported for many commands (<em>3</em><k name="C-o"/> will go back 3 pages)</li>

View File

@@ -26,7 +26,7 @@
regain these by issuing the command regain these by issuing the command
</p> </p>
<code><ex>:set go+=mTB<k name="CR"/></ex></code> <set opt="go+"><str delim="">mTB</str><k name="CR"/></set>
<p> <p>
where <k name="CR"/> represents pressing the <k name="Enter"/> or <k name="Return"/> key. where <k name="CR"/> represents pressing the <k name="Enter"/> or <k name="Return"/> key.
@@ -36,8 +36,8 @@
<p> <p>
However, in this author's opinion, the best way to get familiar with However, in this author's opinion, the best way to get familiar with
&dactyl.appName; is to leave these disabled for now. (The above action can be &dactyl.appName; is to leave these disabled for now. (The above action can be
reversed with <ex>:set go=<k name="CR"/></ex>) You can look at the entry for <o>guioptions</o> in reversed with <se opt="go" op="&amp;"/><k name="CR"/>) You can look at the entry
<t>options</t> for more information on this. for <o>guioptions</o> in <t>options</t> for more information on this.
</p> </p>
<h2 tag="modal">&dactyl.appName;'s modal interface</h2> <h2 tag="modal">&dactyl.appName;'s modal interface</h2>
@@ -360,7 +360,7 @@
<p> <p>
Alternatively, you can do this the old-fashioned way: re-enable the menubar, Alternatively, you can do this the old-fashioned way: re-enable the menubar,
as above, with <ex>:set go+=m</ex>, and select <em>Add-ons</em> from the <em>Tools</em> menu. as above, with <se opt="go" op="+=">m</se>, and select <em>Add-ons</em> from the <em>Tools</em> menu.
</p> </p>
<h2 tag="support">I'm interested… but lost!</h2> <h2 tag="support">I'm interested… but lost!</h2>