The documentation is split into different parts:

How you can contribute

We're on the way to improve the documentation, but it's a long way. If you would like to contribute to the documentation you are very welcome. Please directly post your proposals to the public wiki or post your suggestions to the mailing list.

How the documentation is generated

The Sling web site and documentation are managed with the Apache CMS. For Apache Sling specific extensions see the The Sling Site section below.

The Sling site was converted from a Confluence exported site to an Apache CMS managed site. All non-fully converted pages will show a tip box pointing to the original Confluence exported page for reference.

Once migration of a page has completed the translation_pending header should be removed from the page source. After that the tip box will not be shown any more.

The basic documentation of Sling is made up of four parts:

  1. The Sling Site at http://sling.apache.org/ (you are here)
  2. The Public Wiki at http://cwiki.apache.org/SLING
  3. The JavaDoc
  4. The Maven plugin documentation

This page is about how this documentation is maintained and who is allowed to do what.

The Sling Site

The site is managed with the Apache CMS where the source is kept in SVN at https://svn.apache.org/repos/asf/sling/site/trunk/content.

This section lists some Apache Sling features to help with the maintenance of the site, such as automatic link generation.

Start the file with a Title: line to define the page title and the first H1 tag:

Title: Page Title

Here comes the content separated with a blank like from the
header ...

The last modification information from SVN (revision, committer, and date/time) is automatically added when the page is rendered

Excerpts can be added to a page using the Excerpt: header:

Title: Page Title
Excerpt: Summary of the page for inclusion in other pages;
   continuation of the excerpt must be indented

Here comes the content separated with a blank like from the
header ...

Metadata from child pages can be referred to in the content with the Django variable reference notation using the child page name (without extension) as its container; e.g. for the child page named childpage:

{{ children.childpage.headers.excerpt }}
{{ children.childpage.headers.title }}

Content Pages can contain Django templates of the form {{...}} and {%...%}. If so, the page content is evaluated as a Django template before running it through the page template.

Any page in the site can be referenced with refs.pagename returning properties:

the absolute path of the page on the site
page headers (e.g. .title, .excerpt)
the raw page content

All pages in the children namespace are also available in the refs namespace

Some usefull hints:

Printing title of another page "handler":

   {{ refs.handler.headers.title }}

Printing excerpt of another page "handler":

   {{ refs.handler.headers.excerpt }}

Linking to another page "handler":

   ({{ refs.handler.path }})

Printing title as a link to another page "handler":

   [{{ refs.handler.headers.title }}]({{ refs.handler.path }})

Printing excerpt as a link to another page "handler":

   [{{ refs.handler.headers.excerpt }}]({{ refs.handler.path }})

Print a bullet pointed child page list:

   {% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
   {% endfor %}
It is important to have the first part as a single line, otherwise the Django/Markdown combo will create a list for each entry.

Code Highlighting

Code Highlighting works by indenting code by four blanks. To indicate the type of highlighting preced the code style text with either :::<lexer> to get high lighted code using the given <lexer> or #!<lexer> to get high lighted code with line numbers using the given <lexer>. See http://www.apache.org/dev/cmsref.html#code-hilighter for main info and http://pygments.org/docs/lexers/ for supported lexers

Manual Generation

When commiting changes to pages into SVN the pages are automatically generated in the staging site.

To manually generate the site or single pages the site can be checked out from SVN. In addition Perl and Python must be installed for the build tools to work.

To prepare for site build, the Markdown daemon has to be started:

$ export MARKDOWN_SOCKET="$PWD/tools/build/../markdown.socket"
$ export PYTHONPATH="$PWD/tools/build"
$ python "$PWD/tools/build/markdownd.py"

The MARKDOWN_SOCKET environment variables is also required by the build_site.pl and build_file.pl scripts to connect to the Markdown daemon.

To build the complete site use the build_site.pl script:

$ tools/build/build_site.pl --source-base $PWD/trunk \
    --target-base $PWD/trunk/target

To build a single page use the build_file.pl script:

$ tools/build/build_site.pl --source-base $PWD/trunk \
    --target-base $PWD/trunk/target \
    --source content/documentation.mdtext

The argument to the --source parameter is relative to the --source-base folder.

The Public Wiki

The public wiki of Sling is available at http://cwiki.apache.org/SLING and is maintained in the Confluence space SLING. Everyone can create an account there. To gain edit rights please ask via the mailing list. Any of the administrators listed in the Space Overview can give you access.

The JavaDoc

With every major release of Sling the JavaDoc of all containing bundles are published below http://sling.apache.org/apidocs/. The script for generating this aggregation JavaDoc is at http://svn.apache.org/repos/asf/sling/trunk/tooling/release/ in generate_javadoc_for_release.sh

In addition every released bundle is released together with its JavaDoc (which is also pushed to Maven Central).

The Maven Plugin Documentation

For the most important Maven Plugins the according Maven Sites (generated with the maven-site-plugin) are published at http://sling.apache.org/components/. The description on how to publish can be found at Release Management.

Rev. 1791080 by kwin on Wed, 12 Apr 2017 07:30:27 +0000
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.