Writing documentation for Apache Ivy is pretty simple.
The documentation engine used is called link:http://xooki.sourceforge.net[xooki], and allows to edit pages while you browse them as soon as you browse them offline (and thus can actually save your modifications).
To browse the doc offline, we recommend to check it out from git:
[source]
----
git clone https://git-wip-us.apache.org/repos/asf/ant-ivy.git
----
Alternatively you can also check out the whole site:
[source]
----
svn co https://svn.apache.org/repos/asf/ant/site/ivy ivy-site
----
Then open the index.html file, and you will browse the web site exactly as when you're online, except that you will see a small toolbar at the upper right, allowing to link:#edit-inline[edit the page], save it, move the page in the link:#edit-toc[TOC], create a child, and so on:
image:images/xooki-toolbar.png[]
== [[edit-inline]]Inline editing
When you choose edit you will see a pretty familiar textbox where you can edit the page source.
link:images/xooki-edit.png[ image:images/xooki-edit-small.png[]]
The source uses a format very familiar to those who sometimes write html. Indeed link:#issues[nearly] any html is allowed. But you also have some shortcuts and neat syntax.
First, line breaks are automatically recognized, so you don't have to put br everywhere.
Another interesting thing is the code fragment:
[source]
----
any text including
----
Very helpful to avoid escaping all xml with lt and gt.
Finally, URLs are automatically recognized and convert to links, jira issues like link:http://issues.apache.org/jira/browse/IVY-202[IVY-202] are recognized too, and you can use a neat format to reference any ant ivy ant task like link:history/latest-milestone/use/install.html[install]. And you can also link to another page by providing its id (i.e. its url without the base and the .html) like the link:index.html[Home] or the history/latest-milestone/index.
Feel free to edit this page to get a good overview of what is possible.
And do not forget to save your changes before leaving the page! Then you can use your favorite IDE or git and compute a patch for what you changed, and submit this patch by attaching it to a jira issue, or simply sending it to the ivy-dev link:mailing-lists.html[mailing list].
== [[edit-toc]]Editing the TOC
The structure of the TOC is stored in the toc.json. Some operations are available in the toolbar, others need manual editing of the json file.
=== Moving entries
To move up or down an entry within its category, you can use the arrows in the toolbar. First go on the page you want to move and then use the arrows ( image:xooki/images/up.gif[] image:xooki/images/down.gif[]). Note that the changes are directly done in the json file, there is no need to trigger some "save" action.
=== Adding entries
You can also add an entry to the TOC via the toolbar, but only as a child of an existing entry. Select the parent, and use the image:xooki/images/addchild.gif[] button. Then you will be asked for a title (displayed to the end user) and a path (the path of the html file on the filesystem, relative to the root).
To add a root entry to the TOC, open the toc.json file with your favorite editor. In the root "children" array, add your entry:
[source]
----
{
"id":"mydir/myfilename",
"title":"My title",
"children": [
]
},
----
And create an HTML file mydir/myfilename.html with:
[source]
----
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////