-
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.
Improvements to help terms & tool help.
- Allow tools to declare markdown help. - Allow tools to reference help terms from their Markdown tools. - Auto generate help terms for each datatype from values in datatypes_conf.xml - Add permenant links for each help term - both the auto generated ones and the YAML specified ones. - Add some initial help terms for collection operations. - Use new help term for "map over" from tool form.
- Loading branch information
Showing
24 changed files
with
493 additions
and
104 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
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,18 @@ | ||
<script setup lang="ts"> | ||
import { BPopover } from "bootstrap-vue"; | ||
import HelpTerm from "./HelpTerm.vue"; | ||
interface Props { | ||
target: any; | ||
term: string; | ||
} | ||
defineProps<Props>(); | ||
</script> | ||
|
||
<template> | ||
<BPopover :target="target" triggers="hover" placement="bottom"> | ||
<HelpTerm :term="term" /> | ||
</BPopover> | ||
</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,31 @@ | ||
<script setup lang="ts"> | ||
import { BAlert } from "bootstrap-vue"; | ||
import { toRef } from "vue"; | ||
import { useHelpForTerm } from "@/stores/helpTermsStore"; | ||
import LoadingSpan from "@/components/LoadingSpan.vue"; | ||
import ConfigurationMarkdown from "@/components/ObjectStore/ConfigurationMarkdown.vue"; | ||
interface Props { | ||
term: string; | ||
} | ||
const props = defineProps<Props>(); | ||
const { loading, hasHelp, help } = useHelpForTerm(toRef(props, "term")); | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div v-if="loading"> | ||
<LoadingSpan message="Loading Galaxy help terms" /> | ||
</div> | ||
<div v-else-if="hasHelp"> | ||
<ConfigurationMarkdown :markdown="help" :admin="true" /> | ||
</div> | ||
<div v-else> | ||
<BAlert variant="error"> Something went wrong, no Galaxy help found for term or URI {{ term }}. </BAlert> | ||
</div> | ||
</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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,18 @@ | ||
<script setup> | ||
import { useFormattedToolHelp } from "composables/formattedToolHelp"; | ||
const props = defineProps({ | ||
content: { | ||
type: String, | ||
required: true, | ||
}, | ||
}); | ||
const { formattedContent } = useFormattedToolHelp(props.content); | ||
<script setup lang="ts"> | ||
import ToolHelpMarkdown from "./ToolHelpMarkdown.vue"; | ||
import ToolHelpRst from "./ToolHelpRst.vue"; | ||
defineProps<{ | ||
type: string; | ||
content: string; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<div class="form-help form-text" v-html="formattedContent" /> | ||
<span> | ||
<ToolHelpMarkdown v-if="type == 'markdown'" :content="content" /> | ||
<ToolHelpRst v-else-if="type == 'restructuredtext'" :content="content" /> | ||
<div v-else class="form-help form-text"> | ||
{{ content }} | ||
</div> | ||
</span> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "scss/theme/blue.scss"; | ||
.form-help { | ||
&:deep(h3) { | ||
font-size: $h4-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h4) { | ||
font-size: $h5-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h5) { | ||
font-size: $h6-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h6) { | ||
font-size: $h6-font-size; | ||
text-decoration: underline; | ||
} | ||
} | ||
</style> |
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,60 @@ | ||
<script setup lang="ts"> | ||
import { computed, onMounted, ref } from "vue"; | ||
import { markup } from "@/components/ObjectStore/configurationMarkdown"; | ||
import { useFormattedToolHelp } from "@/composables/formattedToolHelp"; | ||
import { getAppRoot } from "@/onload/loadConfig"; | ||
import HelpPopover from "@/components/Help/HelpPopover.vue"; | ||
const props = defineProps<{ | ||
content: string; | ||
}>(); | ||
const markdownHtml = computed(() => markup(props.content ?? "", false)); | ||
// correct links and header information... this should work the same between rst and | ||
// markdown entirely I think. | ||
const { formattedContent } = useFormattedToolHelp(markdownHtml); | ||
const helpHtml = ref<HTMLDivElement>(); | ||
interface InternalTypeReference { | ||
element: HTMLElement; | ||
term: string; | ||
} | ||
const internalHelpReferences = ref<InternalTypeReference[]>([]); | ||
function setupPopovers() { | ||
internalHelpReferences.value.length = 0; | ||
if (helpHtml.value) { | ||
const links = helpHtml.value.getElementsByTagName("a"); | ||
Array.from(links).forEach((link) => { | ||
if (link.href.startsWith("help://")) { | ||
const uri = link.href.substr("help://".length); | ||
internalHelpReferences.value.push({ element: link, term: uri }); | ||
link.href = `${getAppRoot()}help/terms/${uri}`; | ||
link.style.color = "inherit"; | ||
link.style.textDecorationLine = "underline"; | ||
link.style.textDecorationStyle = "dashed"; | ||
} | ||
}); | ||
} | ||
} | ||
onMounted(setupPopovers); | ||
</script> | ||
|
||
<template> | ||
<span> | ||
<!-- Disable v-html warning because we allow markdown generated HTML | ||
in various places in the Galaxy interface. Raw HTML is not allowed | ||
here because admin = false in the call to markup. | ||
--> | ||
<!-- eslint-disable-next-line vue/no-v-html --> | ||
<div ref="helpHtml" v-html="formattedContent" /> | ||
<span v-for="(value, i) in internalHelpReferences" v-bind:key="i"> | ||
<HelpPopover :target="value.element" :term="value.term" /> | ||
</span> | ||
</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
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,42 @@ | ||
<script setup> | ||
import { useFormattedToolHelp } from "composables/formattedToolHelp"; | ||
const props = defineProps({ | ||
content: { | ||
type: String, | ||
required: true, | ||
}, | ||
}); | ||
const { formattedContent } = useFormattedToolHelp(props.content); | ||
</script> | ||
|
||
<template> | ||
<div class="form-help form-text" v-html="formattedContent" /> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "scss/theme/blue.scss"; | ||
.form-help { | ||
&:deep(h3) { | ||
font-size: $h4-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h4) { | ||
font-size: $h5-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h5) { | ||
font-size: $h6-font-size; | ||
font-weight: bold; | ||
} | ||
&:deep(h6) { | ||
font-size: $h6-font-size; | ||
text-decoration: underline; | ||
} | ||
} | ||
</style> |
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
Oops, something went wrong.