Skip to content

Commit

Permalink
build(docs-infra): ensure that CLI code blocks are not auto-linked (a…
Browse files Browse the repository at this point in the history
…ngular#26675)

Some of the text in CLI API docs were being auto-linked to API
pages. This was not correct, and in fact these blocks should not
have any auto links to Angular API at all.

Closes angular#26570

PR Close angular#26675
  • Loading branch information
petebacondarwin authored and FrederikSchlemmer committed Jan 3, 2019
1 parent 0dc5f80 commit fdb1fc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ <h2>Command Overview</h2>
<tbody>
{% for command in doc.commands %}
<tr>
<td><a class="code-anchor" href="{$ command.path $}"><code>{$ command.name $}</code></a></td>
<td>{% for alias in command.commandAliases %}<code>{$ alias $} </code>{% endfor %}</td>
<td><a class="code-anchor" href="{$ command.path $}"><code class="no-auto-link">{$ command.name $}</code></a></td>
<td>{% for alias in command.commandAliases %}<code class="no-auto-link">{$ alias $} </code>{% endfor %}</td>
<td>{$ command.description | marked $}</td>
</tr>
{% endfor %}
Expand Down
12 changes: 6 additions & 6 deletions aio/tools/transforms/templates/cli/lib/cli.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro renderSyntax(container, prefix) -%}
{% for name in container.names %}
<code-example hideCopy="true" class="no-box api-heading">ng {%if prefix %}{$ prefix $} {% endif %}<span class="cli-name">{$ name $}</span>
<code-example hideCopy="true" class="no-box api-heading no-auto-link">ng {%if prefix %}{$ prefix $} {% endif %}<span class="cli-name">{$ name $}</span>
{%- for arg in container.positionalOptions %} &lt;<var>{$ arg.name $}</var>&gt;{% endfor %}
{%- if container.namedOptions.length %} [<var>options</var>]{% endif -%}
</code-example>
Expand All @@ -20,14 +20,14 @@
<tbody>
{% for option in arguments %}
<tr class="cli-option">
<td><code>&lt;<var>{$ option.name $}</var>&gt;</code></td>
<td><code class="no-auto-link">&lt;<var>{$ option.name $}</var>&gt;</code></td>
<td>
{$ option.description | marked $}
{% if option.subcommands.length -%}
<p>This option can take one of the following <a href="#{$ option.name $}-commands">sub-commands</a>:<p>
<ul>
{% for subcommand in option.subcommands %}
<li><code><a class="code-anchor" href="#{$ subcommand.name $}-command">{$ subcommand.name $}</a></code></li>
<li><code class="no-auto-link"><a class="code-anchor" href="#{$ subcommand.name $}-command">{$ subcommand.name $}</a></code></li>
{% endfor %}
</ul>
{%- endif %}
Expand All @@ -53,11 +53,11 @@
{% for option in options %}
<tr class="cli-option">
<td>
<code class="cli-option-syntax">{$ renderOption(option.name, option.type, option.default, option.enum) $}</code>
<code class="cli-option-syntax no-auto-link">{$ renderOption(option.name, option.type, option.default, option.enum) $}</code>
</td>
<td>
{$ option.description | marked $}
{% if option.default !== undefined %}<p><span class="cli-default">Default:</span> <code>{$ option.default $}</code></p>{% endif %}
{% if option.default !== undefined %}<p><span class="cli-default">Default:</span> <code class="no-auto-link">{$ option.default $}</code></p>{% endif %}
{% if option.aliases.length %}<p><span class="cli-aliases">Aliases:</span> {% for alias in option.aliases %}{$ renderOptionName(alias) $}{% if not loop.last %}, {% endif %}{% endfor %}</p>{% endif %}
</td>
</tr>
Expand Down Expand Up @@ -92,7 +92,7 @@
{% for command in container.positionalOptions %}{% if command.subcommands.length %}
<h2><a id="{$ command.name $}-commands"></a>{$ command.name | title $} commands</h2>
{% for subcommand in command.subcommands %}
<h3><code><a id="{$ subcommand.name $}-command"></a>{$ subcommand.name $}</code></h3>
<h3><code class="no-auto-link"><a id="{$ subcommand.name $}-command"></a>{$ subcommand.name $}</code></h3>
{% for name in container.names %}
{$ renderSyntax(subcommand, name) $}
{% endfor %}
Expand Down

0 comments on commit fdb1fc3

Please sign in to comment.