Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
355cd5e
first experiments with an http API
nevrome Jan 3, 2025
765d6c5
experiments with per-package pages
nevrome Jan 3, 2025
5061142
version handling for package page selection
nevrome Jan 6, 2025
d1f39e2
added download button
nevrome Jan 6, 2025
91c05db
cleaning up to make the checks run through
nevrome Jan 6, 2025
60e54d9
experimenting with routing ideas
nevrome Jan 6, 2025
650fc2b
decided to switch to a simpler http API interface
nevrome Jan 6, 2025
8604128
added missing spaces
nevrome Jan 6, 2025
df42db0
started to think about samples pages, but got stuck on package versions
nevrome Jan 6, 2025
d6870bb
decided to go for a fully hierachical structure
nevrome Jan 6, 2025
0ac12ba
added pages for each sample
nevrome Jan 6, 2025
f5188f6
code layout
nevrome Jan 6, 2025
804976f
experiments with a small css framwork
nevrome Jan 7, 2025
8935013
adding a bit of information for each view
nevrome Jan 7, 2025
8e20e8a
some visual improvements
nevrome Jan 7, 2025
f72488c
embedded css stylesheet in trident
nevrome Jan 7, 2025
3ece992
stylish haskell
nevrome Jan 7, 2025
f1e4ea5
merged package and package version page
nevrome Jan 8, 2025
ba2905f
improving template
nevrome Jan 8, 2025
72e39e2
stylish haskell
nevrome Jan 8, 2025
97ba7dc
special treatment of known archives
nevrome Jan 8, 2025
3090968
working on the leaflet integration - not there yet
nevrome Jan 8, 2025
2b1adc4
stylish-haskell
nevrome Jan 8, 2025
965ea60
finally solved the leaflet issue
nevrome Jan 8, 2025
cf3de7e
hacky solution to get markers on the map
nevrome Jan 8, 2025
5aadb68
map styling
nevrome Jan 8, 2025
563c038
stylish-haskell
nevrome Jan 8, 2025
1b0a340
layout changes
nevrome Jan 9, 2025
f1b6bc5
cleaning up
nevrome Jan 9, 2025
67b6f9c
another map
nevrome Jan 10, 2025
6f2728c
added a little breadcrumb menu
nevrome Jan 10, 2025
6be976f
universal way to render janno rows to html
nevrome Jan 10, 2025
2c2b93a
added a map for the sample page
nevrome Jan 10, 2025
8f6a0d3
added a bibliography field
nevrome Jan 10, 2025
e8ad083
layout changes
nevrome Jan 10, 2025
8a5e95c
stylish haskell
nevrome Jan 10, 2025
560f86e
neat download button
nevrome Jan 10, 2025
32fd1e1
added more links in package table
nevrome Jan 12, 2025
60e0342
some more package information
nevrome Jan 12, 2025
f6c98c4
added a legend to the map
nevrome Jan 12, 2025
becc0f8
stylish haskell
nevrome Jan 12, 2025
8a11bf9
added a little popup to the map markers
nevrome Jan 12, 2025
cef4d0f
some code cleaning
nevrome Jan 13, 2025
0b0c8a5
work towards a better mechanism to pass info for mapmarkers
nevrome Jan 13, 2025
65b296b
completed better map popup
nevrome Jan 13, 2025
26a20a6
cleaning up
nevrome Jan 13, 2025
4bbb7dc
fixed an issue emerging from the way the JSON was handed to the javas…
nevrome Jan 14, 2025
ca0aa1e
code order
nevrome Jan 14, 2025
7a0c89c
introduced an intermediate top level route explorer
nevrome Jan 14, 2025
3479389
javascript var -> const
nevrome Jan 14, 2025
7a5de9e
Merge branch 'master' into html
nevrome Jan 14, 2025
74a7c04
Merge branch 'master' into html
nevrome Jan 14, 2025
0ab5fbf
fixed function name
nevrome Jan 14, 2025
ebebcba
Merge branch 'master' into html
nevrome Jan 16, 2025
e3ae1fb
changes for new GHC and resolver version
nevrome Jan 16, 2025
edc8606
removed accidentally pushed test data
nevrome Feb 6, 2025
9aedefb
worked in neat simplifications proposed by @stschiff
nevrome Feb 6, 2025
03d12c5
stylish-haskell
nevrome Feb 6, 2025
369dbb8
draft of a mechanism to handle archive specification primarily for th…
nevrome Feb 6, 2025
2e8b6f9
remaining necessary changes
nevrome Feb 7, 2025
84dcdab
fixed archive name
nevrome Feb 7, 2025
6090d62
Merge branch 'master' into html
nevrome Feb 7, 2025
80ea2d5
Merge branch 'master' into htmlInput
nevrome Feb 7, 2025
c0d15e2
Merge branch 'html' into htmlInput
nevrome Feb 7, 2025
a847174
minor fixes
nevrome Feb 11, 2025
758e7fe
Merge pull request #336 from poseidon-framework/htmlInput
nevrome Feb 11, 2025
c992bd9
version bump
nevrome Feb 11, 2025
8183ab1
realized that the zip option is unnecessary.
nevrome Feb 11, 2025
ee936c4
fixed package version-related bug
nevrome Feb 11, 2025
3d369c6
hiding Download button when not available
nevrome Feb 11, 2025
d45c543
fixed zip download links
nevrome Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- V 1.6.3.0:
- Added an html (website) API to the set of endpoints served by trident `serve`.
- The html is build with `blaze-html` and `blaze-markup`.
- The javascript for a leaflet map is embedded into the Haskell code with `neat-interpolation`.
- The css -- a small class-free stylesheet ("pico css") -- is embedded into trident using `file-embed`.
- Slightly changed the way the archive configuration works for `serve` on the command line.
- V 1.6.2.2:
- Fixed a small bug that prevented calculation of checksums for genotype data in `rectify`.
- V 1.6.2.1:
Expand Down
3 changes: 3 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Embedded data files

