Skip to content

Commit

Permalink
fix(lapis2-docs): use relative links so that they work when deployed …
Browse files Browse the repository at this point in the history
…behind a proxy #725
  • Loading branch information
fengelniederhammer committed Apr 3, 2024
1 parent c8872ba commit b6e8cd8
Show file tree
Hide file tree
Showing 22 changed files with 77 additions and 74 deletions.
2 changes: 2 additions & 0 deletions .idea/runConfigurations/lapis2_docs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lapis2-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This documentation is a website built with
| Command | Action |
|:--------------------------|:-------------------------------------------------|
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
Expand Down
32 changes: 16 additions & 16 deletions lapis2-docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,35 @@ export default defineConfig({
items: [
{
label: 'Introduction',
link: '/references/introduction/',
link: '/references/introduction',
},
{
label: 'Fields',
link: '/references/fields/',
link: '/references/fields',
},
{
label: 'Filters',
link: '/references/filters/',
link: '/references/filters',
},
{
label: 'Additional Request Properties',
link: '/references/additional-request-properties/',
link: '/references/additional-request-properties',
},
{
label: 'Open API / Swagger',
link: '/references/open-api-definition/',
link: '/references/open-api-definition',
},
{
label: 'Database Config',
link: '/references/database-config/',
link: '/references/database-config',
},
{
label: 'Reference Genomes',
link: '/references/reference-genomes/',
link: '/references/reference-genomes',
},
{
label: 'Nucleotide And Amino Acid Symbols',
link: '/references/nucleotide-and-amino-acid-symbols/',
link: '/references/nucleotide-and-amino-acid-symbols',
},
],
},
Expand All @@ -73,37 +73,37 @@ export default defineConfig({
items: filterAvailableConcepts([
{
label: 'Data versions',
link: '/concepts/data-versions/',
link: '/concepts/data-versions',
},
{
label: 'Mutation filters',
link: '/concepts/mutation-filters/',
link: '/concepts/mutation-filters',
},
{
label: 'Ambiguous symbols',
link: '/concepts/ambiguous-symbols/',
link: '/concepts/ambiguous-symbols',
},
{
label: 'Pango lineage query',
link: '/concepts/pango-lineage-query/',
link: '/concepts/pango-lineage-query',
onlyIfFeature: 'sarsCoV2VariantQuery',
},
{
label: 'Request methods: GET and POST',
link: '/concepts/request-methods/',
link: '/concepts/request-methods',
},
{
label: 'Response format',
link: '/concepts/response-format/',
link: '/concepts/response-format',
},
{
label: 'Variant query',
link: '/concepts/variant-query/',
link: '/concepts/variant-query',
onlyIfFeature: 'sarsCoV2VariantQuery',
},
{
label: 'Request Id',
link: '/concepts/request-id/',
link: '/concepts/request-id',
},
]),
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import { OnlyIf } from '../OnlyIf.tsx';
import { getConfig } from '../../config.ts';
import BaseAwareLink from '../BaseAwareLink.astro';
---

SILO currently supports the following metadata types:
Expand All @@ -13,7 +14,7 @@ SILO currently supports the following metadata types:
<code>pango_lineage</code>: Systematic classification of lineage with inheritance structure that can be computed
for some pathogens.
<OnlyIf condition={!!getConfig().schema.metadata.find((m) => m.type === 'pango_lineage')}>
Also see <a href='/concepts/pango-lineage-query'>here</a>.
Also see <BaseAwareLink href='/concepts/pango-lineage-query'>here</BaseAwareLink>.
</OnlyIf>
</li>
<li><code>date</code>: Values must be valid dates in the form <code>YYYY-MM-DD</code>.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Ambiguous symbols
description: Explanation how ambiguous reads are handled in the data
---

[The symbols page](/references/nucleotide-and-amino-acid-symbols)
[The symbols page](../references/nucleotide-and-amino-acid-symbols)
lists all symbols that the underlying sequence files in `.FASTA` format can contain.
The ambiguous symbols arise from imperfect reads in the sequencer.

Expand Down
2 changes: 1 addition & 1 deletion lapis2-docs/src/content/docs/concepts/mutation-filters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ i.e. has the same base as the reference genome at the specified position.

:::note
Both, nucleotide and amino acid mutation filter, also support `Maybe` queries.
Read more in [ambiguous symbols](/concepts/ambiguous-symbols).
Read more in [ambiguous symbols](../concepts/ambiguous-symbols).
**Example:** <MaybeAminoAcidMutationExample/>.
:::
11 changes: 6 additions & 5 deletions lapis2-docs/src/content/docs/concepts/pango-lineage-query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ description: Pango lineage query
---

import { OnlyIf } from '../../../components/OnlyIf.tsx';
import { getConfig } from '../../../config.ts';
import { getConfig, hasFeature } from '../../../config.ts';

<OnlyIf condition={!!getConfig().schema.metadata.find(m => m.type === 'pango_lineage')}>

Pango lineage names inherit the hierarchical nature of genetic lineages. For example, B.1.1 is a sub-lineage of B.1.
More information about the pango nomenclature can be found on the website of the
[Pango network](https://www.pango.network/).

With the pangoLineage filter and in [variant queries](/concepts/variant-query/), it is possible to not only filter for a very
specific lineage but also to include its sub-lineages. To include sub-lineages, add a `*` at the end. For example,
writing B.1.351 will only give samples of B.1.351. Writing B.1.351* or B.1.351.* (there is no difference between these
two options) will return B.1.351, B.1.351.1, B.1.351.2, etc.
With the pangoLineage filter<OnlyIf condition={hasFeature('sarsCoV2VariantQuery')}> and in [variant queries](../concepts/variant-query/)</OnlyIf>,
it is possible to not only filter for a very specific lineage but also to include its sub-lineages.
To include sub-lineages, add a `*` at the end.
For example, writing B.1.351 will only give samples of B.1.351.
Writing B.1.351* or B.1.351.* (there is no difference between these two options) will return B.1.351, B.1.351.1, B.1.351.2, etc.

An official pango lineage name can only have at most three number components. A sub-lineage of a lineage with a
maximal-length name (e.g., B.1.617.2) will get an alias. A list of aliases can be found
Expand Down
2 changes: 1 addition & 1 deletion lapis2-docs/src/content/docs/concepts/request-id.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This will greatly simplify identifying the problem in our log files.

You can provide a request id in the request as an HTTP header `X-Request-Id`.
This is useful if you want to correlate requests in your own log files with the LAPIS log files
to track problems across systems.
to track problems across systems, e.g. if your own API calls LAPIS.

:::caution
If you use the `X-Request-Id` header, make sure that the value is unique.
Expand Down
6 changes: 2 additions & 4 deletions lapis2-docs/src/content/docs/concepts/request-methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ example code for doing it with curl and from R and Python:
</Tab>
</TabsBox>

{/* prettier-ignore */}
:::note
This is a general example and will only work on instances that have the fields `region`,
`country`, and `date`. Check out the [fields](../../references/fields/) and [filters](../../references/filters/) page to
see information about this instance. {/* prettier-ignore */}
This is a general example and will only work on instances that have the fields `region`, `country`, and `date`.
Check out the [fields](../references/fields/) and [filters](../references/filters/) page to see information about this instance.
:::
6 changes: 3 additions & 3 deletions lapis2-docs/src/content/docs/concepts/response-format.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Response format
---

The response format is tailored to each specific endpoint.
To view the response format for a particular endpoint, please visit our [Swagger UI](/references/open-api-definition/).
To view the response format for a particular endpoint, please visit our [Swagger UI](../references/open-api-definition/).
Once there, select the endpoint of interest and scroll down to the "Responses" section.
A '200' response code indicates a successful request, while any other code signifies an error.

Expand All @@ -15,7 +15,7 @@ Genomic sequences (such as those from `unalignedNucleotideSequences`, `alignedAm

## Example

To understand the response from the `nucleotideMutation` endpoint, refer to the relevant section in the Swagger UI:
To understand the response of the `nucleotideMutation` endpoint, refer to the relevant section in the Swagger UI:

![Example nucleotide mutation response](../../../images/concepts/example_nucleotide_mutation_response_200.png)

Expand All @@ -30,5 +30,5 @@ Fields marked with an asterisk (\*) are always included in the response; unmarke

:::note
Every response, regardless of format, includes the data version as it is crucial information. For more details, visit the
[data versions page](/concepts/data-versions/).
[data versions page](../concepts/data-versions/).
:::
4 changes: 2 additions & 2 deletions lapis2-docs/src/content/docs/concepts/variant-query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ Get the sequences that fulfill exactly 2 out of 4 conditions:
[exactly-2-of: 123A & 234T, !234T, S:345- | S:346-, [2-of: 222T, 333G, 444A, 555C]]
```

For SARS-CoV-2, it is also possible to use [Pango lineage queries](/concepts/pango-lineage-query/) (either called by pangolin
For SARS-CoV-2, it is also possible to use [Pango lineage queries](../concepts/pango-lineage-query/) (either called by pangolin
or by Nextclade) and filter by Nextstrain clades:

```
BA.5* | nextcladePangoLineage:BA.5* | nextstrainClade:22B
```

LAPIS supports a ternary logic to query [ambiguous nucleotide symbols](/concepts/ambiguous-symbols/).
LAPIS supports a ternary logic to query [ambiguous nucleotide symbols](../concepts/ambiguous-symbols/).

```
MAYBE(123W)
Expand Down
4 changes: 2 additions & 2 deletions lapis2-docs/src/content/docs/getting-started/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ to answer genomic epidemiological questions. Main features include:
engine.

:::tip
To get started, you can use our [**interactive wizard**](/getting-started/generate-your-request/) to generate your query.
To get started, you can use our [**interactive wizard**](./generate-your-request/) to generate your query.
We provide code examples for Python and R.
:::

Expand All @@ -43,5 +43,5 @@ If you have any trouble, feel free to reach out to us.

:::note
This documentation also includes a section about how to set up your own instance of LAPIS.
Refer to [this tutorial](/maintainer-docs/tutorials/start-lapis-and-silo/) for a quick start guide.
Refer to [this tutorial](../maintainer-docs/tutorials/start-lapis-and-silo/) for a quick start guide.
:::
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { hasFeature } from '../../../../config.ts';

LAPIS and SILO need a `database_config.yaml`.
It's main purpose is to define the database schema for the sequence metadata.
See the [tutorial](/maintainer-docs/tutorials/start-lapis-and-silo#writing-configuration) for an example,
or use our [config generator](/maintainer-docs/tutorials/generate-your-config) to generate your own config.
See the [tutorial](../tutorials/start-lapis-and-silo#writing-configuration) for an example,
or use our [config generator](../tutorials/generate-your-config) to generate your own config.
More examples can be found in our tests.

The database config is considered static configuration that doesn't change with data updates.
Expand Down Expand Up @@ -46,11 +46,11 @@ it will be beneficial to set `dateToSortBy` to that column.

The metadata object permits the following fields:

| Key | Type | Required | Description |
| ------------- | ------- | -------- | --------------------------------------------------------------------------------------------------- |
| name | string | true | The name of the feature. |
| type | enum | true | The [type of the metadata](#metadata-types). |
| generateIndex | boolean | false | Some [metadata types](#metadata-types) permit generating an index for faster queries on the column. |
| Key | Type | Required | Description |
| ------------- | ------- | -------- | ----------------------------------------------------- |
| name | string | true | The name of the feature. |
| type | enum | true | The [type of the metadata](#metadata-types). |
| generateIndex | boolean | false | See [Generating an index](#generating-an-index) below |

### Metadata Types

Expand Down Expand Up @@ -78,4 +78,4 @@ The feature object permits the following fields:
Currently, there is only one available feature: `sarsCoV2VariantQuery`.
This enables a specialized query language for SARS-CoV-2 instances.

<OnlyIf condition={hasFeature('sarsCoV2VariantQuery')}>See [variant queries](/concepts/variant-query).</OnlyIf>
<OnlyIf condition={hasFeature('sarsCoV2VariantQuery')}>See [variant queries](../../concepts/variant-query).</OnlyIf>
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ All filenames are relative to the `inputDirectory`.
The file with Pango lineage definitions, relative to the inputDirectory.
See the section on the [Pango Lineage Definition File below](#the-pango-lineage-definition-file) for details.
- `referenceGenomeFilename`:
The file with [reference genomes](/maintainer-docs/references/reference-genomes), relative to the inputDirectory.
The file with [reference genomes](../references/reference-genomes), relative to the inputDirectory.

## `NDJSON` Format

Expand All @@ -90,7 +90,7 @@ Each line in the NDJSON file must be a JSON object with the following keys:

:::note
You must configure two metadata columns for insertions in the
[database configuration](/maintainer-docs/references/database-configuration)
[database configuration](../references/database-configuration)
with the exact names and types as in this snippet:

```yaml
Expand All @@ -109,20 +109,20 @@ Otherwise, SILO will not recognize insertions in the NDJSON format.
The sequences object contains sequences for each segment or gene.
It must include all `nucleotideSequences` (or `genes`, respectively) specified in the
[reference genomes](/maintainer-docs/references/reference-genomes)
[reference genomes](../references/reference-genomes)
as keys.
Its values are the sequences as strings of
[valid symbols](/references/nucleotide-and-amino-acid-symbols)
[valid symbols](../../references/nucleotide-and-amino-acid-symbols)
or `null`.

#### Insertions Object

The insertions object contains a list of insertions for each segment or gene.
It must include all `nucleotideSequences` (or `genes`, respectively) specified in the
[reference genomes](/maintainer-docs/references/reference-genomes)
[reference genomes](../references/reference-genomes)
as keys.
Its values are arrays of strings in the format `<position>:<insertion>`.
The insertions must consist of [valid symbols](/references/nucleotide-and-amino-acid-symbols).
The insertions must consist of [valid symbols](../../references/nucleotide-and-amino-acid-symbols).

#### Example of the Schema

Expand Down Expand Up @@ -184,7 +184,7 @@ SILO expects the following files in the `inputDirectory`:
### Metadata File

The metadata file must be a TSV (tab-separated values) file.
Its columns must correspond to the metadata fields specified in the [database configuration](/maintainer-docs/references/database-configuration).
Its columns must correspond to the metadata fields specified in the [database configuration](../references/database-configuration).
Empty values will be interpreted as `null`.

#### Example
Expand Down Expand Up @@ -228,7 +228,7 @@ The filenames must follow this pattern:
The `gene_` prefix is configurable in the preprocessing configuration via `genePrefix`.

There must be one corresponding file for every segment and gene defined in the
[reference genomes](/maintainer-docs/references/reference-genomes).
[reference genomes](../references/reference-genomes).

The header in the FASTA files must match the `primaryKey` column in the metadata file.
There must be a one-to-one correspondence between entries in the metadata file and sequences in the FASTA files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The file must contain a JSON object with two keys:

A reference sequence is a JSON object that permits the following keys:

| Key | Type | Required | Description |
| -------- | ------ | -------- | ----------------------------------------------------------------------------------------------- |
| name | string | true | The name of the sequence. Must be unique. |
| sequence | string | true | The sequence. See [here for allowed characters](/references/nucleotide-and-amino-acid-symbols). |
| Key | Type | Required | Description |
| -------- | ------ | -------- | ---------------------------------------------------------------------------------------------------- |
| name | string | true | The name of the sequence. Must be unique. |
| sequence | string | true | The sequence. See [here for allowed characters](../../references/nucleotide-and-amino-acid-symbols). |
Loading

0 comments on commit b6e8cd8

Please sign in to comment.