Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/
dist/
.astro/
.sources/
/content/.mdbase/
.DS_Store


Expand Down
83 changes: 0 additions & 83 deletions DESIGN.md

This file was deleted.

8 changes: 8 additions & 0 deletions PRODUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ about data ownership, and repetitive card grids. Do not imply that Connect is
the mdbase specification, that TaskNotes owns the ecosystem, or that hosted
collections are zero-knowledge.

## Language

Use literal headings and ordinary sentences. State the current artifact,
profile, security boundary, or release status directly. Avoid slogans,
competitive framing, and language that comments on how candid or precise the
site itself is. Avoid correlative contrast constructions such as “not X, but
Y,” “without X,” and “rather than X.” State the relevant behavior directly.

## Design Principles

- Show a real collection and its routes before making abstract claims.
Expand Down
16 changes: 16 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { defineConfig } from "astro/config";
import sitemap from "@astrojs/sitemap";
import { satteri } from "@astrojs/markdown-satteri";
import { codeFigures, codeTitle, includeFiles, recordings } from "./src/markdown/doc-records.mjs";

const site = process.env.MDBASE_SITE_ORIGIN ?? "https://mdbase.dev";

Expand All @@ -11,5 +13,19 @@ export default defineConfig({
integrations: [sitemap()],
build: {
format: "directory"
},
// The documentation records in content/ (see src/content.config.ts).
markdown: {
processor: satteri({
// Text is kept as written: no curly quotes or dashes added.
features: { headingAttributes: true, smartPunctuation: false },
mdastPlugins: [includeFiles, recordings],
hastPlugins: [codeFigures]
}),
shikiConfig: {
// Colours come from the --syntax-* roles in global.css.
theme: "css-variables",
transformers: [codeTitle]
}
}
});
47 changes: 47 additions & 0 deletions content/_types/doc-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
kind: mdbase.type
name: doc-page
version: 1
description: One page of the documentation on mdbase.dev.
match:
path_glob: "**/*.md"
schema:
dialect: json-schema-2020-12
value:
$schema: "https://json-schema.org/draft/2020-12/schema"
type: object
additionalProperties: false
required: [title, description, section]
properties:
title:
type: string
minLength: 1
description:
type: string
minLength: 1
section:
enum: [sdk, mcp, editor, reader, writer]
collection:
display:
name_field: title
---

# Documentation page

Each record is one page of the documentation on mdbase.dev. The site serves
`sdk/react.md` at `/sdk/react/`, and a folder's `index.md` at the folder's own
address, so `apps/reader/index.md` is `/apps/reader/`.

`title` is the page's heading and `description` the sentence under it.
`section` is the documentation set the page belongs to, which picks its
sidebar.

The body is ordinary Markdown with three additions the site understands:

