diff --git a/Makefile b/Makefile index 1ab1ebe..c1601f5 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ (displayln (git* next-version))) (target zip + (deps clean) (zip-package)) (target clean diff --git a/README.md b/README.md index aaa235c..3d90132 100644 --- a/README.md +++ b/README.md @@ -320,8 +320,22 @@ UI text is routed through `private/translate.rkt`. The server can be started wit racket main.rkt --data ./wiki-data --language nl ``` -Built-in English and Dutch translations are supplied. Administrators also get a **Translations** action. It opens the special page `wiki-translations-`, for example `wiki-translations-nl`. Translation overrides use one `key = value` assignment per line. Saving that page is enough; the overrides are loaded from PostgreSQL on the next frontend load. Setup and login have built-in translations and therefore do not depend on that special page. +Built-in English and Dutch translations are supplied. Administrators also get a **Translations** action. It opens the single special page `wiki-translations`. When that page does not exist yet, the editor is prefilled with every built-in translation key. Each line can contain several languages, for example `save = nl:Opslaan, en:Save, de:Speichern`. Values containing commas or quotes can be quoted. The active language selects the matching value and falls back to `en` when the requested language is not present. Saving the page is enough; the overrides are loaded from PostgreSQL on the next frontend load. Setup and login retain their built-in translations and therefore do not depend on that special page. Database schema 3 adds `todo_items`. Migration 2 -> 3 creates the table and indexes todo markers from all existing, non-archived pages. The migration is recorded in `wiki_schema` just like earlier schema changes. The web setup also contains a UI-language selector. The selected language is stored in `wiki-data/language.rktd`; the command-line `--language` value is the default when that file does not yet exist. + + +## Version 0.2.12 + +Version 0.2.12 makes the first/start page title the visible wiki name and breadcrumb root. The account line is moved to the upper-right navigation area as compact links (`name · role · sign out · admin`), and page actions such as Edit, History and Delete use the same small link style as the breadcrumb. The breadcrumb/account/action chrome stays sticky while reading long pages. The sidebar keeps `* Todo list` directly below the wiki name; Users and Translations are reached through the Admin page. + +Wiki image options now support placement in addition to width. Examples are `![Schema](schema.png){width=50% center}`, `![Schema](schema.png){width=320px right}`, `![Schema](schema.png){width=320px right float}` and `![Schema](schema.png){width=320px float=left}`. Without `float`, left/center/right controls block alignment. With float enabled, surrounding text can flow around left- or right-aligned images. Width remains limited to pixels and percentages and rendered images keep `max-width: 100%` and automatic height. + +The special translations page is now one page named `wiki-translations`. It is prefilled from the built-in language tables and accepts several languages on one line, for example `save = nl:Opslaan, en:Save, de:Speichern`. + + +## Version 0.2.13 + +Version 0.2.13 centers the wiki name in the sidebar and makes it a link to the first/start page. The sticky top chrome now starts without top padding (`padding-top: 0`). diff --git a/info.rkt b/info.rkt index 980f5e0..f7f6203 100644 --- a/info.rkt +++ b/info.rkt @@ -1,7 +1,7 @@ #lang info (define pkg-authors '(hnmdijkema)) -(define version "0.2.10") +(define version "0.2.14") (define license 'MIT) (define collection "racket-wiki") (define pkg-desc diff --git a/scrbl/racket-wiki.scrbl b/scrbl/racket-wiki.scrbl index 27d5183..316b1da 100644 --- a/scrbl/racket-wiki.scrbl +++ b/scrbl/racket-wiki.scrbl @@ -121,8 +121,9 @@ for page-local checklists. @defproc[(tr [config any/c] [key symbol?]) string?] { Returns the effective UI translation for @racket[key]. Built-in English and Dutch translations are available before the database is configured. Once the -database is available, assignments in the special -@tt{wiki-translations-} page override the built-in strings. +database is available, assignments in the special @tt{wiki-translations} page +override the built-in strings. A line can contain several languages, for example +@tt{save = nl:Opslaan, en:Save, de:Speichern}. } The UI language is selected with @tt{--language} or @racket[#:language]. The diff --git a/server.rkt b/server.rkt index f3611fa..252bfe5 100644 --- a/server.rkt +++ b/server.rkt @@ -198,7 +198,8 @@ CSS (λ (_session) (json-response (hash 'language (current-language config) - 'page (translation-page-slug (current-language config)) + 'page (translation-page-slug) + 'template (translation-page-template) 'translations (translations-for config)))))) (define (page-get-handler config req slug) diff --git a/static/css/wiki.css b/static/css/wiki.css index fbd150d..41e56d5 100644 --- a/static/css/wiki.css +++ b/static/css/wiki.css @@ -195,9 +195,16 @@ body { } .brand { + display: block; color: #111; font-size: 1.18rem; margin-bottom: 14px; + text-align: center; + text-decoration: none; +} + +.brand:hover { + text-decoration: underline; } #user-box, @@ -795,3 +802,167 @@ body.editor-mode .editor-metadata-row { gap: 3px; } } + +/* Top navigation -------------------------------------------------------- */ +.top-chrome { + position: sticky; + z-index: 120; + top: 0; + margin: -8px 0 20px; + padding: 0 0 10px; + background: white; + border-bottom: 1px solid #ededed; +} + +.account-bar { + display: flex; + justify-content: flex-end; + align-items: baseline; + gap: .5rem; + min-height: 1.35rem; + margin-bottom: 4px; + font-size: .82rem; + line-height: 1.35; +} + +.account-bar a, +.page-action-links a, +.admin-menu a, +.sidebar-primary-link { + color: var(--wiki-link); + text-decoration: none; +} + +.account-bar a:hover, +.page-action-links a:hover, +.admin-menu a:hover, +.sidebar-primary-link:hover { + text-decoration: underline; +} + +.navigation-row { + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + gap: 1rem; + align-items: baseline; +} + +.navigation-row .breadcrumbs { + max-width: none; + margin: 0; +} + +.page-action-links { + display: flex; + justify-content: flex-end; + gap: .65rem; + white-space: nowrap; + font-size: .86rem; + line-height: 1.35; +} + +.sidebar-primary-link { + display: block; + margin: -4px 0 8px; + padding: 2px 0; + font-size: .9rem; +} + +.admin-menu { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: .65rem; + font-size: 1rem; +} + +#user-admin-view { + max-width: 1040px; +} + +/* Wiki image layout extensions. Width itself remains a sanitized inline + style generated by wiki.js; these fixed classes only control placement. */ +.markdown-body img.wiki-image-left, +.EasyMDEContainer .editor-preview img.wiki-image-left, +.EasyMDEContainer .editor-preview-side img.wiki-image-left { + display: block; + margin-left: 0; + margin-right: auto; +} + +.markdown-body img.wiki-image-center, +.EasyMDEContainer .editor-preview img.wiki-image-center, +.EasyMDEContainer .editor-preview-side img.wiki-image-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.markdown-body img.wiki-image-right, +.EasyMDEContainer .editor-preview img.wiki-image-right, +.EasyMDEContainer .editor-preview-side img.wiki-image-right { + display: block; + margin-left: auto; + margin-right: 0; +} + +.markdown-body img.wiki-image-float-left, +.EasyMDEContainer .editor-preview img.wiki-image-float-left, +.EasyMDEContainer .editor-preview-side img.wiki-image-float-left { + float: left; + margin: .2rem 1rem .75rem 0; +} + +.markdown-body img.wiki-image-float-right, +.EasyMDEContainer .editor-preview img.wiki-image-float-right, +.EasyMDEContainer .editor-preview-side img.wiki-image-float-right { + float: right; + margin: .2rem 0 .75rem 1rem; +} + +@media (max-width: 900px) { + .top-chrome { + position: static; + margin-top: 0; + } + + .account-bar { + justify-content: flex-start; + flex-wrap: wrap; + } + + .navigation-row { + grid-template-columns: 1fr; + gap: .35rem; + } + + .page-action-links { + justify-content: flex-start; + } +} + +/* 0.2.12 navigation polish --------------------------------------------- */ +.account-separator { + color: #999; +} + +/* Account and page actions are navigation, not push buttons. Keep them on + the same visual scale as the breadcrumb. */ +.account-bar, +.page-action-links { + font-size: .86rem; +} + +.top-chrome { + top: 0; +} + +/* Keep the page navigation available while reading long documents too. */ +@media (max-width: 900px) { + .top-chrome { + position: sticky; + top: 0; + z-index: 120; + background: white; + } +} diff --git a/static/index.html b/static/index.html index 4989c89..42e57b2 100644 --- a/static/index.html +++ b/static/index.html @@ -15,13 +15,8 @@
- +
+ + +
-
- - - -
@@ -109,18 +117,28 @@ + +