6 Commits
Author SHA1 Message Date
Paul Brinkmeier 5cce1fc042 Bump version
deliver / deliver (push) Successful in 1m21s
2026-09-15 19:08:19 +02:00
Paul Brinkmeier 859f1d189e Add zoom=page-width 2026-09-15 19:08:00 +02:00
Paul Brinkmeier 9959c36a42 Make images the same size 2026-09-15 19:04:43 +02:00
Paul Brinkmeier dbacbb10ad Add pics to the readme 2026-09-15 18:54:26 +02:00
Paul Brinkmeier d736766981 Bump version
deliver / deliver (push) Successful in 1m38s
2026-09-15 18:36:50 +02:00
Paul Brinkmeier de08373d2d Log Text instead of String 2026-09-15 18:35:55 +02:00
6 changed files with 19 additions and 7 deletions
+7 -1
View File
@@ -1,5 +1,12 @@
# yore # yore
[fz.beany.club](https://fz.beany.club) shows the [Freiburger Zeitung](https://www.ub.uni-freiburg.de/?id=117) (an important Freiburg im Breisgau newspaper going back to 1784) from exactly 100 years ago.
It is feature-poor on purpose: You can browse a daily issue during your coffee break and that is basically it.
| ![A story about cheese](readme-images/kaese.jpg) | ![Locarno Treaties signed](readme-images/locarno.jpg) |
| --- | --- |
| October 5th, 1925 | September 15th, 1926 |
## Development ## Development
`flake.nix` defines a development shell that has everything you'll need. To enter, run `flake.nix` defines a development shell that has everything you'll need. To enter, run
@@ -47,5 +54,4 @@ By setting `$BASE_DIR` you can persist the database for later runs.
- [x] Test leap second handling in the `time` package - [x] Test leap second handling in the `time` package
- [x] Fix container shutdown delay - [x] Fix container shutdown delay
- [ ] Fix `responseFile` always returning 200 - [ ] Fix `responseFile` always returning 200
- [ ] use queue to sync logging of indexer and main thread
- [x] Vendor PDF.js for consistent cross-platform PDF rendering - [x] Vendor PDF.js for consistent cross-platform PDF rendering
+2 -3
View File
@@ -65,7 +65,6 @@ import Yore.Time (addYears, getCurrentDay, getSecondsUntilMidnight)
import Data.Fixed (Pico) import Data.Fixed (Pico)
import Data.Time.Clock.POSIX (getPOSIXTime) import Data.Time.Clock.POSIX (getPOSIXTime)
import qualified Envy import qualified Envy
import System.IO (BufferMode (..), hSetBuffering, stdout)
import qualified Yore.DB as DB import qualified Yore.DB as DB
import qualified Yore.Log as Log import qualified Yore.Log as Log
@@ -83,7 +82,7 @@ deriving instance Show Config
main :: IO () main :: IO ()
main = do main = do
hSetBuffering stdout NoBuffering Log.setup
cfg <- cfg <-
Envy.load @ConfigT >>= \case Envy.load @ConfigT >>= \case
@@ -244,7 +243,7 @@ instance MimeRender HTML RootModel where
H.iframe ! A.src (H.toValue url) ! A.class_ "content" $ mempty H.iframe ! A.src (H.toValue url) ! A.class_ "content" $ mempty
where where
url :: String url :: String
url = printf "/static/pdfjs-5.7.284-dist/web/viewer.html?file=/api/today/issue/%d/fz.pdf" issue url = printf "/static/pdfjs-5.7.284-dist/web/viewer.html?file=/api/today/issue/%d/fz.pdf#zoom=page-width" issue
(y, m, d) = toGregorian dateThen (y, m, d) = toGregorian dateThen
Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

+9 -2
View File
@@ -1,11 +1,18 @@
module Yore.Log (Yore.Log.error, info) where module Yore.Log (Yore.Log.error, info, setup) where
import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.IO.Class (MonadIO (..))
import Data.Time (ZonedTime, getZonedTime) import Data.Time (ZonedTime, getZonedTime)
import Data.Time.Format (defaultTimeLocale, formatTime) import Data.Time.Format (defaultTimeLocale, formatTime)
import GHC.Stack (HasCallStack, SrcLoc (..), callStack, getCallStack) import GHC.Stack (HasCallStack, SrcLoc (..), callStack, getCallStack)
import System.IO (BufferMode (..), hSetBuffering, stdout)
import Text.Printf (printf) import Text.Printf (printf)
import qualified Data.Text as Text
import qualified Data.Text.IO as TextIO
setup :: IO ()
setup = hSetBuffering stdout LineBuffering
info :: (HasCallStack, MonadIO m) => String -> m () info :: (HasCallStack, MonadIO m) => String -> m ()
info = doLog "INF" info = doLog "INF"
@@ -16,7 +23,7 @@ doLog :: (HasCallStack, MonadIO m) => String -> String -> m ()
doLog level msg = liftIO $ do doLog level msg = liftIO $ do
now <- getZonedTime now <- getZonedTime
let location = getLocation $ getCallStack callStack let location = getLocation $ getCallStack callStack
printf "(%s) (%s) (%s) %s\n" (iso8601Show now) level location msg TextIO.putStrLn $ Text.pack $ printf "(%s) (%s) (%s) %s" (iso8601Show now) level location msg
where where
getLocation :: [(String, SrcLoc)] -> String getLocation :: [(String, SrcLoc)] -> String
-- First entry is always a function from this module, skip it -- First entry is always a function from this module, skip it
+1 -1
View File
@@ -1,7 +1,7 @@
cabal-version: 3.4 cabal-version: 3.4
name: yore name: yore
version: 0.0.10 version: 0.0.12
author: Paul Brinkmeier author: Paul Brinkmeier
maintainer: hallo@pbrinkmeier.de maintainer: hallo@pbrinkmeier.de
copyright: 2023 Paul Brinkmeier copyright: 2023 Paul Brinkmeier