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

Cette révision appartient à :
Stéphane Goetz 2016-04-14 12:03:25 +02:00
Parent d3f8d19f88
révision 40a59106fd
3 fichiers modifiés avec 25 ajouts et 1 suppressions

Voir le fichier

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

Fichier binaire non affiché.

Après

Largeur:  |  Hauteur:  |  Taille: 12 KiB

Voir le fichier

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