Skip to content

Commit

Permalink
Moved serve_quarto.py to scripts/
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlo committed Oct 25, 2024
1 parent 6476194 commit 735bd1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ You can use a Flask server to serve the site, and handle automatic rebuilding of

```bash
# serve the site
docker run --rm --platform linux/amd64 -u $(id -u):$(id -g) -v ${PWD}:/qmd -p 5000:5000 ghcr.io/nbisweden/workshop-ngsintro:latest python3 serve_quarto.py
docker run --rm --platform linux/amd64 -u $(id -u):$(id -g) -v ${PWD}:/qmd -p 5000:5000 ghcr.io/nbisweden/workshop-ngsintro:latest python3 scripts/serve_quarto.py
```

## Test scripts
Expand Down
3 changes: 1 addition & 2 deletions serve_quarto.py → scripts/serve_quarto.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def read_output_dir_from_quarto_yml(quarto_yml_path):
quarto_config = yaml.safe_load(file)
return quarto_config.get('project', {}).get('output-dir', 'default-output-folder')

output_folder = read_output_dir_from_quarto_yml(quarto_yml_path)

class QuartoHandler(FileSystemEventHandler):
def __init__(self):
Expand Down Expand Up @@ -61,6 +60,6 @@ def serve_file(filename):


if __name__ == '__main__':
output_folder = read_output_dir_from_quarto_yml(quarto_yml_path) # Update the output folder on the startup
output_folder = "../" + read_output_dir_from_quarto_yml(quarto_yml_path) # Update the output folder on the startup, adding ../ to account for this script being in scripts/
app.run(host='0.0.0.0', port=5000, debug=True)

0 comments on commit 735bd1f

Please sign in to comment.