178 changes: 178 additions & 0 deletions documentation-ui/src/main/resources/DocApp/Code/DocumentationCSS.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?xml version="1.1" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc version="1.6" reference="DocApp.Code.DocumentationCSS" locale="">
<web>DocApp.Code</web>
<name>DocumentationCSS</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<parent>WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<version>1.1</version>
<title>CSS for the Documentation Application</title>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
<hidden>true</hidden>
<content/>
<object>
<name>DocApp.Code.DocumentationCSS</name>
<number>0</number>
<className>XWiki.StyleSheetExtension</className>
<guid>c3704661-5a16-42f2-b765-48408f7b4170</guid>
<class>
<name>XWiki.StyleSheetExtension</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<cache>
<cache>0</cache>
<defaultValue>long</defaultValue>
<disabled>0</disabled>
<displayType>select</displayType>
<freeText>forbidden</freeText>
<largeStorage>0</largeStorage>
<multiSelect>0</multiSelect>
<name>cache</name>
<number>5</number>
<prettyName>Caching policy</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>long|short|default|forbid</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</cache>
<code>
<contenttype>PureText</contenttype>
<disabled>0</disabled>
<editor>PureText</editor>
<name>code</name>
<number>2</number>
<prettyName>Code</prettyName>
<restricted>0</restricted>
<rows>20</rows>
<size>50</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</code>
<contentType>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<freeText>forbidden</freeText>
<largeStorage>0</largeStorage>
<multiSelect>0</multiSelect>
<name>contentType</name>
<number>6</number>
<prettyName>Content Type</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>CSS|LESS</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</contentType>
<name>
<disabled>0</disabled>
<name>name</name>
<number>1</number>
<prettyName>Name</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</name>
<parse>
<disabled>0</disabled>
<displayFormType>select</displayFormType>
<displayType>yesno</displayType>
<name>parse</name>
<number>4</number>
<prettyName>Parse content</prettyName>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.BooleanClass</classType>
</parse>
<use>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<freeText>forbidden</freeText>
<largeStorage>0</largeStorage>
<multiSelect>0</multiSelect>
<name>use</name>
<number>3</number>
<prettyName>Use this extension</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>currentPage|onDemand|always</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</use>
</class>
<property>
<cache>long</cache>
</property>
<property>
<code>span.documentation-badge {
padding: 4px 8px;
background: var(--brand-primary);
color: white;
border-radius: 32px;
display: inline-block;
margin: 0 5px;
}

span.documentation-badge * {
color: white;
}

