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
bovenliggende d3f8d19f88
commit 40a59106fd
3 gewijzigde bestanden met toevoegingen van 25 en 1 verwijderingen

Bestand weergeven

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

Binair bestand niet weergegeven.

Na

Breedte:  |  Hoogte:  |  Grootte: 12 KiB

Bestand weergeven

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