Skip to content

Commit 97c1204

Browse files
committed
EN : First version of EN translation from Czech
1 parent 17dcf5e commit 97c1204

36 files changed

+1578
-7
lines changed

en/README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Developer Guide
1+
# Documentation for developers
22

3-
The main goal is to describe:
4-
- HelpViewer GitHub overview and versioning description,
5-
- How to extend HelpViewer itself
3+
The purpose of this documentation is to describe:
4+
5+
- The concept of the HelpViewer application and a list of technologies used
6+
- The structure of the HelpViewer application and its startup sequence
7+
- An overview of definition lists
8+
- A description of HelpViewer tools for analyzing system status
9+
- Procedures and specifics for configuring existing standard plugins and functionalities
10+
- Procedures and specifics for developing custom plugins and functionalities
11+
- Description of the possibilities for extending the project itself
12+
- Analysis and examples of specific possible implementations of plugins and their subordinate objects
13+
- Description of the operation of the event/message distribution system in the application, including message filtering
14+
- Description of the procedure for preparing a new language
15+
- Overview of the structure of the HelpViewer GitHub organization and description of versioning
16+
- Operational documents and links to groups and other resources

en/appendix.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 📘 Appendices
2+
3+
This chapter contains a complete list of documentation appendices.

en/cfgopt.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# ⚙️ Configuration option
2+
3+
The configuration option represents ⚙️ [plugin configuration][cfgPlug] on the plugin code side.
4+
5+
## Definition
6+
7+
```javascript
8+
class pConfigValuePlugin extends IPlugin {
9+
static KEY_CFG_FILENAME = 'FILENAME';
10+
11+
init() {
12+
const T = this.constructor;
13+
const TI = this;
14+
TI.DEFAULT_KEY_CFG_FILENAME = 'marked.min.js;LICENSE-marked.md';
15+
TI.cfgFileName = TI.config[T.KEY_CFG_FILENAME] || TI.DEFAULT_KEY_CFG_FILENAME;
16+
super.init();
17+
}
18+
}
19+
Plugins.catalogize(pConfigValuePlugin);
20+
```
21+
22+
### Configuration file example
23+
24+
This definition is paired with this definition in the configuration file:
25+
26+
```text
27+
FILENAME|README.md
28+
```
29+
30+
[Example on the object browser page][pTRParseMd]
31+
32+
If the key from the **KEY_CFG_FILENAME** constant is not found in the configuration file, the value **DEFAULT_KEY_CFG_FILENAME** is used.
33+
34+
### Meaning of variables
35+
36+
- KEY_CFG_FILENAME - name of the configuration key on the configuration side
37+
- DEFAULT_KEY_CFG_FILENAME - default value for the configuration key
38+
- ⚠️ DEFAULT_**KEY_CFG_FILENAME** and **KEY_CFG_FILENAME** must match in name so that the object browser can correctly evaluate the configuration option and link the name and default (backup) value.
39+
40+
## Records 📄⚙️
41+
42+
If records with the 📄⚙️ icon appear in the [object explorer][oexplorer], it means that the specific keys contained in the configuration are not listed in the plugin as described here in the [definition](#h-2-0).
43+
44+
The reasons for this may include:
45+
46+
- An approach inspired by the [object explorer][oexplorer], where the goal is to have an open set of configuration keys. The list of groups can be arbitrarily long, and its items refer to other keys. These keys are not known in advance because the configuration can be changed dynamically, but the plugin can read them correctly thanks to its internal logic.
47+
- A typo in the key on the configuration file side leads to the creation of another visible item, while the default value is used for the key with the correct name because nothing is read.
48+
49+
[cfgPlug]: pluginConfig.md "Plugin configuration"
50+
[pTRParseMd]: :_inst:pTRParseMd:-md.md#h-2-1 "pTRParseMd:-md"
51+
[oexplorer]: oexplorer.md "Object explorer"

en/concept.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# 🗺️ Basic overview
2+
3+
The application is built on **plugins (plug-in modules) and the transfer of events (messages) between them**.
4+
5+
The following can be defined in plugins:
6+
7+
- events (messages),
8+
- their handlers,
9+
- sending events,
10+
- UI elements,
11+
- JavaScript event handlers,
12+
- membership in a communication path (group of recipients)
13+
14+
This ensures that the approaches to the UI and program logic are consistent across the entire application.
15+
The plugin system and message distribution have been developed from scratch, without the use of third-party frameworks.
16+
17+
**Technical solution:**
18+
19+
- compressed application data package (with the option to run with unzipped content),
20+
- runs on the client, no server or backend required,
21+
- minimum requirements for deployment: browser with **ES2021** support + local disk (no Internet required) (CORS is recommended to be disabled, although the application includes support for manual data upload by the user)
22+
23+
**Main components of the application:**
24+
25+
- loader (**hvdata/appmain.js + jszip.min.js**),
26+
- application data (**hvdata/data.zip**; **STO_DATA**), where most of the application is stored (about 86% of the package size)
27+
- low-level code (in **js.lst**),
28+
- plugin code (in **plugins.lst**).
29+
- third-party libraries (separate, loaded as separate modules)
30+
- implementation data file - a separate archive in the application logically named **STO_HELP**
31+
32+
**⚖️ License**: [MIT][MIT]
33+
34+
[MIT]: https://github.com/HelpViewer/HelpViewer/blob/master/LICENSE "MIT license"

en/css.lst.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# 📄 List of styles (css.lst)
2+
3+
- ⚠️ This format is very strict, please follow the rules exactly.
4+
- The file defines the list and order of CSS styles that the application will apply.
5+
- One line = one item
6+
- Line breaks in the middle of a definition are not allowed
7+
8+
## File structure
9+
10+
```text
11+
[1]
12+
```
13+
14+
## Position descriptions
15+
16+
| Position | Description |
17+
|---|---|
18+
| `[1]` | Relative path to the file with the extension relative to the root of the data store. |

en/debug.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 🐞 Debug mode
2+
3+
- Debug mode is automatically disabled in production.
4+
- Enable it by changing **DEBUG_MODE** to **true** in **hvdata/appmain.js**.
5+
6+
## Features available in debug mode
7+
8+
- 🧩 [Object explorer][oexplorer]
9+
- 📜 Logging to the browser's DevTools console
10+
- ⚡ Sent events are also duplicated into the [DebugEventEvent][DebugEventEvent] event, which is processed by the object explorer in order to capture event transfers between application entities during runtime
11+
12+
[DebugEventEvent]: :_evt:DebugEventEvent.md "DebugEventEvent"
13+
[oexplorer]: oexplorer.md "Object Explorer"

en/event.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# ⚡ Event
2+
3+
An event defines an application event/message.
4+
An event can be defined with a handler or just defined (without a handler).
5+
6+
## Definition
7+
8+
1. Define the event data object or specify which of the already defined descendants ⚡ [IEvent][IEvent] is suitable for your event:
9+
10+
```javascript
11+
class ClickHandlerRegister extends IEvent {
12+
constructor() {
13+
super();
14+
this.handlerId = undefined;
15+
this.handler = undefined;
16+
}
17+
}
18+
```
19+
20+
2. Define the plugin class for the event:
21+
22+
```javascript
23+
class pEventPlugin extends IPlugin {
24+
static EVT_CLICK_HANDLER_REGISTER = 'ClickHandlerRegister';
25+
26+
init() {
27+
const T = this.constructor;
28+
const TI = this;
29+
30+
// (B)
31+
32+
super.init();
33+
}
34+
}
35+
Plugins.catalogize(pEventPlugin);
36+
```
37+
38+
3. Decide whether you can have the handler directly in the plugin or whether you need to have it outside the plugin. Depending on your case, choose the necessary procedure according to the following chapters.
39+
40+
4. Always insert the source code of the chapter into the comment **(B)**.
41+
42+
### ⚡ Event with handler
43+
44+
```javascript
45+
const h_EVT_CLICK_HANDLER_REGISTER = (reply) => {
46+
// ...
47+
reply.result = 'replyValue';
48+
}
49+
TI.eventDefinitions.push([T.EVT_CLICK_HANDLER_REGISTER, ClickHandlerRegister, h_EVT_CLICK_HANDLER_REGISTER]);
50+
```
51+
52+
### 📄⚡ Event only defined
53+
54+
```javascript
55+
TI.eventDefinitions.push([T.EVT_CLICK_HANDLER_REGISTER, ClickHandlerRegister, null]); // outside event handlers
56+
```
57+
58+
### Meaning of elements
59+
60+
- class ClickHandlerRegister - event data object (it is possible to use the same class for multiple events or inherit from any IEvent descendant)
61+
- ClickHandlerRegister.constructor - contains the default values of the message object. It is desirable that the values be pre-filled with the default value according to the planned type, if possible. This data is used in the [object explorer][oexplorer] as part of the system's automatic documentation.
62+
- const h_EVT_CLICK_HANDLER_REGISTER - event handler
63+
- reply.result - standard event property (⚡ [IEvent][IEvent]), which is automatically taken over by the application logic as the handler's response to the event. It can be any object.
64+
- TI.eventDefinitions.push([T.EVT_CLICK_HANDLER_REGISTER, ClickHandlerRegister, null]) - creates an event definition prescription (event name, event data object, and handler method, or null if the event is only to be defined). The processing of definitions is handled by the ancestor 🔌 [IPlugin][IPlugin].
65+
- super.init(); - performs standard initialization of bindings. It must be the last command in order for everything defined to be initialized properly.
66+
67+
## Sending an event
68+
69+
In the handler code, you can then trigger events as follows:
70+
71+
```javascript
72+
const eventName = EventNames.MyNewEvent; //nebo: 'MyNewEvent'
73+
74+
sendEvent(eventName, (r) => {
75+
r.id = aliasName;
76+
r.result = loadedCount;
77+
//vyplnění dalších potřebných dat
78+
});
79+
```
80+
81+
In the **appmainBaseLogic.js** file, you will find examples of functions that encapsulate similar calls.
82+
⚠️ It is recommended to create a similar set of functions for your plugin in a separate file (which you will add to the [list of scripts][jsList]). Calls to the **sendEvent** method are not indexed for the [object explorer][oexplorer], but these functions will be indexed.
83+
84+
## Records 🛰️
85+
86+
A record in the 🛰️ [object explorer][oexplorer] means that:
87+
88+
- in the plugin instance overview: the plugin sends the event ...
89+
- in the list of event communication paths: the event is sent from ...
90+
91+
[IEvent]: :_evt:IEvent.md "IEvent"
92+
[oexplorer]: oexplorer.md "Object explorer"
93+
[IPlugin]: :_plg:IPlugin.md "IPlugin"
94+
[jsList]: js.lst.md "List of scripts"

en/eventFilter.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# 🔺 Filtering events in plugins
2+
3+
Each plugin can receive events from the system. Plugins have a switch to (de)activate the filter for receiving events according to the **aliasName (id)** of the plugin instance:
4+
5+
```javascript
6+
this.eventIdStrict = true;
7+
```
8+
9+
Make the call in the constructor or at the beginning of the init() function, or at the latest before calling base.init().
10+
11+
Event filtering is two-stage - according to eventIdStrict and the name of the handler function. This is described in more detail in the following subchapters.
12+
13+
## Summary
14+
15+
- The **onET_(event name)** function accepts all events with eventName = (event name)
16+
- The **onET(event name)** function accepts all events with eventName = (event name) and id = plugin.aliasName
17+
- **A plugin with plugin.aliasName = ''** accepts all events into the **onET(event name)** or **onET_(event name)** function
18+
19+
⚠️ It is recommended to have only one of the following handlers in the plugin:
20+
21+
- onET(event name)
22+
- onET_(event name)
23+
24+
## How to decide on the settings?
25+
26+
The plugin should not listen to all events, but only some will be sent directly to it, so it will receive a specific id and eventIdStrict = true.
27+
28+
Set EventIdStrict to **true** at least in these cases:
29+
30+
- The plugin will (or may) run in more than one instance (for example, 📇 keyword dictionary and 🔎 full-text search)
31+
- The plugin will be part of a process (🖼️ [pTRPhasePlugin][pTRPhasePlugin] - listing the contents of a chapter)
32+
- The plugin will be part of a larger functional unit (🔹 [pIndexFile:fulltextList][pIndexFile] - dynamic creating a full-text index of help)
33+
34+
📘 A [detailed appendix][appendix] is available for this chapter.
35+
36+
[pTRPhasePlugin]: pTRPhasePlugin.md "pTRPhasePlugin"
37+
[pIndexFile]: :inst:pIndexFile:fulltextList.md "pIndexFile:fulltextList"
38+
[appendix]: eventFilterD.md "Rozbor filtrování událostí v pluginech"

en/eventFilterD.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# 🔺 Filtering events in plugins details
2+
3+
## Decision process diagram
4+
5+
```mermaid
6+
flowchart LR
7+
Event[⚡ Event - eventName, id] --> CheckHandler
8+
Plugin[🧩 Plugin - aliasName, eventIdStrict] --> CheckIdRelaxed
9+
Plugin --> CheckIdStrict
10+
Plugin --> CheckStrict
11+
CheckHandler{👂 Is there a handler for eventName?} -->|NO| EndN
12+
CheckHandler -->|YES| CheckStrict
13+
CheckStrict{plugin.eventIdStrict} -->|🔺 YES| CheckIdStrict
14+
CheckStrict -->|🟢 NO| CheckIdRelaxed
15+
CheckIdStrict{id = plugin.aliasName?} -->|YES| EndY
16+
CheckIdStrict -->|NO| EndN
17+
CheckIdRelaxed{id = plugin.aliasName or plugin.aliasName = ''?} -->|YES| EndY
18+
CheckIdRelaxed -->|NO| EndN
19+
EndY[✔️ Pass to plugin]
20+
EndN[⛔ Do not pass]
21+
```
22+
23+
## 0. Meaning of aliasName values (''/...)
24+
25+
| aliasName | Description |
26+
|---|---|
27+
| '' | (Initialization **class:** in the plugin list). If this value is set, the plugin is able to receive most system messages (they are usually sent with an empty id). |
28+
| xxx | If the value is filled in any other way, the **eventIdStrict** property determines further processing. |
29+
30+
## 1. Meaning of eventIdStrict values (🟢/🔺)
31+
32+
The usual value is **false**, so that the plugin accepts all events regardless of their ID.
33+
34+
| eventIdStrict | Description |
35+
|---|---|
36+
| false | 🟢 The IDs of incoming events are not filtered. Incoming events are filtered only by plugin handlers named **onET_(event name)** or **onET(event name)** |
37+
| true | 🔺 Strict ID matching in events is required. That is, if **aliasName** (**id** of the plugin) and **id** in the event match, then the event is passed to the plugin. In order for the plugin to process the event, it must also have a defined handler method **onET_(event name)** or **onET(event name)** |
38+
39+
If **false** is present and the plugin has an empty **aliasName (id)** (initialization **class:**), then the event **is passed** to the next step for processing. In the case of **false**, the name of the handler **ET vs. ET_** is also not decisive.
40+
41+
## 2. Name of the handler function (ET/ET_)
42+
43+
| Event name | Result |
44+
|---|---|
45+
| **There is no onET function in the plugin** | The event is not passed to the plugin for processing. |
46+
| onET_(event name) | (onET underscore) The event is passed to the plugin for processing **regardless of whether the event id and plugin id match**. ⚠️ **The name of the function with an underscore takes precedence over the eventIdStrict setting.** |
47+
| onET(event name) | (onET) The event is passed to the plugin for processing **only if the event ID and plugin ID match**. An unspecified plugin ID is also considered a match. |

en/files.lst

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
1-
README.md|Developer Guide
1+
README.md|Documentation for developers
22
helpviewer.md|HelpViewer Project
33
=latestApp|Download latest version
44
https://github.com/HelpViewer/HelpViewer|GitHub repository
55
https://github.com/HelpViewer/HelpViewer/pkgs/container/helpviewer|Container images
66
https://discord.gg/J2SjcmqHSZ|User group
77
newLangViewer.md|New language for Viewer
8+
runseq.md|Startup sequence
9+
css.lst.md|List of styles
10+
js.lst.md|List of scripts
11+
plugins.lst.md|List of plugins
12+
oexplorer.md|Object explorer
13+
firstPlugin.md|First plugin
14+
techstack.md|Used technologies
15+
pTRPhasePlugin.md|pTRPhasePlugin
16+
pConvertSysEventToEvent.md|pConvertSysEventToEvent
17+
implPlug.md|Plugin implementation
18+
lists.md|Loading Lists
19+
pTopicRenderer.md|pTopicRenderer
20+
pluginConfig.md|Plugin configuration
21+
pluginLoad.md|Loading plugins
22+
puiButton.md|puiButton
23+
eventFilter.md|Filtering events in plugins
24+
eventFilterD.md|Filtering events in plugins details
25+
appendix.md|Appendices
26+
puiButtonTab.md|puiButtonTab
27+
puiButtonTabTree.md|puiButtonTabTree
28+
objDef.md|Object definitions
29+
debug.md|Debug mode
30+
cfgopt.md|Configuration option
31+
event.md|Event
32+
concept.md|Basic overview
33+
handler.md|Event handler
34+
jsevent.md|JavaScript event processing
35+
uiobject.md|UI elements
36+
uibutton.md|Button
37+
uitab.md|Tab
38+
uitree.md|Tree
39+
resource.md|Resource/Package
40+
routingmc.md|Mouse click routing

0 commit comments

Comments
 (0)