- A heading can keep a fixed anchor: `## Saved views {#views}`.
- A code block can name its file: ` ```ts title="src/mdbase.ts" `. With
`file="examples/worklog/src/mdbase.ts"` it shows that file from the site's
repository instead of its own contents; `pick="scripts"` keeps one key of a
JSON file.
- An image whose address is a recording in `/videos/` is shown as that
recording, with its captions and text description.
42 changes: 42 additions & 0 deletions content/apps/editor/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Get started
description: "mdbase Editor is a browser editor for a whole mdbase collection: notes, frontmatter, links and types."
section: editor
---

## What it is {#what}

mdbase Editor opens one mdbase collection and shows every record as a note. It edits the Markdown files in place. Paths, frontmatter and type definitions stay as ordinary files that other tools, such as a text editor, Obsidian or an AI client, can keep using.

It works with Cloud copy and Private collections. A Cloud copy collection opens whenever you are online. The Editor reaches a Private collection through one of your devices, so one of them must be online, such as a computer running the [desktop app](/downloads/).

## Open a collection {#open}

1. Go to [editor.mdbase.dev](https://editor.mdbase.dev/).
2. Sign in to mdbase Connect. If you do not have an account, [sign up](https://connect.mdbase.dev/signup) first.
3. Choose a collection.
4. Approve the Editor's access to that one collection. Reading is required. Creating, editing and deleting notes, managing types and adding files are optional, and you can turn each one off. The Editor is read-only for anything you do not approve.

The Editor opens mdbase 0.3 collections. For an older collection, upgrade a copy with mdbase, check the copy, and then open it. Your original files can stay untouched while you check the result.

## Find your way around {#layout}

| Area | What it holds |
| --- | --- |
| Collection rail | Switches between All notes, Types and Settings, filters notes by folder, tag or type, shows the connection status and opens the Connect workspace. |
| Note list | The notes, and attached files, in the current filter. Sort by modified date, title or path from view options. |
| Editor | The note's Markdown body, with the title, properties and backlinks around it. |

Press <kbd>Ctrl</kbd> <kbd>P</kbd> (<kbd>⌘</kbd> <kbd>P</kbd> on a Mac) to open any note by name, and <kbd>?</kbd> to see the main shortcuts. On a phone, each level of navigation is a separate screen.

## Connection status {#status}

The rail shows whether the collection is connected or reconnecting. A Private collection can only be read and saved while one of your devices is online to serve it.

## Switch collections {#switch}

Open the collection switcher from the rail. It lists collections you opened before in this browser, and **Connect another collection** starts a new approval. **Forget from this browser** in Settings removes a collection from the Editor without changing its files.

## The Connect workspace {#connect}

[editor.mdbase.dev/connect](https://editor.mdbase.dev/connect) is where you manage your mdbase Connect account: collections, storage and sync, sharing, connected applications, devices, sign-in methods and browser sessions. It uses your account session, not a collection grant, so it can list your collections but cannot read their contents.
44 changes: 44 additions & 0 deletions content/apps/editor/links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Links, embeds and files
description: Connect notes to each other, include one note inside another, and attach files.
section: editor
---

## Link to a note {#links}

Type <kbd>[[</kbd> and start typing a title or path. The Editor suggests notes and files from the collection and completes the link:

```markdown title="note.md"
[[projects/alpha]]
[[projects/alpha|Project Alpha]]
[[projects/alpha#Goals]]
[[projects/alpha#^decision-1]]
```

After a note name, type <kbd>#</kbd> to link to one of its headings, or <kbd>#^</kbd> to link to a block. Links are stored as ordinary Markdown wikilinks, so other mdbase tools and Obsidian read them the same way. Links that do not resolve to a note are marked as you write.

## Link with @ {#mentions}

Typing <kbd>@</kbd> at the start of a line, after a space or after an opening bracket opens the same suggestions and inserts a `[[wikilink]]`. To limit suggestions to one type, type <kbd>@/</kbd>, choose the type, and continue typing. For example, `@/person/sam` suggests only records of the `person` type that match "sam".

## Embed a note or file {#embeds}

Add <kbd>!</kbd> before a link to show its content inside the current note. You can embed a whole note, a section or block of it (`#^id`), or a file:

```markdown title="note.md"
![[meeting-notes#Decisions]]
![[Attachments/diagram.png]]
![[Attachments/contract.pdf]]
```

The embedded content is read from the other file each time, so it stays up to date. The Editor tells you when an embed points to a missing note or heading, matches more than one note, or would include itself.

## Backlinks

**Backlinks** lists every note that links to the one you are reading. The button in the note header shows how many there are.

## Attach files {#attachments}

Choose **Attach file…** from the note's action menu. Each file is uploaded to an `Attachments` folder next to the note, and an embed or link to each file is added to the note. You can choose several files at once. An existing file with the same name is never replaced. The new file gets a numbered name instead. Images, PDFs, audio, video and text files preview in the Editor. Other files show their name and path and are stored as they are, for other tools to open.

If the Editor's approval does not include file access, the menu shows **Request attachment access** instead, which asks you to approve it in Connect.
58 changes: 58 additions & 0 deletions content/apps/editor/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Writing notes
description: Create, edit, find and organise the Markdown records in a collection.
section: editor
---

## Create a note {#create}

Choose **New note** or press <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>N</kbd>. A note is not written to the collection until you create it, so you can fill in everything first:

- **Type.** Pick one of the collection's types, or **General note** for a note without a type.
- **Required properties.** The fields the type requires are shown up front. Nested objects and lists follow the type's schema.
- **Path.** The Editor suggests where the file will live. Edit it to choose another folder or file name. A new folder appears once its first note is created.

Press <kbd>Ctrl</kbd> <kbd>Enter</kbd> to create the note.

## Write

The body is plain Markdown. Changes save automatically. Type <kbd>/</kbd> at the start of a line for Markdown commands such as headings, lists, tasks, quotes, code blocks, tables and links.

<kbd>Ctrl</kbd> <kbd>B</kbd> and <kbd>Ctrl</kbd> <kbd>I</kbd> set bold and italic, <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>C</kbd> sets inline code, <kbd>Ctrl</kbd> <kbd>K</kbd> adds a link, and pasting a URL over selected text turns it into a link. <kbd>Tab</kbd> and <kbd>Shift</kbd> <kbd>Tab</kbd> indent and outdent list items.

**Quiet Markdown**, on by default, softens Markdown punctuation away from the line you are editing and makes task checkboxes clickable. Vim key bindings can be turned on in Settings. See [Shortcuts and settings](/apps/editor/shortcuts/).

## Properties

Open **Note properties** to see and edit frontmatter. It has three views:

| View | Shows |
| --- | --- |
| Fields | Structured inputs based on the note's types, including dates, links, lists and nested objects. |
| JSON | The frontmatter stored in the file, as JSON. |
| Source | The exact Markdown file, including YAML frontmatter and body. |

## Find notes {#find}

- **Quick open** (<kbd>Ctrl</kbd> <kbd>P</kbd>) searches titles, paths, properties and text. Start with <kbd>&gt;</kbd> to search actions instead.
- Folders, Tags and By type in the collection rail filter the note list. Its view options sort by modified date, title or path.
- <kbd>Alt</kbd> <kbd>J</kbd> and <kbd>Alt</kbd> <kbd>K</kbd> move to the next and previous note. <kbd>Alt</kbd> <kbd>←</kbd> and <kbd>Alt</kbd> <kbd>→</kbd> go back and forward through notes you opened.
- <kbd>Ctrl</kbd> <kbd>F</kbd> finds text within the open note.

## Rename and move {#rename}

Click the path in the note header to rename or move the Markdown file; the new path must end in `.md`. If other notes link to it, the Editor asks whether to **Rename and update links**, which rewrites those links, or **Rename only**. Otherwise it renames the file and updates links straight away.

## Check a note {#check}

**Check note**, in the note's action menu, validates the note against its types and reports any fields that do not fit. Links that do not resolve are marked in the editor as you write.

## Edits made elsewhere {#conflicts}

Every save checks that the file has not changed since the Editor read it. If another app, a text editor or another person changed the note, the Editor does not overwrite it. It shows **This note changed elsewhere** and lets you compare the title and body before choosing **Keep my edits** or **Use latest**.

Edits that were not saved, for example because the browser closed, stay in this browser for up to seven days. Reopening the note offers **Restore unsaved edits** or **Discard recovered edits**.

## Delete a note {#delete}

**Delete note** is in the note's action menu. It asks for confirmation, then removes the Markdown file from the collection.
42 changes: 42 additions & 0 deletions content/apps/editor/sharing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Sharing a collection
description: Invite other people to view or edit a collection, and manage their access.
section: editor
---

## Which collections can be shared {#which}

Cloud copy and Private collections can both be shared. Sharing covers the whole collection; to share part of one, make a separate collection. Sharing is managed in the Connect workspace at [editor.mdbase.dev/connect](https://editor.mdbase.dev/connect). Open the collection and find **People & sharing**. Only the collection's owner sees it.

## Roles

| Role | Can |
| --- | --- |
| Owner | Everything, including inviting and removing people. |
| Editor | Edit notes, manage types, rename the collection, and connect apps. |
| Viewer | Read the collection and connect read-only apps. |

Each member’s devices keep a full copy of the collection, like yours. A viewer who opens the collection in mdbase Editor sees it read-only.

## Invite someone {#invite}

1. Choose **Invite person**.
2. Under **Invite using**, choose **Verified email** and enter their email address, or choose **Sharing code** and enter the code they gave you.
3. Choose **Viewer** or **Editor**, then **Create invitation**.
4. Copy the invitation link and send it to them yourself.

Email invitations only work for someone who already has a Connect account with that email address verified. If they signed up after you created the invitation, create a new one.

## Sharing codes {#code}

Use a sharing code when you cannot invite someone by email, for example if they sign in with a different address. The person you are inviting creates the code on the **Account & sessions** page in the Connect workspace, under **Sharing code** → **Generate code**, and sends it to you. A code can be used once. Invitations and sharing codes expire after seven days.

## Accept an invitation {#accept}

Open the invitation link while signed in to the account it was created for. Connect shows **A collection was shared with you**. Choose **Accept** to add the collection to your collections, then open it in the Editor or approve other apps to use it.

In a Private collection, an owner or editor approves the new member’s first device. You and the new member compare a six-digit code, in person or on a call, before that device gets the collection’s keys.

## Change or remove access {#manage}

In **People & sharing**, change a person's role from the list, or choose **Remove**. Removing someone also revokes their devices and the apps they connected to the collection. They keep the files they already had, but get no further changes. Invitations that have not been accepted are listed under **Pending invitations**, where you can cancel them.
Loading
Loading