Update README.md
This commit is contained in:
@@ -4,117 +4,83 @@ Minimal self-hosted personal wiki. Folders are pages.
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Pages** every folder is a page. Place an `index.md` inside a folder and it renders as HTML. Drop any other files (PDFs, images, etc.) alongside it and they appear in the listing below the content. Navigating to a path that does not exist shows a **[CREATE]** prompt.
|
- **Pages**: a folder's `index.md` renders as HTML, and the folder's other files are listed below it. Going to a missing path lets you create the page there.
|
||||||
|
- **Editing**: edit the whole page or a single heading's section. Tick task checkboxes directly on the rendered page.
|
||||||
|
- **Move, rename, delete**: moving a page onto an empty folder offers to merge into it.
|
||||||
|
- **View settings**: show the file list as a list or thumbnail grid, sorted by name, date, or size. Videos get thumbnails when `ffmpeg` is installed.
|
||||||
|
- **Search**: find pages by name.
|
||||||
|
- **Wikilinks**: `[[query]]` or `[[query::label]]`. They open a search, so links still work after a page is renamed. Typing `[[` in the editor suggests page names. Embed files with ``.
|
||||||
|
- **Movie import**: create a page from OMDb metadata. Asks once for a free [OMDb API key](https://www.omdbapi.com/apikey.aspx) and keeps it in the browser.
|
||||||
|
- **Special folders**: a [photo diary](#diary) and a [fitness dashboard](#fitness).
|
||||||
|
- **Quick-add bookmarklet**: save the current tab to a wiki page.
|
||||||
|
- **Companion app**: an optional desktop helper, downloadable from the wiki footer. It opens wiki files in local apps and folders in the file manager.
|
||||||
|
|
||||||
- **View settings** per folder, display the file listing as a list or thumbnail grid and pick the sort key/order, via the **view** button in the `Files` header. See the [View Settings](#view-settings) section.
|
## Build & run
|
||||||
|
|
||||||
- **Search** search across all page names (folder names) in the wiki, accessible from the navigation bar.
|
The wiki binary embeds the companion binaries, so build those first:
|
||||||
|
|
||||||
- **Wikilinks** link between pages with `[[search query]]` syntax, or `[[query::display text]]` to override the label. The link opens the search page for that query, so it keeps resolving after a page is renamed or moved. Files embed with standard Markdown image syntax — `` — relative to the page they sit on.
|
|
||||||
|
|
||||||
- **Movie import** import movie entries via the OMDb API. Fetches title, year, runtime, genre, director, cast, plot, and poster, and pre-fills a new page with that metadata.
|
|
||||||
|
|
||||||
- **Special folder types** folders can opt into custom rendering (e.g. a photo diary with calendar navigation). See the [Special Folder Types](#special-folder-types) section for details.
|
|
||||||
|
|
||||||
- **Quick-add bookmarklet** save the current browser tab to a predetermined wiki page (e.g. `/Topics/Bookmarks/`) with one click. See the [Quick-Add Bookmarklet](#quick-add-bookmarklet) section.
|
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# local
|
make companion-release # once, and after companion changes
|
||||||
go build -o datascape .
|
go build -o datascape . # local
|
||||||
|
GOOS=linux GOARCH=arm go build -o datascape . # QNAP NAS
|
||||||
# QNAP NAS (linux/arm)
|
./datascape -dir ./wiki -addr :8080 -user me -pass secret
|
||||||
GOOS=linux GOARCH=arm go build -o datascape .
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
| Flag | Default | |
|
||||||
|
|------|---------|-|
|
||||||
```bash
|
|
||||||
go run . -dir ./wiki -addr :8080
|
|
||||||
go run . -dir ./wiki -addr :8080 -user me -pass secret
|
|
||||||
```
|
|
||||||
|
|
||||||
| Flag | Default | Description |
|
|
||||||
|------|---------|-------------|
|
|
||||||
| `-addr` | `:8080` | Listen address |
|
| `-addr` | `:8080` | Listen address |
|
||||||
| `-dir` | `./wiki` | Wiki root directory |
|
| `-dir` | `./wiki` | Wiki root |
|
||||||
| `-cache` | `./cache` | Thumbnail cache directory |
|
| `-cache` | `./cache` | Thumbnail cache |
|
||||||
| `-user` | _(none)_ | Basic auth username — omit to disable auth |
|
| `-user`, `-pass` | | Basic auth (omit to disable) |
|
||||||
| `-pass` | _(none)_ | Basic auth password |
|
| `-reindex-interval` | `30m` | Search index rebuild (`0` = off) |
|
||||||
| `-reindex-interval` | `30m` | Periodic search index rebuild interval (`0` disables) |
|
|
||||||
|
|
||||||
## View Settings
|
## `.page-settings`
|
||||||
|
|
||||||
The **view** button in a folder's `Files` header sets how its listing renders,
|
Per-folder `key = value` file. The **view** button in the `Files` header sets the first three keys.
|
||||||
persisting three keys to `.page-settings`:
|
|
||||||
|
|
||||||
| Key | Values (default first) |
|
| Key | Values (default first) |
|
||||||
|------|------------------------|
|
|-----|------------------------|
|
||||||
| `view` | `list`, `thumbnail` |
|
| `view` | `list`, `thumbnail` |
|
||||||
| `sort` | `name`, `modified`, `size` (folders always sort by name, grouped first) |
|
| `sort` | `name`, `modified`, `size` |
|
||||||
| `order` | `asc`, `desc` |
|
| `order` | `asc`, `desc` |
|
||||||
|
| `type` | `diary`, `fitness` |
|
||||||
|
|
||||||
## Special Folder Types
|
## Keyboard shortcuts
|
||||||
|
|
||||||
A folder can opt into special rendering by adding a `.page-settings` file. The
|
All use Alt+Shift.
|
||||||
same file also holds the [View Settings](#view-settings) keys; only the `type`
|
|
||||||
key selects a special renderer:
|
| Where | Keys |
|
||||||
|
|-------|------|
|
||||||
|
| Anywhere | `E` edit, `N` new page, `M` move, `F` search |
|
||||||
|
| Editor | `S` save, `1`–`3` heading, `B`/`I` bold/italic, `C`/`K` code/code block, `L` link, `P` wikilink, `G` embed, `U`/`O`/`X` bullet/numbered/task list, `Q` quote, `R` rule, `T` format table, `D`/`W` date (ISO/long), `V` movie, `Y` delete line |
|
||||||
|
|
||||||
|
## Diary
|
||||||
|
|
||||||
```
|
```
|
||||||
type = diary
|
Diary/
|
||||||
```
|
|
||||||
|
|
||||||
### Diary
|
|
||||||
|
|
||||||
Designed for a chronological photo diary. The whole year lives in a single
|
|
||||||
file as ISO-headed sections; photos are loose JPEGs named with a date prefix.
|
|
||||||
|
|
||||||
```
|
|
||||||
FolderName/
|
|
||||||
.page-settings ← type = diary
|
.page-settings ← type = diary
|
||||||
YYYY/
|
2026/
|
||||||
index.md ← `# YYYY` + `## YYYY-MM` + `### YYYY-MM-DD` sections
|
index.md ← # 2026, ## 2026-05, ### 2026-05-11 sections
|
||||||
YYYY-MM-DD Desc.jpg ← photos named with the date they belong to
|
2026-05-11 Beach.jpg ← photos go under their date's section
|
||||||
```
|
```
|
||||||
|
|
||||||
The year page (`YYYY/`) renders every section in the file with photos
|
The year page shows each day's section with its photos. Months and days that are missing (up to today) appear as placeholders with an `[edit]` button. A calendar in the sidebar jumps to any date.
|
||||||
attached to each `### YYYY-MM-DD` heading. Months and days the file doesn't
|
|
||||||
yet contain are rendered as **virtual** headings with an `[edit]` button that
|
|
||||||
splices a new section into the year file at the right chronological position;
|
|
||||||
virtual day headings still carry photos for that date. Past years render
|
|
||||||
every month/day slot; the current year stops at today; future years skip
|
|
||||||
virtual entries entirely. The file may contain non-date headings (e.g.
|
|
||||||
`## Events` → `### Festival` between `# YYYY` and `## YYYY-01`); these keep
|
|
||||||
their document position.
|
|
||||||
|
|
||||||
A sidebar calendar widget shows one month grid at a time; the month-name
|
Bookmarkable shortcuts: `<diary>/today/`, `<diary>/this-month/`, `<diary>/this-year/`.
|
||||||
button opens a dropdown of all twelve months, and a separate year dropdown
|
|
||||||
jumps between years. Day cells link to the matching anchor on the year page
|
|
||||||
regardless of whether the date has a real section yet.
|
|
||||||
|
|
||||||
#### Persistent date links
|
## Fitness
|
||||||
|
|
||||||
Each diary root exposes three stable paths intended for browser bookmarks.
|
With `type = fitness`, a folder shows weight charts (daily and weekly mean, with your goal) below its content. Copy the [Waistline](https://github.com/davidhealey/waistline) app's export into the folder as `waistline_export.json`. Each new export replaces the old file.
|
||||||
They resolve against the year page rather than separate per-day URLs:
|
|
||||||
|
|
||||||
| Path | Redirects to |
|
## Quick-add bookmarklet
|
||||||
|------|-------------|
|
|
||||||
| `<diary>/today/` | `<diary>/YYYY/#YYYY-MM-DD` (or the year file's insert-section editor when today's section doesn't exist yet) |
|
|
||||||
| `<diary>/this-month/` | `<diary>/YYYY/#YYYY-MM` |
|
|
||||||
| `<diary>/this-year/` | `<diary>/YYYY/` |
|
|
||||||
|
|
||||||
Legacy `YYYY/MM/` and `YYYY/MM/DD/` URLs (no longer the canonical form) redirect to the matching anchor on the year page.
|
Replace `wiki.host` and `/Topics/Bookmarks/` with your host and target page:
|
||||||
|
|
||||||
## Quick-Add Bookmarklet
|
|
||||||
|
|
||||||
Replace `wiki.host` with your wiki host and `/Topics/Bookmarks/` with the destination page (one bookmarklet per target):
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
javascript:(function(){var s=window.getSelection().toString().trim();var t=s||document.title;var u=location.href;var to='/Topics/Bookmarks/';var q='?to='+encodeURIComponent(to)+'&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t);window.open('https://wiki.host/quickadd'+q,'quickadd','width=480,height=320');})();
|
javascript:(function(){var s=window.getSelection().toString().trim();var t=s||document.title;var u=location.href;var to='/Topics/Bookmarks/';var q='?to='+encodeURIComponent(to)+'&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t);window.open('https://wiki.host/quickadd'+q,'quickadd','width=480,height=320');})();
|
||||||
```
|
```
|
||||||
|
|
||||||
Each save appends an entry of the following form to the destination page's `index.md`:
|
Each save adds this to the target page's `index.md`:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
- [Example Page](https://example.com)
|
- [Example Page](https://example.com)
|
||||||
|
|||||||
Reference in New Issue
Block a user