From 3c238457d2e49b19c9300ef68416994dea515f43 Mon Sep 17 00:00:00 2001 From: Bobby Date: Mon, 11 Jun 2018 14:04:59 +0200 Subject: [PATCH] Add code example in JS as intro --- doc/developer/site/contributions.rst | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/doc/developer/site/contributions.rst b/doc/developer/site/contributions.rst index c333253..79e5f66 100644 --- a/doc/developer/site/contributions.rst +++ b/doc/developer/site/contributions.rst @@ -16,14 +16,8 @@ Added code from page contributions will be aggregated from all controllers befor To use page contributions, your component needs to return a ``pageContributions`` property in the response of your component, meaning in the returned JavaScript object (where you usually put the ``body`` property). A full return might look like this. As always, the ``return`` goes at the end of your component's controller. -``` -return { - body: '

Some code

', - pageContributions: { - headEnd: "" - } -} -``` +.. literalinclude:: code/page-contribution-intro.js + :language: javascript Changing the ``headEnd`` to one of the other possible positions will change where the code you contributed is added in the page's HTML before returning it to the end-user.