ep_template_content 0.0.55 → 0.0.57
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/AGENTS.md +69 -0
- package/index.js +4 -4
- package/package.json +4 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Agent Guide — ep_template_content
|
|
2
|
+
|
|
3
|
+
Adds the ability to insert pre-defined template content into a pad.
|
|
4
|
+
|
|
5
|
+
## Tech stack
|
|
6
|
+
|
|
7
|
+
* Etherpad plugin framework (hooks declared in `ep.json`)
|
|
8
|
+
* EJS templates rendered server-side via `eejsBlock_*` hooks
|
|
9
|
+
* html10n for i18n (`locales/<lang>.json`, `data-l10n-id` in templates)
|
|
10
|
+
|
|
11
|
+
## Project structure
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
ep_template_content/
|
|
15
|
+
├── AGENTS.md
|
|
16
|
+
├── CONTRIBUTING.md
|
|
17
|
+
├── LICENSE.md
|
|
18
|
+
├── client.js
|
|
19
|
+
├── ep.json
|
|
20
|
+
├── index.js
|
|
21
|
+
├── locales/
|
|
22
|
+
│ ├── en.json
|
|
23
|
+
├── package.json
|
|
24
|
+
├── static/
|
|
25
|
+
│ ├── css/
|
|
26
|
+
│ ├── js/
|
|
27
|
+
│ ├── tests/
|
|
28
|
+
├── templates/
|
|
29
|
+
│ ├── editbarButtons.ejs
|
|
30
|
+
│ ├── template_content_input.ejs
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Helpers used
|
|
34
|
+
|
|
35
|
+
_None — `ep_plugin_helpers` is not a dependency. Adoption is part of the helpers-adoption sweep (Phase 4)._
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Helpers NOT used
|
|
39
|
+
|
|
40
|
+
_To be audited in the helpers-adoption sweep (Phase 4)._
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Running tests locally
|
|
44
|
+
|
|
45
|
+
`ep_template_content` runs inside Etherpad's test harness. From an etherpad checkout that has installed this plugin via `pnpm run plugins i --path ../ep_template_content`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Backend (Mocha) — harness boots its own server
|
|
49
|
+
pnpm --filter ep_etherpad-lite run test
|
|
50
|
+
|
|
51
|
+
# Playwright — needs `pnpm run dev` in a second terminal
|
|
52
|
+
pnpm --filter ep_etherpad-lite run test-ui
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Standing rules for agent edits
|
|
56
|
+
|
|
57
|
+
* PRs target `main`. Linear commits, no merge commits.
|
|
58
|
+
* Every bug fix includes a regression test in the same commit.
|
|
59
|
+
* All user-facing strings in `locales/`. No hardcoded English in templates.
|
|
60
|
+
* No hardcoded `aria-label` on icon-only controls — etherpad's html10n auto-populates `aria-label` from the localized string when (a) the element has a `data-l10n-id` and (b) no author-supplied `aria-label` is present. Adding a hardcoded English `aria-label` blocks that and leaves it untranslated. (See `etherpad-lite/src/static/js/vendors/html10n.ts:665-678`.)
|
|
61
|
+
* No nested interactive elements (no `<button>` inside `<a>`).
|
|
62
|
+
* LLM/Agent contributions are explicitly welcomed by maintainers.
|
|
63
|
+
|
|
64
|
+
## Quick reference: hooks declared in `ep.json`
|
|
65
|
+
|
|
66
|
+
* Server: `eejsBlock_editbarMenuLeft`, `eejsBlock_styles`, `eejsBlock_body`
|
|
67
|
+
* Client: `postAceInit`
|
|
68
|
+
|
|
69
|
+
When adding a hook, register it in both `ep.json` *and* the matching `exports.<hook> = ...` in the JS file.
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const {template} = require('ep_plugin_helpers');
|
|
4
|
+
|
|
3
5
|
const eejs = require('ep_etherpad-lite/node/eejs/');
|
|
4
6
|
|
|
5
|
-
exports.eejsBlock_editbarMenuLeft =
|
|
6
|
-
|
|
7
|
-
return cb();
|
|
8
|
-
};
|
|
7
|
+
exports.eejsBlock_editbarMenuLeft =
|
|
8
|
+
template('ep_template_content/templates/editbarButtons.ejs');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Adds the ability to insert pre-defined template content into a pad.",
|
|
3
3
|
"name": "ep_template_content",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.57",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "John McLear",
|
|
7
7
|
"email": "john@mclear.co.uk"
|
|
@@ -25,5 +25,8 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"lint": "eslint .",
|
|
27
27
|
"lint:fix": "eslint --fix ."
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"ep_plugin_helpers": "^0.5.0"
|
|
28
31
|
}
|
|
29
32
|
}
|