- pico.classless.blue.min.css: CSS stylesheet from https://picocss.com
4 changes: 4 additions & 0 deletions data/pico.classless.blue.min.css

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions poseidon-hs.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: poseidon-hs
version: 1.6.2.2
version: 1.6.3.0
synopsis: A package with tools for working with Poseidon genotype data
description: The tools in this package read and analyse Poseidon-formatted genotype databases, a modular system for storing genotype data from thousands of individuals.
license: MIT
Expand All @@ -16,7 +16,8 @@ library
exposed-modules: Poseidon.Package, Poseidon.GenotypeData, Poseidon.BibFile, Poseidon.Janno,
Poseidon.ColumnTypes, Poseidon.ColumnTypesUtils, Poseidon.MathHelpers,
Poseidon.PoseidonVersion, Poseidon.SequencingSource, Poseidon.Chronicle,
Poseidon.EntityTypes, Poseidon.ServerClient, Poseidon.Contributor, Poseidon.Version
Poseidon.EntityTypes, Poseidon.ServerClient, Poseidon.ServerHTML,
Poseidon.ServerStylesheet, Poseidon.Contributor, Poseidon.Version,
Poseidon.CLI.List, Poseidon.CLI.Chronicle, Poseidon.CLI.Serve,
Poseidon.CLI.Summarise, Poseidon.CLI.Validate, Poseidon.Utils,
Poseidon.CLI.Survey, Poseidon.CLI.Forge, Poseidon.CLI.Init,
Expand All @@ -32,7 +33,7 @@ library
http-conduit, conduit, http-types, zip-archive,
unordered-containers, network-uri, optparse-applicative, co-log, regex-tdfa,
scientific, country, generics-sop, containers, process, deepseq, template-haskell,
MissingH
blaze-html, blaze-markup, neat-interpolation, file-embed, MissingH
default-language: Haskell2010

executable trident
Expand Down
2 changes: 1 addition & 1 deletion src-executables/Main-trident.hs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ timetravelOptParser = TimetravelOptions <$> parseBasePaths
<*> parseTimetravelChronPath

serveOptParser :: OP.Parser ServeOptions
serveOptParser = ServeOptions <$> parseArchiveBasePaths
serveOptParser = ServeOptions <$> parseArchiveConfig
<*> parseMaybeZipDir
<*> parsePort
<*> parseIgnoreChecksums
Expand Down
18 changes: 9 additions & 9 deletions src/Poseidon/BibFile.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
module Poseidon.BibFile (dummyBibEntry, readBibTeXFile, writeBibTeXFile, BibTeX, BibEntry(..), parseAuthors, authorAbbrvString) where
module Poseidon.BibFile (dummyBibEntry, readBibTeXFile, writeBibTeXFile, BibTeX, BibEntry(..), renderBibEntry, parseAuthors, authorAbbrvString) where

import Poseidon.Utils (PoseidonException (..),
showParsecErr)
Expand Down Expand Up @@ -70,15 +70,15 @@ copied the relevant code here and modified it as needed.
writeBibTeXFile :: FilePath -> BibTeX -> IO ()
writeBibTeXFile path entries = withFile path WriteMode $ \outH -> do
forM_ entries $ \bibEntry -> do
let entryString = writeEntry bibEntry
let entryString = renderBibEntry bibEntry
hPutStrLn outH entryString
where
writeEntry :: BibEntry -> String
writeEntry (BibEntry entryType bibId items) =
let formatItem (name, value_) =
" " ++ name ++ " = {" ++ value_ ++ "},\n"
in "@" ++ entryType ++ "{" ++ bibId ++ ",\n" ++
concatMap formatItem items ++ "}\n"

renderBibEntry :: BibEntry -> String
renderBibEntry (BibEntry entryType bibId items) =
let formatItem (name, value_) =
" " ++ name ++ " = {" ++ value_ ++ "},\n"
in "@" ++ entryType ++ "{" ++ bibId ++ ",\n" ++
concatMap formatItem items ++ "}\n"

