Skip to content

Commit

Permalink
fix offline instructions on site
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-ji committed Feb 13, 2024
1 parent 56fba7d commit d178ca5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
MINIMAP2_VERSION,
FASTP_VERSION,
OFFLINE_INSTRUCTIONS,
OFFLINE_INSTRUCTIONS_KEYWORDS,
OFFLINE_INSTRUCTIONS_KEYWORDS_START,
OFFLINE_INSTRUCTIONS_KEYWORDS_END,
REF_GENOMES_DIR,
REF_GENOME_REPO_STRUCTURE_LINK,
CLEAR_LOG,
Expand Down Expand Up @@ -147,7 +148,8 @@ export class App extends Component {
const res = await fetch(`${window.location.origin}${import.meta.env.BASE_URL || ''}${OFFLINE_INSTRUCTIONS}`);
const text = await res.text();
const html = marked(text);
const offlineInstructions = html.slice(html.indexOf(OFFLINE_INSTRUCTIONS_KEYWORDS) + OFFLINE_INSTRUCTIONS_KEYWORDS.length)
let offlineInstructions = html.slice(html.indexOf(OFFLINE_INSTRUCTIONS_KEYWORDS_START) + OFFLINE_INSTRUCTIONS_KEYWORDS_START.length)
offlineInstructions = offlineInstructions.slice(0, offlineInstructions.indexOf(OFFLINE_INSTRUCTIONS_KEYWORDS_END))
this.setState({ offlineInstructions });
}

Expand Down
3 changes: 2 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export const REF_GENOMES_DIR = "data/Reference-Genomes/";
export const REF_GENOME_REPO_STRUCTURE_LINK = "data/REFS.json";

export const OFFLINE_INSTRUCTIONS = "/README.md";
export const OFFLINE_INSTRUCTIONS_KEYWORDS = "<h3>ViralWasm-Consensus Offline</h3>\n";
export const OFFLINE_INSTRUCTIONS_KEYWORDS_START = "<h2>ViralWasm-Consensus Offline</h2>\n";
export const OFFLINE_INSTRUCTIONS_KEYWORDS_END = "<h2>Citing ViralWasm-Consensus</h2>\n";
export const BIOWASM_WORKING_DIR = "/shared/data/";
export const OUTPUT_ID = "output-text";
export const EXAMPLE_REF = "NC_045512"; // SARS-CoV-2 (COVID-19)
Expand Down

0 comments on commit d178ca5

Please sign in to comment.