span.documentation-badge:hover {
text-decoration: none;
background-color: var(--brand-info);
}
</code>
</property>
<property>
<contentType>CSS</contentType>
</property>
<property>
<name>Doc CSS</name>
</property>
<property>
<parse>0</parse>
</property>
<property>
<use>always</use>
</property>
</object>
</xwikidoc>
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
#getProductName($product $productName)
#set ($discard = $xwiki.jsx.use('DocApp.Code.DocumentationNavigationPanel'))
#panelheader("$productName for ${stringtool.capitalize($target)}s")
#set ($rootNames = {'user' : 'User', 'administrator' : 'Admin', 'developer' : 'Dev'})
## Escape special characters in macro parameter values.
#set ($openToDoc = $doc.documentReference.toString().replaceAll('([~"])', '~$1'))
## TODO: Code below to be removed once https://jira.xwiki.org/browse/XWIKI-23621 is implemented and the parent POM
Expand Down
197 changes: 197 additions & 0 deletions documentation-ui/src/main/resources/DocApp/Code/TargetBadge.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<?xml version="1.1" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<xwikidoc version="1.6" reference="DocApp.Code.TargetBadge" locale="">
<web>DocApp.Code</web>
<name>TargetBadge</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<parent>WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<version>1.1</version>
<title>Badge for the Target in the content footer</title>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
<hidden>true</hidden>
<content/>
<object>
<name>DocApp.Code.TargetBadge</name>
<number>0</number>
<className>XWiki.UIExtensionClass</className>
<guid>14169360-744d-4c2e-9d9e-b5ffd203c558</guid>
<class>
<name>XWiki.UIExtensionClass</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<async_cached>
<defaultValue>0</defaultValue>
<disabled>0</disabled>
<displayFormType>select</displayFormType>
<displayType/>
<name>async_cached</name>
<number>3</number>
<prettyName>Cached</prettyName>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.BooleanClass</classType>
</async_cached>
<async_context>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<freeText>forbidden</freeText>
<largeStorage>0</largeStorage>
<multiSelect>1</multiSelect>
<name>async_context</name>
<number>4</number>
<prettyName>Context elements</prettyName>
<relationalStorage>0</relationalStorage>
<separator>, </separator>
<separators>|, </separators>
<size>5</size>
<unmodifiable>0</unmodifiable>
<values>action=Action|doc.reference=Document|doc.revision|icon.theme=Icon theme|locale=Language|rendering.defaultsyntax=Default syntax|rendering.restricted=Restricted|rendering.targetsyntax=Target syntax|request.base=Request base URL|request.cookies|request.headers|request.parameters=Request parameters|request.remoteAddr|request.session|request.url=Request URL|request.wiki=Request wiki|sheet|user=User|wiki=Wiki</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</async_context>
<async_enabled>
<defaultValue>0</defaultValue>
<disabled>0</disabled>
<displayFormType>select</displayFormType>
<displayType/>
<name>async_enabled</name>
<number>2</number>
<prettyName>Asynchronous rendering</prettyName>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.BooleanClass</classType>
</async_enabled>
<content>
<disabled>0</disabled>
<editor>Text</editor>
<name>content</name>
<number>1</number>
<prettyName>Executed Content</prettyName>
<restricted>0</restricted>
<rows>25</rows>
<size>120</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</content>
<extensionPointId>
<disabled>0</disabled>
<name>extensionPointId</name>
<number>5</number>
<prettyName>Extension Point ID</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</extensionPointId>
<name>
<disabled>0</disabled>
<name>name</name>
<number>6</number>
<prettyName>Extension ID</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</name>
<parameters>
<contenttype>PureText</contenttype>
<disabled>0</disabled>
<editor>PureText</editor>
<name>parameters</name>
<number>7</number>
<prettyName>Extension Parameters</prettyName>
<restricted>0</restricted>
<rows>10</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</parameters>
<scope>
<cache>0</cache>
<disabled>0</disabled>
<displayType>select</displayType>
<freeText>forbidden</freeText>
<largeStorage>0</largeStorage>
<multiSelect>0</multiSelect>
<name>scope</name>
<number>8</number>
<prettyName>Extension Scope</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<values>wiki=Current Wiki|user=Current User|global=Global</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</scope>
</class>
<property>
<async_cached>0</async_cached>
</property>
<property>
<async_context/>
</property>
<property>
<async_enabled>0</async_enabled>
</property>
<property>
<content>{{include reference = 'DocApp.Code.DocumentationMacros' /}}

{{velocity}}
#set ($documentationObject = $doc.getObject('DocApp.Code.DocumentationClass'))
#if ($documentationObject)
#set ($target = $documentationObject.getValue('target'))
#if ("$!target" != '')
#getTargetSpaceReference($targetSpaceReference)
#set ($targetDocReference = $services.model.resolveDocument('', $targetSpaceReference))
#if ($xwiki.exists($targetDocReference))
(% class='documentation-badge' %)[[$stringtool.capitalize($target)&gt;&gt;$services.model.serialize($targetDocReference)]](%%)
#else
(% class='documentation-badge' %)$stringtool.capitalize($target)(%%)
#end
#end
#end
{{/velocity}}</content>
</property>
<property>
<extensionPointId>org.xwiki.platform.template.contentFooter</extensionPointId>
</property>
<property>
<name>docapp.template.contentFooter.target</name>
</property>
<property>
<parameters>order=240</parameters>
</property>
<property>
<scope>wiki</scope>
</property>
</object>
</xwikidoc>
Loading