retold-content-system 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +107 -0
- package/build-codejar-bundle.js +29 -0
- package/build-codemirror-bundle.js +29 -0
- package/codejar-entry.js +10 -0
- package/codemirror-entry.js +16 -0
- package/content/Dogs.txt.md +2 -0
- package/content/README.md +35 -0
- package/content/_sidebar.md +3 -0
- package/content/_topbar.md +1 -0
- package/content/cover.md +12 -0
- package/content/getting-started.md +73 -0
- package/css/content-system.css +42 -0
- package/css/github.css +118 -0
- package/docs/.nojekyll +0 -0
- package/docs/README.md +24 -0
- package/docs/_sidebar.md +16 -0
- package/docs/_topbar.md +6 -0
- package/docs/cli.md +119 -0
- package/docs/cover.md +16 -0
- package/docs/css/docuserve.css +73 -0
- package/docs/editor-guide.md +137 -0
- package/docs/getting-started.md +73 -0
- package/docs/index.html +39 -0
- package/docs/keyboard-shortcuts.md +40 -0
- package/docs/retold-catalog.json +81 -0
- package/docs/retold-keyword-index.json +19 -0
- package/docs/topics.md +83 -0
- package/html/codejar-bundle.js +16 -0
- package/html/codemirror-bundle.js +29982 -0
- package/html/edit.html +25 -0
- package/html/index.html +25 -0
- package/html/preview.html +19 -0
- package/package.json +70 -0
- package/server.js +43 -0
- package/source/Pict-Application-ContentEditor-Configuration.json +15 -0
- package/source/Pict-Application-ContentEditor.js +1361 -0
- package/source/Pict-Application-ContentReader-Configuration.json +15 -0
- package/source/Pict-Application-ContentReader.js +91 -0
- package/source/Pict-ContentSystem-Bundle.js +21 -0
- package/source/cli/ContentSystem-CLI-Program.js +15 -0
- package/source/cli/ContentSystem-CLI-Run.js +3 -0
- package/source/cli/ContentSystem-Server-Setup.js +405 -0
- package/source/cli/commands/ContentSystem-Command-Serve.js +104 -0
- package/source/providers/Pict-Provider-ContentEditor.js +198 -0
- package/source/views/PictView-Editor-CodeEditor.js +271 -0
- package/source/views/PictView-Editor-Layout.js +1194 -0
- package/source/views/PictView-Editor-MarkdownEditor.js +115 -0
- package/source/views/PictView-Editor-MarkdownReference.js +801 -0
- package/source/views/PictView-Editor-SettingsPanel.js +563 -0
- package/source/views/PictView-Editor-TopBar.js +366 -0
- package/source/views/PictView-Editor-Topics.js +1025 -0
package/docs/cover.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Retold Content System
|
|
2
|
+
|
|
3
|
+
> Edit and preview markdown content folders from any browser.
|
|
4
|
+
|
|
5
|
+
A local-first content editor and documentation viewer built on the Retold ecosystem. Point it at any folder of markdown files and get a full editing environment with syntax highlighting, live preview, image uploads, file browsing, and documentation topics management.
|
|
6
|
+
|
|
7
|
+
- **Edit** -- Rich markdown editor with CodeMirror, section segmentation, and inline controls
|
|
8
|
+
- **Browse** -- File tree sidebar with navigation, new file creation, and image uploads
|
|
9
|
+
- **Preview** -- Live rendered markdown reference panel with synchronized scrolling
|
|
10
|
+
- **Code** -- Syntax-highlighted editor for JSON, HTML, YAML, and 190+ languages via highlight.js
|
|
11
|
+
- **Topics** -- Manage documentation topic manifests linking help codes to files and line numbers
|
|
12
|
+
|
|
13
|
+
[Getting Started](getting-started.md)
|
|
14
|
+
[Editor Guide](editor-guide.md)
|
|
15
|
+
[Command Line](cli.md)
|
|
16
|
+
[GitHub](https://github.com/stevenvelozo/retold)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
Pict Docuserve - Base Styles
|
|
3
|
+
============================================================================ */
|
|
4
|
+
|
|
5
|
+
/* Reset and base */
|
|
6
|
+
*, *::before, *::after {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
html, body {
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
line-height: 1.5;
|
|
16
|
+
color: #423D37;
|
|
17
|
+
background-color: #fff;
|
|
18
|
+
-webkit-font-smoothing: antialiased;
|
|
19
|
+
-moz-osx-font-smoothing: grayscale;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Typography */
|
|
23
|
+
h1, h2, h3, h4, h5, h6 {
|
|
24
|
+
margin-top: 0;
|
|
25
|
+
line-height: 1.3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
a {
|
|
29
|
+
color: #2E7D74;
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
a:hover {
|
|
34
|
+
color: #256861;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Application container */
|
|
38
|
+
#Docuserve-Application-Container {
|
|
39
|
+
min-height: 100vh;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Utility: scrollbar styling */
|
|
43
|
+
::-webkit-scrollbar {
|
|
44
|
+
width: 8px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
::-webkit-scrollbar-track {
|
|
48
|
+
background: #F5F0E8;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
::-webkit-scrollbar-thumb {
|
|
52
|
+
background: #D4CCBE;
|
|
53
|
+
border-radius: 4px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
::-webkit-scrollbar-thumb:hover {
|
|
57
|
+
background: #B5AA9A;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Responsive adjustments */
|
|
61
|
+
@media (max-width: 768px) {
|
|
62
|
+
html {
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#Docuserve-Sidebar-Container {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.docuserve-body {
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Editor Guide
|
|
2
|
+
|
|
3
|
+
The content editor is a browser-based application for editing markdown files and other text content. Open it by navigating to `/edit.html` on your running content system server.
|
|
4
|
+
|
|
5
|
+
## Layout
|
|
6
|
+
|
|
7
|
+
The editor has three main areas:
|
|
8
|
+
|
|
9
|
+
- **Top Bar** -- Shows the application name, current file name, save status, word/character stats, and action buttons (Save, Close).
|
|
10
|
+
- **Sidebar** -- A collapsible panel on the left with three tabs: Files, Reference, and Topics.
|
|
11
|
+
- **Editor Pane** -- The main editing area, which switches between a markdown editor and a code editor depending on the file type.
|
|
12
|
+
|
|
13
|
+
## File Browser
|
|
14
|
+
|
|
15
|
+
The **Files** tab in the sidebar shows the directory tree of your content folder. Click any file to open it in the editor. The browser supports:
|
|
16
|
+
|
|
17
|
+
- Navigating into subfolders by clicking folder names
|
|
18
|
+
- Breadcrumb navigation to move back up the directory tree
|
|
19
|
+
- A **New File** button (`+`) to create new markdown files
|
|
20
|
+
- An **Upload Image** button to add images to the current directory
|
|
21
|
+
|
|
22
|
+
### Creating a New File
|
|
23
|
+
|
|
24
|
+
Click the `+` button in the sidebar header. A form appears where you enter the filename. The file is created in the directory you are currently browsing. If you include a path separator (e.g. `guides/setup.md`), intermediate directories are created automatically.
|
|
25
|
+
|
|
26
|
+
### Uploading Images
|
|
27
|
+
|
|
28
|
+
Click the upload button (or press `Cmd+Shift+U` / `Ctrl+Shift+U`) to open the upload overlay. Drag an image onto the drop zone or click to select a file. The image is uploaded to the folder you are currently browsing, and a markdown image reference is copied to your clipboard for easy pasting into your document.
|
|
29
|
+
|
|
30
|
+
### Hidden Files
|
|
31
|
+
|
|
32
|
+
By default the file browser hides dotfiles and other hidden files. To show them, open the **Settings** gear icon in the sidebar and check **Show Hidden Files**.
|
|
33
|
+
|
|
34
|
+
## Markdown Editor
|
|
35
|
+
|
|
36
|
+
When you open a `.md` file, the editor loads a full CodeMirror-based markdown editing environment. Features include:
|
|
37
|
+
|
|
38
|
+
- Syntax highlighting for markdown
|
|
39
|
+
- Line numbers
|
|
40
|
+
- Word wrap (toggleable in settings)
|
|
41
|
+
- Editing controls toolbar with bold, italic, heading, link, image, list, code, and blockquote buttons
|
|
42
|
+
- Auto-segmentation that splits long documents into editable sections at heading boundaries
|
|
43
|
+
|
|
44
|
+
### Editing Controls
|
|
45
|
+
|
|
46
|
+
The toolbar above the editor provides one-click formatting. Select text and click a button to wrap it, or click with no selection to insert a template. Available controls:
|
|
47
|
+
|
|
48
|
+
| Button | Action |
|
|
49
|
+
|--------|--------|
|
|
50
|
+
| **B** | Bold (`**text**`) |
|
|
51
|
+
| *I* | Italic (`*text*`) |
|
|
52
|
+
| H1-H3 | Insert heading |
|
|
53
|
+
| Link | Insert `[text](url)` |
|
|
54
|
+
| Image | Insert `` |
|
|
55
|
+
| List | Insert bulleted list item |
|
|
56
|
+
| Code | Insert inline code or fenced code block |
|
|
57
|
+
| Quote | Insert blockquote |
|
|
58
|
+
|
|
59
|
+
### Auto-Segmentation
|
|
60
|
+
|
|
61
|
+
For long markdown files, enable **Auto-Segment Markdown** in the settings panel. This splits the document at heading boundaries into independently scrollable editor segments. You can set the segmentation depth (H1 only, H1-H2, etc.) to control how finely the document is divided. Each segment gets its own CodeMirror editor instance.
|
|
62
|
+
|
|
63
|
+
## Code Editor
|
|
64
|
+
|
|
65
|
+
Non-markdown text files (JSON, HTML, CSS, JavaScript, YAML, and 190+ other languages) open in a CodeJar-based code editor with highlight.js syntax highlighting. The editor automatically detects the language from the file extension.
|
|
66
|
+
|
|
67
|
+
The code editor supports:
|
|
68
|
+
|
|
69
|
+
- Syntax highlighting for the detected language
|
|
70
|
+
- Tab indentation
|
|
71
|
+
- Line numbers
|
|
72
|
+
- Auto-closing brackets and quotes
|
|
73
|
+
- Word wrap (toggleable independently from the markdown editor)
|
|
74
|
+
|
|
75
|
+
## Saving Files
|
|
76
|
+
|
|
77
|
+
Press `Cmd+S` (Mac) or `Ctrl+S` (Windows/Linux) to save the current file. The top bar shows save status:
|
|
78
|
+
|
|
79
|
+
- A gold **\*** next to the filename indicates unsaved changes
|
|
80
|
+
- **Saving...** appears during the save request
|
|
81
|
+
- **Saved** appears briefly on success
|
|
82
|
+
- **Save failed** appears if something goes wrong
|
|
83
|
+
|
|
84
|
+
The **Save** button only appears when you have unsaved changes.
|
|
85
|
+
|
|
86
|
+
## Closing Files
|
|
87
|
+
|
|
88
|
+
Press `Escape` or click the **Close** button in the top bar to close the current file. If you have unsaved changes, a confirmation dialog appears asking whether to discard changes or cancel.
|
|
89
|
+
|
|
90
|
+
The confirmation dialog supports keyboard shortcuts:
|
|
91
|
+
|
|
92
|
+
- `Y` -- Discard changes and close
|
|
93
|
+
- `N` or `Escape` -- Cancel and return to editing
|
|
94
|
+
|
|
95
|
+
## Sidebar Tabs
|
|
96
|
+
|
|
97
|
+
### Files Tab
|
|
98
|
+
|
|
99
|
+
The default tab showing the file browser tree. See the File Browser section above.
|
|
100
|
+
|
|
101
|
+
### Reference Tab
|
|
102
|
+
|
|
103
|
+
Press `F1` to toggle the Reference tab, which shows a live rendered preview of the current markdown file. The reference panel updates every time you save. This is useful for checking how your markdown renders while editing.
|
|
104
|
+
|
|
105
|
+
The reference panel includes a **View in Reader** link that opens the current file in the documentation reader (`/` route) in a new tab.
|
|
106
|
+
|
|
107
|
+
### Topics Tab
|
|
108
|
+
|
|
109
|
+
Press `F4` or `Cmd+Shift+T` / `Ctrl+Shift+T` to open the Topics tab. This panel manages `.pict_documentation_topics.json` files -- JSON manifests that map topic codes to help file paths and titles. See [Documentation Topics](topics.md) for details.
|
|
110
|
+
|
|
111
|
+
## Settings
|
|
112
|
+
|
|
113
|
+
Click the gear icon in the sidebar header to open the settings flyout. Available settings:
|
|
114
|
+
|
|
115
|
+
### Markdown Settings
|
|
116
|
+
|
|
117
|
+
- **Auto-Segment Markdown** -- Split documents at heading boundaries
|
|
118
|
+
- **Segmentation Depth** -- How deep to segment (H1, H2, H3)
|
|
119
|
+
- **Show Editing Controls** -- Toggle the formatting toolbar
|
|
120
|
+
- **Word Wrap** -- Enable word wrap in the markdown editor
|
|
121
|
+
- **Auto Content Preview** -- Automatically show the Reference panel
|
|
122
|
+
|
|
123
|
+
### Code Editor Settings
|
|
124
|
+
|
|
125
|
+
- **Word Wrap (Code)** -- Enable word wrap in the code editor
|
|
126
|
+
|
|
127
|
+
### Media Preview Settings
|
|
128
|
+
|
|
129
|
+
- **Auto-Preview Images** -- Show image thumbnails in the file browser
|
|
130
|
+
- **Auto-Preview Video** -- Show video players for video files
|
|
131
|
+
- **Auto-Preview Audio** -- Show audio players for audio files
|
|
132
|
+
|
|
133
|
+
### File Browser Settings
|
|
134
|
+
|
|
135
|
+
- **Show Hidden Files** -- Include dotfiles and hidden files in the file browser
|
|
136
|
+
|
|
137
|
+
Settings are persisted in your browser's localStorage and restored on each visit.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
The Retold Content System is a local markdown editor and documentation viewer. Install it once with npm and point it at any folder of markdown files.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install globally from npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g retold-content-system
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This gives you two equivalent CLI commands: `retold-content-system` and `rcs`.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
Create a folder with some markdown files and serve it:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
mkdir my-docs
|
|
21
|
+
cd my-docs
|
|
22
|
+
echo "# Hello World" > README.md
|
|
23
|
+
rcs serve
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The server starts on a random port between 7000 and 7999 and prints the URLs for both the reader and the editor:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Retold Content System running on http://localhost:7042
|
|
30
|
+
Reader: http://localhost:7042/
|
|
31
|
+
Editor: http://localhost:7042/edit.html
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Open the **Reader** URL for a pict-docuserve documentation viewer, or the **Editor** URL for the full editing environment.
|
|
35
|
+
|
|
36
|
+
## Choosing a Port
|
|
37
|
+
|
|
38
|
+
Pass `-p` to pin the server to a specific port:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
rcs serve -p 8080
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Pointing at a Different Folder
|
|
45
|
+
|
|
46
|
+
Provide a content path as the first argument:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
rcs serve ~/projects/my-wiki
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
If the target directory has a `content/` subfolder, the server uses that automatically. This means running `rcs serve` from a project root that has a `content/` directory does the right thing without extra arguments.
|
|
53
|
+
|
|
54
|
+
## What Gets Served
|
|
55
|
+
|
|
56
|
+
The content system sets up three static routes and several API endpoints:
|
|
57
|
+
|
|
58
|
+
| Route | Purpose |
|
|
59
|
+
|-------|---------|
|
|
60
|
+
| `/` | Documentation reader (pict-docuserve) |
|
|
61
|
+
| `/edit.html` | Content editor application |
|
|
62
|
+
| `/content/*` | Raw content files (markdown, images, etc.) |
|
|
63
|
+
| `/uploads/*` | Uploaded images |
|
|
64
|
+
| `/api/filebrowser/*` | File listing API |
|
|
65
|
+
| `/api/content/read/*` | File content read API |
|
|
66
|
+
| `/api/content/save/*` | File content save API |
|
|
67
|
+
| `/api/content/upload-image` | Image upload endpoint |
|
|
68
|
+
|
|
69
|
+
## Next Steps
|
|
70
|
+
|
|
71
|
+
- Read the [Editor Guide](editor-guide.md) for a walkthrough of the editing UI
|
|
72
|
+
- See the [CLI Reference](cli.md) for all command-line options
|
|
73
|
+
- Learn about [Documentation Topics](topics.md) for managing help topic manifests
|
package/docs/index.html
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
7
|
+
<meta name="description" content="Documentation powered by pict-docuserve">
|
|
8
|
+
|
|
9
|
+
<title>Documentation</title>
|
|
10
|
+
|
|
11
|
+
<!-- Application Stylesheet -->
|
|
12
|
+
<link href="css/docuserve.css" rel="stylesheet">
|
|
13
|
+
<!-- KaTeX stylesheet for LaTeX equation rendering -->
|
|
14
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css">
|
|
15
|
+
<!-- PICT Dynamic View CSS Container -->
|
|
16
|
+
<style id="PICT-CSS"></style>
|
|
17
|
+
|
|
18
|
+
<!-- Load the PICT library from jsDelivr CDN -->
|
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/pict@1/dist/pict.min.js" type="text/javascript"></script>
|
|
20
|
+
<!-- Bootstrap the Application -->
|
|
21
|
+
<script type="text/javascript">
|
|
22
|
+
//<![CDATA[
|
|
23
|
+
Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(PictDocuserve, 2)});
|
|
24
|
+
//]]>
|
|
25
|
+
</script>
|
|
26
|
+
</head>
|
|
27
|
+
<body>
|
|
28
|
+
<!-- The root container for the Pict application -->
|
|
29
|
+
<div id="Docuserve-Application-Container"></div>
|
|
30
|
+
|
|
31
|
+
<!-- Mermaid diagram rendering -->
|
|
32
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
|
|
33
|
+
<script>mermaid.initialize({ startOnLoad: false, theme: 'default' });</script>
|
|
34
|
+
<!-- KaTeX for LaTeX equation rendering -->
|
|
35
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.js"></script>
|
|
36
|
+
<!-- Load the Docuserve PICT Application Bundle from jsDelivr CDN -->
|
|
37
|
+
<script src="https://cdn.jsdelivr.net/npm/pict-docuserve@0/dist/pict-docuserve.min.js" type="text/javascript"></script>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Keyboard Shortcuts
|
|
2
|
+
|
|
3
|
+
All keyboard shortcuts work while the editor is focused. On Mac, `Cmd` is the modifier; on Windows and Linux, use `Ctrl`.
|
|
4
|
+
|
|
5
|
+
## File Operations
|
|
6
|
+
|
|
7
|
+
| Shortcut | Action |
|
|
8
|
+
|----------|--------|
|
|
9
|
+
| `Cmd+S` / `Ctrl+S` | Save the current file |
|
|
10
|
+
| `Escape` | Close the current file (prompts if unsaved) |
|
|
11
|
+
|
|
12
|
+
## Close Confirmation Dialog
|
|
13
|
+
|
|
14
|
+
When closing a file with unsaved changes, the confirmation dialog responds to:
|
|
15
|
+
|
|
16
|
+
| Key | Action |
|
|
17
|
+
|-----|--------|
|
|
18
|
+
| `Y` | Discard changes and close |
|
|
19
|
+
| `N` | Cancel (keep editing) |
|
|
20
|
+
| `Escape` | Cancel (keep editing) |
|
|
21
|
+
|
|
22
|
+
## Sidebar Navigation
|
|
23
|
+
|
|
24
|
+
| Shortcut | Action |
|
|
25
|
+
|----------|--------|
|
|
26
|
+
| `F1` | Toggle the Reference (preview) panel |
|
|
27
|
+
| `F2` | Toggle the sidebar open/closed |
|
|
28
|
+
| `F3` or `Cmd+Shift+U` / `Ctrl+Shift+U` | Open the image upload form |
|
|
29
|
+
| `F4` or `Cmd+Shift+T` / `Ctrl+Shift+T` | Open Topics tab (creates a linked topic if in a markdown file) |
|
|
30
|
+
|
|
31
|
+
## F4 Context-Aware Behavior
|
|
32
|
+
|
|
33
|
+
When pressed while editing a markdown file, `F4` does more than just switch tabs. It:
|
|
34
|
+
|
|
35
|
+
1. Reads the current cursor line number in the markdown editor
|
|
36
|
+
2. Extracts the first heading from the document as a default title
|
|
37
|
+
3. Creates a new topic entry linked to the current file and line number
|
|
38
|
+
4. Opens the Topics tab with the new entry in edit mode
|
|
39
|
+
|
|
40
|
+
When pressed while editing a non-markdown file or with no file open, `F4` simply switches the sidebar to the Topics tab.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Generated": "2026-02-22T20:41:55.752Z",
|
|
3
|
+
"GitHubOrg": "stevenvelozo",
|
|
4
|
+
"DefaultBranch": "master",
|
|
5
|
+
"Groups": [
|
|
6
|
+
{
|
|
7
|
+
"Name": "Dist",
|
|
8
|
+
"Key": "dist",
|
|
9
|
+
"Description": "",
|
|
10
|
+
"Modules": [
|
|
11
|
+
{
|
|
12
|
+
"Name": "css",
|
|
13
|
+
"Repo": "css",
|
|
14
|
+
"Group": "dist",
|
|
15
|
+
"Branch": "master",
|
|
16
|
+
"HasDocs": false,
|
|
17
|
+
"HasCover": false,
|
|
18
|
+
"Sidebar": [],
|
|
19
|
+
"DocFiles": []
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"Name": "indoctrinate_content_staging",
|
|
23
|
+
"Repo": "indoctrinate_content_staging",
|
|
24
|
+
"Group": "dist",
|
|
25
|
+
"Branch": "master",
|
|
26
|
+
"HasDocs": false,
|
|
27
|
+
"HasCover": false,
|
|
28
|
+
"Sidebar": [],
|
|
29
|
+
"DocFiles": []
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"Name": "js",
|
|
33
|
+
"Repo": "js",
|
|
34
|
+
"Group": "dist",
|
|
35
|
+
"Branch": "master",
|
|
36
|
+
"HasDocs": false,
|
|
37
|
+
"HasCover": false,
|
|
38
|
+
"Sidebar": [],
|
|
39
|
+
"DocFiles": []
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"Name": "Source",
|
|
45
|
+
"Key": "source",
|
|
46
|
+
"Description": "",
|
|
47
|
+
"Modules": [
|
|
48
|
+
{
|
|
49
|
+
"Name": "cli",
|
|
50
|
+
"Repo": "cli",
|
|
51
|
+
"Group": "source",
|
|
52
|
+
"Branch": "master",
|
|
53
|
+
"HasDocs": false,
|
|
54
|
+
"HasCover": false,
|
|
55
|
+
"Sidebar": [],
|
|
56
|
+
"DocFiles": []
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"Name": "providers",
|
|
60
|
+
"Repo": "providers",
|
|
61
|
+
"Group": "source",
|
|
62
|
+
"Branch": "master",
|
|
63
|
+
"HasDocs": false,
|
|
64
|
+
"HasCover": false,
|
|
65
|
+
"Sidebar": [],
|
|
66
|
+
"DocFiles": []
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"Name": "views",
|
|
70
|
+
"Repo": "views",
|
|
71
|
+
"Group": "source",
|
|
72
|
+
"Branch": "master",
|
|
73
|
+
"HasDocs": false,
|
|
74
|
+
"HasCover": false,
|
|
75
|
+
"Sidebar": [],
|
|
76
|
+
"DocFiles": []
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Generated": "2026-02-22T20:41:55.835Z",
|
|
3
|
+
"DocumentCount": 0,
|
|
4
|
+
"LunrIndex": {
|
|
5
|
+
"version": "2.3.9",
|
|
6
|
+
"fields": [
|
|
7
|
+
"title",
|
|
8
|
+
"module",
|
|
9
|
+
"group",
|
|
10
|
+
"body"
|
|
11
|
+
],
|
|
12
|
+
"fieldVectors": [],
|
|
13
|
+
"invertedIndex": [],
|
|
14
|
+
"pipeline": [
|
|
15
|
+
"stemmer"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"Documents": {}
|
|
19
|
+
}
|
package/docs/topics.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Documentation Topics
|
|
2
|
+
|
|
3
|
+
The Topics system manages `.pict_documentation_topics.json` files -- JSON manifests that map topic codes to documentation files. These manifests are used by applications with built-in help systems to link context-sensitive help codes to specific markdown files and line numbers.
|
|
4
|
+
|
|
5
|
+
## Topics File Format
|
|
6
|
+
|
|
7
|
+
A topics file is a JSON object where each key is a unique topic code:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"Getting-Started": {
|
|
12
|
+
"TopicCode": "Getting-Started",
|
|
13
|
+
"TopicHelpFilePath": "guides/getting-started.md",
|
|
14
|
+
"TopicTitle": "Getting Started Guide"
|
|
15
|
+
},
|
|
16
|
+
"Max-Function": {
|
|
17
|
+
"TopicCode": "Max-Function",
|
|
18
|
+
"TopicHelpFilePath": "functions/func-reference-max.md",
|
|
19
|
+
"TopicTitle": "Max function",
|
|
20
|
+
"RelevantMarkdownLine": 23
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Fields
|
|
26
|
+
|
|
27
|
+
| Field | Required | Description |
|
|
28
|
+
|-------|----------|-------------|
|
|
29
|
+
| `TopicCode` | Yes | A unique string identifier for the topic. Used as the lookup key by applications. |
|
|
30
|
+
| `TopicHelpFilePath` | Yes | Relative path from the content root to the markdown file for this topic. |
|
|
31
|
+
| `TopicTitle` | Yes | Human-readable title for the topic. |
|
|
32
|
+
| `RelevantMarkdownLine` | No | Line number in the markdown file where the relevant content begins. Used for scrolling to context. |
|
|
33
|
+
|
|
34
|
+
## Using the Topics Panel
|
|
35
|
+
|
|
36
|
+
Open the Topics tab by pressing `F4` or `Cmd+Shift+T` / `Ctrl+Shift+T`, or by clicking the **Topics** tab in the sidebar.
|
|
37
|
+
|
|
38
|
+
### Loading a Topics File
|
|
39
|
+
|
|
40
|
+
On first launch, the editor attempts to load `.pict_documentation_topics.json` from the content root. If the file does not exist, the panel shows an empty state with two options:
|
|
41
|
+
|
|
42
|
+
- **Load .pict_documentation_topics.json** -- Creates the default file and opens it
|
|
43
|
+
- **Select file...** -- Enter a custom path to a topics JSON file anywhere in your content folder
|
|
44
|
+
|
|
45
|
+
The topics file path is persisted in your browser settings and restored on future visits.
|
|
46
|
+
|
|
47
|
+
### Adding Topics
|
|
48
|
+
|
|
49
|
+
Click the **+ Add Topic** button at the bottom of the topic list. A new row appears in edit mode with empty fields. Fill in the topic code, title, and file path, then click **Save**.
|
|
50
|
+
|
|
51
|
+
### Quick Topic from Cursor (F4)
|
|
52
|
+
|
|
53
|
+
While editing a markdown file, press `F4` to create a topic pre-filled with:
|
|
54
|
+
|
|
55
|
+
- **TopicHelpFilePath** set to the current file
|
|
56
|
+
- **RelevantMarkdownLine** set to your cursor's line number
|
|
57
|
+
- **TopicTitle** set to the first heading found in the document
|
|
58
|
+
|
|
59
|
+
The Topics tab opens with the new entry in edit mode so you can adjust the topic code and title before saving.
|
|
60
|
+
|
|
61
|
+
### Editing Topics
|
|
62
|
+
|
|
63
|
+
Click the pencil icon on any topic row to switch it to inline edit mode. The row expands to show fields for all four properties. Click **Save** to commit changes or **Cancel** to discard.
|
|
64
|
+
|
|
65
|
+
If you change a topic code, the editor checks for uniqueness. Duplicate codes are not allowed.
|
|
66
|
+
|
|
67
|
+
### Deleting Topics
|
|
68
|
+
|
|
69
|
+
Click the trash icon on a topic row. A browser confirmation dialog appears. Once confirmed, the topic is removed and the file is saved.
|
|
70
|
+
|
|
71
|
+
### Navigating to a Topic's File
|
|
72
|
+
|
|
73
|
+
Click the arrow icon on a topic row to open that topic's linked file in the editor. If the topic has a `RelevantMarkdownLine`, the editor scrolls to that line after opening the file.
|
|
74
|
+
|
|
75
|
+
### Closing the Topics File
|
|
76
|
+
|
|
77
|
+
Click the **X** button in the topics panel header to unload the topics file and return to the empty state. The topics file itself is not deleted -- it remains on disk.
|
|
78
|
+
|
|
79
|
+
## Integration with Applications
|
|
80
|
+
|
|
81
|
+
Applications that use `.pict_documentation_topics.json` can load the manifest and look up topics by code to show context-sensitive help. For example, a form builder might use `TopicCode` values to link each field to a help article, then open the documentation reader at the relevant file and line.
|
|
82
|
+
|
|
83
|
+
The content system's reader app (served at `/`) can display any markdown file from the content folder, making it a natural companion for the topics manifest.
|