Skip to content

Commit

Permalink
Add some more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Jan 2, 2025
1 parent 61b5f9c commit 7439768
Show file tree
Hide file tree
Showing 8 changed files with 370 additions and 216 deletions.
3 changes: 3 additions & 0 deletions app/labs/lab_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class TabSubsection(BaseModel):
id: str
title: str
content: list[TabItem]
exclude_from: Optional[list[str]] = []


class SectionTab(BaseModel):
Expand All @@ -96,6 +97,7 @@ class SectionTab(BaseModel):
]
] = None
heading_md: Optional[MarkdownStr] = None
exclude_from: Optional[list[str]] = []

@field_validator('heading_md', mode='before')
def validate_md(cls, value):
Expand All @@ -107,6 +109,7 @@ class LabSectionSchema(BaseModel):
id: str
title: str
tabs: list[SectionTab]
exclude_from: Optional[list[str]] = []


class LabSchema(BaseModel, extra='allow'):
Expand Down
1 change: 1 addition & 0 deletions app/labs/static/labs/content/docs/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ custom_css: static/custom.css
sections:
- section_1.yml
- section_2.yml
- section_3.yml
166 changes: 87 additions & 79 deletions app/labs/static/labs/content/docs/section_1.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,99 @@
id: section_1
title: Example section
title: Creating sections
tabs:
- id: tools
title: Tools
heading_md: Common tools are listed here, or search for more in the full tool panel to the left.
- id: faqs
title: FAQs
heading_md: |
This is a section. A section is composed of a title (*"Creating sections"*)
and one or more tabs. Each tab is composed of a title (*"FAQs"*), heading
text (*this*) and a collection of collapsable items.
Sections are rendered from data specified in a YAML file.
The structure of the YAML file is important, and must follow the
[defined schema](/schema). The two sections below give examples of how
content can be nested in sections.
content:
- title_md: Can I write content in HTML?
description_md: |
Yes - any file/field that accepts markdown can also accept HTML,
for example:
# Accordion item schema:
# title_md: <str> # inline MD accepted e.g. *italics*, **bold**, `code`
# description_md: <str>
# inputs: <optional>
# - datatypes: # tool input 1 - two accepted datatypes
# - <str>
# - <str>
# label: <str optional>
# - datatypes: # tool input 2 - one accepted datatype
# - <str>
# label: <str optional>
# button_link: <str optional>
# button_md: <str optional>
# button_tip: <str optional>
# view_link: <str optional>
# view_md: <str optional>
# view_tip: <str optional>
- `intro.md`
- `heading_md` (in section.yml)
- button_link: "{{ galaxy_base_url }}/tool_runner?tool_id=upload1"
title_md: Import data to Galaxy
description_md: >
Standard upload of data to Galaxy, from your computer or from the web.
- button_link: "{{ galaxy_base_url }}/tool_runner?tool_id=toolshed.g2.bx.psu.edu%2Frepos%2Fdevteam%2Ffastqc%2Ffastqc"
title_md: FastQC - sequence quality reports
description_md: >
Before using your sequencing data, it's important to ensure that
the data quality is sufficient for your analysis.
inputs:
- label: Sequencing data for analysis
datatypes:
- fasta
- fastq
- bam
- sam
However, be careful about nesting HTML within markdown. Anything inside
an HTML element must also be HTML. The following would be invalid:
- id: workflows
title: Workflows
heading_md: >
A workflow is a series of Galaxy tools that have been linked together
to perform a specific analysis. You can use and customize the example workflows
below.
<a href="https://galaxyproject.org/learn/advanced-workflow">Learn more</a>.
content:
- button_link: "{{ galaxy_base_url }}/workflows/trs_import?trs_server=workflowhub.eu&run_form=true&trs_id=222"
button_tip: Import to Galaxy AU
title_md: Data QC
view_link: https://workflowhub.eu/workflows/222
view_tip: View in WorkflowHub
view_icon: tutorial
<pre class="prettyprint">
&lt;p&gt;
This is a paragraph with a
[broken link](https://example.com).
&lt;/p&gt;
</pre>
- title_md: Can I use variables in my content?
description_md: |
Report statistics from sequencing reads.
<br><br>
Tools:
Yes! Using variables is a great way to make a Lab page reuable across
Galaxy servers.
Variables defined in the base.yml/server.yml file can be used anywhere
that markdown or HTML content is provided. This includes templates like
`intro.md` and also section.yml `*_md` values. Any arbitrary variable
that you set in the base.yml/server.yml file can be used in the content:
1. `base.yml` or `[server].yml`:
<pre class="prettyprint lang-yaml">
myvar: foo
</pre>
2. `intro.md`:
<pre class="code">
&#35; Analysis methods
This is a great place for doing analysis such as &lbrace;&lbrace; myvar &rbrace;&rbrace;.
</pre>
- `nanoplot`
- `fastqc`
- `multiqc`
- button_link: "{{ galaxy_base_url }}/workflows/trs_import?trs_server=workflowhub.eu&run_form=true&trs_id=223"
button_tip: Import to Galaxy AU
3. `section_1.yml`:
<pre class="prettyprint lang-yaml">
...
&ndash; title_md: Can I use variables in my YAML and Markdown/HTML content?
description_md: |
Yes, you can use variables like &lbrace;&lbrace; myvar &rbrace;&rbrace;.
</pre>
- title_md: Can I exclude an item from specific hosts?
description_md: |
Estimates genome size and heterozygosity based on counts of kmers.
<br><br>
Tools:
Yes, you can exclude any component in the section schema from specific
hosts by listing hostnames under the
[exclude_from directive](/schema#tabitem).
This can be used to exclude items describing server-specific features,
such as:
- `meryl`
- `genomescope`
title_md: Kmer counting to estimate genome size
view_link: https://workflowhub.eu/workflows/223
view_tip: View in WorkflowHub
<pre class="prettyprint lang-yaml">
- title_md: How can I increase my storage quota?
description_md: >
Please submit a quota request if your Galaxy account reaches its
data storage limit. Requests are usually provisioned quickly if you
provide a reasonable use case for your request.
exclude_from:
- usegalaxy.org
</pre>
- id: help
title: Help
content:
- button_md: More info
button_link: https://training.galaxyproject.org/training-material/topics/galaxy-interface/
- title_md: Can I add images into Markdown/HTML?
description_md: |
You can upload your data to Galaxy using the Upload tool from anywhere in Galaxy.
Just look for the "Upload data" button at the top of the tool panel.
title_md: How can I import my genomics data?
- description_md: |
We recommend subsampling large data sets to test tools and workflows.
A useful tool is `seqtk_seq`, setting the parameter at "Sample fraction of sequences".
title_md: How can I subsample my data?
Yes, you can use standard Markdown or HTML syntax to include images.
When adding the `src` atrribute to an image tag, you can use relative
URLs to specify an image located in your content directory, or an
absolute URL to an image hosted elsewhere on the web:
Using Markdown:
<pre class="code">
![My Image](./static/images/myimage.png)
</pre>
Using HTML (allows custom styling):
<pre class="code">
&#60;img src="./static/images/myimage.png" alt="My Image" width="200" height="200"&#62;
</pre>
With a full URL:
<pre class="code">
[![My Image](https://example.com/myimage.png)](https://example.com/myimage.png)
</pre>
Loading

0 comments on commit 7439768

Please sign in to comment.