-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: plugin directory supports multiple interfaces (#206)
The plugin directory now displays CLI and Artifact API help text for actions instead of a custom table of inputs, parameters, and outputs (this table was generally confusing to users). Thanks @thermokarst for having the idea of using the help text that's already being generated for the CLI and Artifact API! The code is much simpler now too :) Also, instead of using an action's underscored name (`Action.id`), the action's CLI name (dashed) is used in URLs and content.
- Loading branch information
1 parent
255d298
commit d08a5a7
Showing
5 changed files
with
59 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 18 additions & 43 deletions
61
source/sphinx_extensions/plugin_directory/templates/action.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,23 @@ | ||
{{ title }} | ||
{{ '=' * title|length }} | ||
|
||
{{ action.description }} | ||
|
||
.. raw:: html | ||
|
||
<table class="table action-signature"> | ||
{% for group, specs in (('Inputs', input_specs), | ||
('Parameters', parameter_specs), | ||
('Outputs', output_specs)) %} | ||
<thead> | ||
<tr> | ||
<th colspan="4">{{ group }}</th> | ||
</tr> | ||
{% if specs %} | ||
<tr> | ||
<th>Name</th> | ||
<th>Type</th> | ||
<th>Default</th> | ||
<th>Description</th> | ||
</tr> | ||
{% else %} | ||
<tr> | ||
<th colspan="4" class="text-muted">N/A</th> | ||
</tr> | ||
{% endif %} | ||
</thead> | ||
<tbody> | ||
{% for spec in specs %} | ||
<tr> | ||
{% for content in spec[:3] %} | ||
<td> | ||
<code class="docutils literal"> | ||
<span class="pre">{{ content }}</span> | ||
</code> | ||
</td> | ||
{% endfor %} | ||
<td> | ||
{% for line in spec[3].splitlines() %} | ||
{{ line|urlize }}<br/> | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
{% endfor %} | ||
</table> | ||
<div class="tabbed"> | ||
<ul class="nav nav-tabs"> | ||
<li class="active"><a data-toggle="tab" href="#cli">Command line interface</a></li> | ||
<li><a data-toggle="tab" href="#api">Artifact API</a></li> | ||
</ul> | ||
<div class="tab-content"> | ||
<div id="cli" class="tab-pane fade in active"> | ||
<pre> | ||
{{- cli_help -}} | ||
</pre> | ||
</div> | ||
<div id="api" class="tab-pane fade"> | ||
<pre> | ||
{{- api_help -}} | ||
</pre> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters