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

This commit is contained in:
Stéphane Goetz 2016-04-14 12:03:25 +02:00
parent d3f8d19f88
commit 40a59106fd
3 changed files with 25 additions and 1 deletions

View File

@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -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)