8
0

Add the ability to put an information message at the top of a confluence page

Dieser Commit ist enthalten in:
Stéphane Goetz 2016-04-14 12:03:25 +02:00
Ursprung d3f8d19f88
Commit 40a59106fd
3 geänderte Dateien mit 25 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -68,3 +68,21 @@ By default, it will inform you that some pages aren't needed anymore and you can
```
By setting `delete` to `true` (or running `daux.phar` with the `--delete` flag) you tell the generator that it can safely delete the pages.
## Information message
When you create your page. there is no indication that the upload process will override the content of the pages.
It happens sometimes that users edit the pages to add / fix an information.
You can add a text in a "information" macro on top of the document by setting the following configuration :
```json
{
"confluence": { "header": "These pages are updated automatically, your changes will be overriden." }
}
```
It will look like this :
![Info macro](info_macro.png)

Binäre Datei nicht angezeigt.

Nachher

Breite:  |  Höhe:  |  Größe: 12 KiB

Datei anzeigen

@ -27,7 +27,13 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
}
);
return $content;
$intro = '';
if (array_key_exists('confluence', $this->params) && array_key_exists('header', $this->params['confluence']) && !empty($this->params['confluence']['header'])) {
$intro = '<ac:structured-macro ac:name="info"><ac:rich-text-body>' . $this->params['confluence']['header'] . '</ac:rich-text-body></ac:structured-macro>';
}
return $intro . $content;
}
private function createImageTag($filename, $attributes)