-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17228 from jmchilton/markdown_help_distinction
Overhaul Galaxy Markdown Help
- Loading branch information
Showing
9 changed files
with
258 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup lang="ts"> | ||
import { computed } from "vue"; | ||
import { directiveEntry } from "./directives"; | ||
interface DirectiveHelpProps { | ||
directive: string; | ||
mode: "page" | "report"; | ||
} | ||
const props = defineProps<DirectiveHelpProps>(); | ||
const entry = computed(() => directiveEntry(props.directive, props.mode)); | ||
</script> | ||
|
||
<template> | ||
<span> | ||
<dt> | ||
<tt>{{ directive }}</tt> | ||
</dt> | ||
<dd>{{ entry.help }}</dd> | ||
</span> | ||
</template> |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script setup lang="ts"> | ||
import DirectiveHelp from "./DirectiveHelp.vue"; | ||
interface DirectiveHelpSectionProps { | ||
directives: string[]; | ||
mode: "page" | "report"; | ||
} | ||
defineProps<DirectiveHelpSectionProps>(); | ||
</script> | ||
|
||
<template> | ||
<dl> | ||
<DirectiveHelp v-for="directive in directives" :key="directive" :directive="directive" :mode="mode"> | ||
</DirectiveHelp> | ||
</dl> | ||
</template> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,151 @@ | ||
<script setup> | ||
import { datasetCommandsHtml, markdownGeneralHelpHtml } from "components/Markdown/help"; | ||
import { ref } from "vue"; | ||
<script setup lang="ts"> | ||
import { computed } from "vue"; | ||
const modal = ref(null); | ||
import DirectiveHelpSection from "./DirectiveHelpSection.vue"; | ||
function showMarkdownHelp() { | ||
modal.value.show(); | ||
interface MarkdownHelpProps { | ||
mode: "report" | "page"; | ||
} | ||
defineExpose({ | ||
showMarkdownHelp, | ||
}); | ||
const props = defineProps<MarkdownHelpProps>(); | ||
const page = computed(() => props.mode == "page"); | ||
</script> | ||
|
||
<template> | ||
<b-modal ref="modal" hide-footer> | ||
<template v-slot:modal-title> | ||
<h2 class="mb-0">Markdown Help</h2> | ||
</template> | ||
<div> | ||
<h3>Overview</h3> | ||
<p> | ||
This Markdown document will be used to generate your Galaxy Page. This document should be Markdown with | ||
embedded commands for extracting and displaying Galaxy objects and their metadata. | ||
</p> | ||
|
||
<p v-html="markdownGeneralHelpHtml"></p> | ||
|
||
<h3>History Contents Commands</h3> | ||
|
||
<p> | ||
These commands reference a dataset. For instance, the following examples would display the dataset | ||
collection corresponding to a Galaxy dataset collection ID and display a single dataset as an image | ||
corresponding to a Galaxy dataset ID. | ||
</p> | ||
|
||
<pre> | ||
<div> | ||
<h3>Overview</h3> | ||
<p> | ||
<span v-if="page"> This Markdown document will be used to generate your Galaxy Page. </span> | ||
<span v-else> This Markdown document will be used to generate your workflow invocation report. </span> | ||
This document should be Markdown with embedded commands for extracting and displaying Galaxy objects and/or | ||
their metadata. | ||
</p> | ||
|
||
<p> | ||
For an overview of standard Markdown visit the | ||
<a href="https://commonmark.org/help/tutorial/">commonmark.org tutorial</a>. | ||
</p> | ||
|
||
<p> | ||
The Galaxy extensions to Markdown are represented as code blocks, these blocks start with the line | ||
<tt>```galaxy</tt> and end with the line <tt>```</tt> and have a command with arguments between these lines. | ||
<span v-if="page"> | ||
These arguments reference your Galaxy objects such as datasets, jobs, and workflows. | ||
</span> | ||
<span v-else> | ||
These arguments reference parts of your workflow such as steps, inputs, and outputs by label in the | ||
middle. | ||
</span> | ||
</p> | ||
|
||
<h3>History Contents Commands</h3> | ||
|
||
<p> | ||
These commands reference a dataset or dataset collection. For instance, the following examples would display | ||
the dataset collection metadata and would embed a dataset into the document as an image. | ||
|
||
<span v-if="page"> | ||
These elements are referenced by object IDs used by the Galaxy API. The Markdown editor will let you | ||
pick objects graphically but they will be embedded into the Markdown with these IDs. | ||
</span> | ||
|
||
<span v-else> | ||
These elements are referenced by input or output labels for the workflow. If a dataset or collection | ||
you'd like to reference is not available for selection in the Markdown editor, be sure to assign a label | ||
to the object in the workflow editor first. | ||
</span> | ||
</p> | ||
|
||
<pre v-if="page"> | ||
```galaxy | ||
history_dataset_collection_display(history_dataset_collection_id=33b43b4e7093c91f) | ||
``` | ||
</pre | ||
> | ||
> | ||
<pre v-else> | ||
```galaxy | ||
history_dataset_collection_display(output=mapped_bams) | ||
``` | ||
</pre | ||
> | ||
|
||
<pre> | ||
<pre v-if="page"> | ||
```galaxy | ||
history_dataset_as_image(history_dataset_id=33b43b4e7093c91f) | ||
``` | ||
</pre | ||
> | ||
|
||
<p v-html="datasetCommandsHtml"></p> | ||
|
||
<h3>Workflow Commands</h3> | ||
|
||
<p> | ||
These commands reference a workflow (currently only one). The following example would display a | ||
representation of the workflow in the resulting Galaxy Page: | ||
</p> | ||
|
||
<pre> | ||
> | ||
<pre v-else> | ||
```galaxy | ||
history_dataset_as_image(output=normalized_result_plot) | ||
``` | ||
</pre | ||
> | ||
|
||
<DirectiveHelpSection | ||
:mode="mode" | ||
:directives="[ | ||
'history_dataset_display', | ||
'history_dataset_collection_display', | ||
'history_dataset_as_image', | ||
'history_dataset_as_table', | ||
'history_dataset_peek', | ||
'history_dataset_info', | ||
]" /> | ||
|
||
<h3>Workflow Commands</h3> | ||
|
||
<p v-if="page"> | ||
These commands reference a workflow by an object ID. The following example would display a representation of | ||
the workflow in the resulting Galaxy Page: | ||
</p> | ||
<p v-else>These commands reference the current workflow and do not require an input for the most part.</p> | ||
|
||
<pre v-if="page"> | ||
```galaxy | ||
workflow_display(workflow_id=33b43b4e7093c91f>) | ||
``` | ||
</pre | ||
> | ||
|
||
<dl> | ||
<dt><tt>workflow_display</tt></dt> | ||
<dd>Embed a description of the workflow itself in the resulting document.</dd> | ||
</dl> | ||
|
||
<h3>Job Commands</h3> | ||
|
||
<p> | ||
These commands reference a Galaxy job.For instance, the following example would show the job parameters | ||
the job ID 33b43b4e7093c91f: | ||
</p> | ||
|
||
<pre> | ||
> | ||
<pre v-else> | ||
```galaxy | ||
workflow_display() | ||
``` | ||
</pre | ||
> | ||
|
||
<DirectiveHelpSection | ||
:mode="mode" | ||
:directives="['workflow_license', 'workflow_display', 'workflow_image', 'invocation_time']" /> | ||
|
||
<h3>Job Commands</h3> | ||
|
||
<p v-if="page"> | ||
These commands reference a Galaxy job. For instance, the following example would show the job parameters the | ||
job ID <tt>33b43b4e7093c91f</tt>. | ||
</p> | ||
<p v-else> | ||
These commands reference a Galaxy job or collection of jobs associated with a labeled step in the workflow. | ||
For instance, the following example would show the job parameters for the step with the label | ||
<tt>mapping</tt>. | ||
</p> | ||
|
||
<pre v-if="page"> | ||
```galaxy | ||
job_parameters(job_id=33b43b4e7093c91f) | ||
``` | ||
</pre | ||
> | ||
|
||
<dt><tt>tool_stderr</tt></dt> | ||
<dd>Embed the tool standard error stream for this job in the resulting document.</dd> | ||
<dt><tt>tool_stdout</tt></dt> | ||
<dd>Embed the tool standard output stream for this job in the resulting document.</dd> | ||
<dt><tt>job_metrics</tt></dt> | ||
<dd> | ||
Embed the job metrics for this job in the resulting document (if Galaxy is configured and you have | ||
permission). | ||
</dd> | ||
<dt><tt>job_parameters</tt></dt> | ||
<dd>Embed the tool parameters for this job in the resulting document.</dd> | ||
</div> | ||
</b-modal> | ||
> | ||
<pre v-else> | ||
```galaxy | ||
job_parameters(step=mapping) | ||
``` | ||
</pre | ||
> | ||
|
||
<DirectiveHelpSection | ||
:mode="mode" | ||
:directives="['tool_stderr', 'tool_stdout', 'job_metrics', 'job_parameters']" /> | ||
</div> | ||
</template> |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup lang="ts"> | ||
import { computed, ref } from "vue"; | ||
import MarkdownHelp from "./MarkdownHelp.vue"; | ||
interface MarkdownHelpModalProps { | ||
mode: "report" | "page"; | ||
} | ||
const props = defineProps<MarkdownHelpModalProps>(); | ||
const show = ref(false); | ||
const title = computed(() => { | ||
if (props.mode == "page") { | ||
return "Markdown Help for Pages"; | ||
} else { | ||
return "Markdown Help for Invocation Reports"; | ||
} | ||
}); | ||
function showMarkdownHelp() { | ||
show.value = true; | ||
} | ||
defineExpose({ | ||
showMarkdownHelp, | ||
}); | ||
</script> | ||
|
||
<template> | ||
<b-modal v-model="show" hide-footer> | ||
<template v-slot:modal-title> | ||
<h2 class="mb-0">{{ title }}</h2> | ||
</template> | ||
<MarkdownHelp :mode="mode" /> | ||
</b-modal> | ||
</template> |
Oops, something went wrong.