Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

11.0/macros, wysiwyg, etc (#8836)

ML-OpenP57864b93104b
diff --git a/docs/system-admin-guide/attribute-help-texts/README.md b/docs/system-admin-guide/attribute-help-texts/README.md
index 1f8ea17e178..f980b49e24f 100644
--- a/docs/system-admin-guide/attribute-help-texts/README.md
+++ b/docs/system-admin-guide/attribute-help-texts/README.md
@@ -28,6 +28,7 @@ This way you will reduce wrong entries for attributes. This is especially releva
| [Editing or deleting Attribute help texts](#editing-or-deleting-attribute-help-texts) | How to edit and how to delete an Attribute help text. |
| [Work packages](#work-packages) | Where will Attribute help texts for work packages be used? |
| [Projects](#projects) | Where will Attribute help texts for projects be used? |
+| [WYSIWYG editor](#wysiwyg-editor) | Where can Attribute help texts be displayed? |
Navigate to -> *Administration* -> *Attribute help texts* to set up help texts for attributes and custom fields in work packages and projects. Here you can add, edit and delete Attribute help texts.
@@ -81,8 +82,14 @@ The Attribute help texts for projects will be displayed in the Project details w
They will help the users (e.g. the project managers) understand what kind of information to put in which fields.
-![image-20201007112035870](image-20201007112035870.png)
+![Attribute help texts project overview](image-20201007112035870.png)
-![image-20201007112741049](image-20201007112741049.png)
\ No newline at end of file
+![Attribute help texts project information](image-20201007112741049.png)
+
+
+
+## WYSIWYG editor
+
+The Attribute help texts can also be displayed in the WYSIWYG text editor by using a certain syntax. Find out more [here](../../user-guide/wysiwyg/#embedding-of-work-package-attributes-and-project-attributes).
\ No newline at end of file
diff --git a/docs/user-guide/work-packages/README.md b/docs/user-guide/work-packages/README.md
index 3505abd272d..3f755f4cba3 100644
--- a/docs/user-guide/work-packages/README.md
+++ b/docs/user-guide/work-packages/README.md
@@ -15,10 +15,12 @@ keywords: work packages
Work packages have a **type**, an **ID**, a **subject** and may have various additional attributes, such as **status**, **assignee**, **priority**, **due date**.
-<div class="glossary">**Work package ID** is defined as a unique integer assigned to a newly created work package. Work package IDs cannot be changed and are numbered across all projects of an OpenProject instance (therefore, the numbering within a project may not be sequential).</div>
+<div class="glossary">**Work package ID** is defined as a unique integer assigned to a newly created work package. Work package IDs cannot be changed and are numbered across all projects of an OpenProject instance (therefore, the numbering within a project may not be sequential). </div>
+
<div class="glossary">
-**Types** are the different items a work package can represent, such as task, feature, bug, phase, milestone. The work package types can be configured in the system administration.
-</div>
+**Types** are the different items a work package can represent, such as task, feature, bug, phase, milestone. The work package types can be configured in the system administration. </div>
+
+
Work packages can be displayed in a projects timeline, e.g. as a milestone or a phase. In order to use the work packages, the work package module has to be activated in the project settings.
diff --git a/docs/user-guide/work-packages/create-work-package/README.md b/docs/user-guide/work-packages/create-work-package/README.md
index 0db28dd3b28..4af2c07ab94 100644
--- a/docs/user-guide/work-packages/create-work-package/README.md
+++ b/docs/user-guide/work-packages/create-work-package/README.md
@@ -9,7 +9,7 @@ keywords: create Work packages
# Create Work packages
-| Feature | Documentation for |
+| Topic | Content |
| ------------------------------------------------------------ | ---------------------------------------------- |
| [Create Work packages](#how-to-create-work-packages) | How to create a new Work package in a project? |
| [Add attachments to a Work package](#add-attachments-to-work-packages) | How to add attachments to a Work package? |
diff --git a/docs/user-guide/wysiwyg/README.md b/docs/user-guide/wysiwyg/README.md
index a5a7471b7ea..b171ca9b3b7 100644
--- a/docs/user-guide/wysiwyg/README.md
+++ b/docs/user-guide/wysiwyg/README.md
@@ -8,24 +8,38 @@ keywords: WYSIWYG, CKEditor, Links to OpenProject resources
# Rich text (WYSIWYG) editor in OpenProject
-Starting with version 8.0.0, OpenProject features a quasi-WYSIWYG editor, powered by [CKSource CKEditor5](https://ckeditor5.github.io/). The underlying format is GitHub-flavored CommonMark ([GFM](https://github.github.com/gfm/)). All previous textile-based content will be migrated when upgrading to OpenProject 8.0.
+Starting with version 8.0.0, OpenProject features a quasi-WYSIWYG editor, powered by [CKSource CKEditor5](https://ckeditor5.github.io/). The underlying format is GitHub-flavored CommonMark ([GFM](https://github.github.com/gfm/)). All previous textile-based content will be migrated when upgrading to OpenProject 8.0.
+
+<div class="alert alert-info" role="alert">
+**Please note:** In some resources such as work packages or comments, the editor does not exhibit all functionality such as macros or image upload.
+</div>
+
+
+
+| Topic | Content |
+| ------------------------------------------------------------ | -------------------------------------------------------- |
+| [Basic formating](#basic-formatting) | Basic formatting elements in the WYSIWYG editor |
+| [Image handling](#image-handling) | How to add images in the WYSIWYG editor? |
+| [Macros](#macros) | Available macros in the WYSIWYG editor |
+| [Links to OpenProject resources](#links-to-openproject-resources) | How to link to resources like wikis, projects, meetings? |
+| [Embedding of work package attributes and project attributes](#embedding-of-work-package-attributes-and-project-attributes) | How to embed attributes and attribute help texts? |
## Basic formatting
The CKEditor5 build in OpenProject supports basic text styles, such as bold and italic formatting, headings,
-strikethrough, inline code, and quotes as well as inline image handling. Pasting content such as images or rich text is also supported, while unsupported styling will be stripped by the editor.
+strike-through, inline code, and quotes as well as inline image handling. Pasting content such as images or rich text is also supported, while unsupported styling will be stripped by the editor.
-### Linebreaks
+### Line breaks
Instead of creating a new paragraph with Enter, you can also press `SHIFT+Enter` to create a line break without creating a new paragraph.
### Links
-Create hyperlinks by pressing the toolbar (optionally with some selected text), or by pressing `CTRL+k` to open a popup to enter the link href.
+Create hyperlinks by pressing the tool-bar (optionally with some selected text), or by pressing `CTRL+k` to open a popup to enter the link href.
### Widgets and Newlines
-CKEditor usese widgets to display block elements such as images, tables, and other elements that are not inline. You can select most widgets by pressing on it - The only exception to that is the table widget, it has a little select knob at the top left to select the entire table.
+CKEditor uses widgets to display block elements such as images, tables, and other elements that are not inline. You can select most widgets by pressing on it - The only exception to that is the table widget, it has a little select knob at the top left to select the entire table.
When you have a widget selected, you can remove or cut it. You can create a newline below it by selecting the widget and pressing `ENTER` or `↓ (ARROW DOWN)`, or a newline above it by pressing `SHIFT+enter` or `↑ (ARROW UP)`. This is especially needed when the widget is the first or last element on the page to insert a line below or above it.
@@ -34,14 +48,10 @@ When you have a widget selected, you can remove or cut it. You can create a newl
As CKEditor5 currently does not provide support for code blocks, OpenProject can display, but not edit code blocks within the CKEditor instance. A code block can be edited through a modal window within a `CodeMirror` editor instance. This has the advantage of providing syntax highlighting and code sensing ([for supported languages](https://codemirror.net/mode/)).
-
-
### Tables
The GFM extension of the CommonMark specs adds a definition for table syntax which the CKEditor build of OpenProject supports. This definition requires all tables to have a heading row. For tables created with CKEditor without heading rows, a HTML table is output instead. This matches the behavior of, e.g., GitHub.
-
-
### Autoformatting
CKEditor5 allows certain CommonMark-like [autoformatting keyboard strokes](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/features/autoformat.html):
@@ -51,7 +61,6 @@ CKEditor5 allows certain CommonMark-like [autoformatting keyboard strokes](https
- Create a bulleted list by starting the line with `* ` or `-` and a space
- Create a numbered list by starting the line with `1.` or `1)` and a space
-
## Image handling
@@ -71,6 +80,9 @@ The attachment will be automatically uploaded and stored as an attachment.
OpenProject has supported macros on textile formatted pages and continues to do so with the WYSIWYG editor. Note that macros are not expanded while editing the page, instead a placeholder is shown.
+You can find the macros here in the text editor:
+![Macros text editor](image-20201109183018255.png)
+
### Table of contents
@@ -102,9 +114,6 @@ The rendered page will then fetch the work package table results dynamically, re
Use it to embed views in other pages, create reporting of multiple results, or to embed a Gantt chart view.
-## Full vs constrained editor
-
-In some resources such as work packages or comments, the editor does not exhibit all functionality such as macros or image upload.
## Links to OpenProject resources
@@ -130,7 +139,7 @@ As with the textile formatting syntax, you can link to other resources within Op
- **commit by hash:** `commit:f30e13e4`
- **To a source file in the repository**: `source:"some/file"`
-To avoid processing these items, precede them with a bang `!` character such as `!#12` will prevent linking to a work package with ID 12.
+To avoid processing these items, preceding them with a bang `!` character such as `!#12` will prevent linking to a work package with ID 12.
@@ -140,16 +149,15 @@ For work packages and users, typing `#` or `@` will open an autocompleter for vi
-## Embedding of work package and project attributes
+## Embedding of work package attributes and project attributes
-You can embed specific attributes of work packages or projects using the following syntax:
+You can embed specific attributes of work packages or projects using a certain syntax.
+Examples:
- **Linking to the subject of work package with id #1234**: `workPackageValue:1234:subject`
- **Linking to the current project's status**: `projectValue:status`
- **Linking to the subject of work package with subject "Project start"**: `workPackageValue:"Project start":subject`
-
-
<div class="alert alert-info" role="alert">
**Note**: Referencing a work package by subject results in only looking for work packages with that given subject in the current project (if any). If you need to cross-reference work packages, use their ID to pinpoint the work package you want to reference.
@@ -157,19 +165,24 @@ You can embed specific attributes of work packages or projects using the followi
</div>
-
+### Embedding attribute help texts
You can also embed attribute values and [their help texts](../../system-admin-guide/attribute-help-texts/) by using `workPackageLabel` instead: `workPackageLabel:1234:status` would output the translated label for "Status" and (if exists), the corresponding help text for it.
-Note that these macros will only be expanded in the frontend. For each individual user, the correct permissions will be checked and the macro will result in an error if the user is not allowed to view the respective resource.
+
+
+**Note**: these macros will only be expanded in the frontend. For each individual user, the correct permissions will be checked and the macro will result in an error if the user is not allowed to view the respective resource.
+</div>
+
-**Available attributes for work packages**
+### Available attributes for work packages
-The following list contains all suppported attribute names for the `workPackageValue` and `workPackageLabel` macros.
+The following list contains all supported attribute names for the `workPackageValue` and `workPackageLabel` macros, where `1234` stands for the [work package ID](../work-packages).
| **Attribute** | Usage example |
| ------------------- | ------------------------------------------------------------ |
+| *Custom Fields* | `workPackageValue:1234:"Name of the work package custom field"` |
| Assigned user | `workPackageValue:1234:assignee` |
| Author | `workPackageValue:1234:author` |
| Category | `workPackageValue:1234:category` |
@@ -179,7 +192,7 @@ The following list contains all suppported attribute names for the `workPackageV
| Parent work package | `workPackageValue:1234:parent` |
| Priority | `workPackageValue:1234:priority` |
| Project | `workPackageValue:1234:project` |
-| Remaining Time | `workPackageValue:1234:remainingTime` |
+| Remaining hours | `workPackageValue:1234:remainingTime` (sic!) |
| Responsible user | `workPackageValue:1234:responsible` |
| Spent time | `workPackageValue:1234:spentTime` |
| Start date | `workPackageValue:1234:startDate` |
@@ -188,14 +201,14 @@ The following list contains all suppported attribute names for the `workPackageV
| Work package type | `workPackageValue:1234:type` |
| Date of last update | `workPackageValue:1234:updatedAt` |
| Version | `workPackageValue:1234:version` |
-| *Custom Fields* | `workPackageValue:1234:"Name of the work package custom field"` |
-**Available attributes for projects**
+### Available attributes for projects
The following list contains all supported attribute names for the `projectValue` and `projectLabel` macros. The examples all show references to the _current_ project the document is rendered in. They can also reference another project with `projectValue:"Identifier of the project":attribute`.
| **Attribute** | Usage example |
| ------------------------- | ------------------------------------------------- |
+| *Custom Fields* | `projectValue:"Name of the project custom field"` |
| Project active? (boolean) | `projectValue:active` |
| Description | `projectValue:description` |
| Identifier of the project | `projectValue:identifier` |
@@ -204,5 +217,4 @@ The following list contains all supported attribute names for the `projectValue`
| Status description | `projectValue:statusExplanation` |
| Parent project | `projectValue:parent` |
| Project public? (boolean) | `projectValue:public` |
-| *Custom Fields* | `projectValue:"Name of the project custom field"` |
diff --git a/docs/user-guide/wysiwyg/image-20201109183018255.png b/docs/user-guide/wysiwyg/image-20201109183018255.png
new file mode 100644
index 00000000000..03a7383eeb6
Binary files /dev/null and b/docs/user-guide/wysiwyg/image-20201109183018255.png differ