bibFileParser :: Parser [BibEntry]
bibFileParser = bibCommentParser >> sepEndBy bibEntryParser bibCommentParser
Expand Down
37 changes: 28 additions & 9 deletions src/Poseidon/CLI/OptparseApplicativeParsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
RepoLocationSpec (..))
import Poseidon.CLI.Rectify (ChecksumsToRectify (..),
PackageVersionUpdate (..))
import Poseidon.CLI.Serve (ArchiveConfig (..),
ArchiveSpec (..))
import Poseidon.CLI.Validate (ValidatePlan (..))
import Poseidon.Contributor (ContributorSpec (..),
contributorSpecParser)
Expand Down Expand Up @@ -804,24 +806,41 @@
OP.help "The cert file of the TLS Certificate used for HTTPS."
)

parseArchiveBasePaths :: OP.Parser [(String, FilePath)]
parseArchiveBasePaths = OP.some parseArchiveBasePath
parseArchiveConfig :: OP.Parser (Either ArchiveConfig FilePath)
parseArchiveConfig = Left <$> parseArchiveConfigCLI <|> Right <$> parseArchiveConfigPath

Check warning on line 810 in src/Poseidon/CLI/OptparseApplicativeParsers.hs

View check run for this annotation

Codecov / codecov/patch

src/Poseidon/CLI/OptparseApplicativeParsers.hs#L810

Added line #L810 was not covered by tests

parseArchiveConfigCLI :: OP.Parser ArchiveConfig
parseArchiveConfigCLI = ArchiveConfig <$> OP.some parseArchiveSpec

Check warning on line 813 in src/Poseidon/CLI/OptparseApplicativeParsers.hs

View check run for this annotation

Codecov / codecov/patch

src/Poseidon/CLI/OptparseApplicativeParsers.hs#L813

Added line #L813 was not covered by tests
where
parseArchiveBasePath :: OP.Parser (String, FilePath)
parseArchiveBasePath = OP.option (OP.eitherReader parseArchiveNameAndPath) (
parseArchiveSpec :: OP.Parser ArchiveSpec
parseArchiveSpec = OP.option (OP.eitherReader parseArchiveNameAndPath) (

Check warning on line 816 in src/Poseidon/CLI/OptparseApplicativeParsers.hs

View check run for this annotation

Codecov / codecov/patch

src/Poseidon/CLI/OptparseApplicativeParsers.hs#L816

Added line #L816 was not covered by tests
OP.long "baseDir" <>
OP.short 'd' <>
OP.metavar "DSL" <>
OP.help "A base path, prepended by the corresponding archive name under which \
\packages in this path are being served. Example: arch1=/path/to/basepath. Can \
\be given multiple times. Multiple paths for the same archive are combined internally. \
\packages in this path are being served. Example: arch1=/path1/to/basepath. \
\Multiple paths for the same archive can be given separated by comma, e.g. \
\Example: arch1=/path1/to/basepath,/path2/to/basepath. \
\Can be given multiple times. \
\The very first named archive is considered to be the default archive on the server.")
parseArchiveNameAndPath :: String -> Either String (String, FilePath)
parseArchiveNameAndPath :: String -> Either String ArchiveSpec
parseArchiveNameAndPath str =
let parts = splitOn "=" str
in case parts of
[name, fp] -> return (name, fp)
_ -> Left $ "could not parse archive and base directory " ++ str ++ ". Please use format name=path "
[name, fp] -> do
let fps = splitOn "," fp
return $ ArchiveSpec name fps Nothing Nothing Nothing
_ -> Left $ "could not parse archive and base directory " ++ str ++
". Please use format name=path1,path2,... "

Check warning on line 834 in src/Poseidon/CLI/OptparseApplicativeParsers.hs

View check run for this annotation

Codecov / codecov/patch

src/Poseidon/CLI/OptparseApplicativeParsers.hs#L830-L834

Added lines #L830 - L834 were not covered by tests

parseArchiveConfigPath :: OP.Parser FilePath
parseArchiveConfigPath = OP.strOption (
OP.long "archiveConfigFile" <>
OP.metavar "FILE" <>
OP.help "Path to a .yml config file for the server archive configuration. \

Check warning on line 840 in src/Poseidon/CLI/OptparseApplicativeParsers.hs

View check run for this annotation

Codecov / codecov/patch

src/Poseidon/CLI/OptparseApplicativeParsers.hs#L837-L840

Added lines #L837 - L840 were not covered by tests
\This file must include a list of \"archives:\", each with the fields\
\ \"name\", \"paths\", \"description\", \"URL\" and \"dataURL\"."
)

parseMaybeArchiveName :: OP.Parser (Maybe String)
parseMaybeArchiveName = OP.option (Just <$> OP.str) (
Expand Down
Loading