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. //// <textarea id="xooki-source"> </textarea> ---- And finally reload the index.html in your favorite browser, the new entry will appear. You can now add some content by link:#edit-inline[editing the page]. === Abstract Entries Some entries in the tree of the TOC can be abstract. Such kind of node does not link to any page, but holds some children. So a node will appear in the tree, with an arrow to display or hide the children, but there is no html links associated, as there is no page to display. To specify a such node, edit the toc.json and set the "isAbstract" property to true: [source] ---- { "id":"myAbstractID", "title":"My Abstract Node", "isAbstract":true, "children": ....... } ---- === External TOC reference It is possible to not have the entire documentation in one place. This is particularly useful for the link:history.html[versioning of some documentation]. So the end user will see an unified tree whereas every information is not stored in the toc.json. So you have to define a node with the 3 following properties: * "title": the title of the imported entry * "importRoot": the relative path to the root of the external TOC (where to find the other toc.json) * "importNode": the ID of node in the external TOC to point to. For instance: [source] ---- { "title":"My doc version 1.2.3", "importRoot":"history/1.2.3", "importNode":"index" }, ---- === [[toc-url]]External URL A entry in the toc can point to an arbitrary URL rather than on a page identified by its `id`. To make an entry point to an external URL, just add an `url` property: [source] ---- { "id":"external-search" "title":"Some www search engine", "url":"http://www.google.com/" }, ---- == [[issues]]Known issues There is a special xml tag used by Xooki to handle the inline edition of the content: textarea with id xooki-source. In the current page we had to include that special tag. So in the source of this page there would be two tags with the same id "xooki-source", which is forbidden. So we have to xml encode it in the source, with some &lt; and &gt;. There also an issue with some json code. Above there are some json code which has to be xml encoded unless Xooki got confused. So [ and ] have to be encoded into respectively &#x5B; and &#x5D;. And there are some xml encoding issues while inline editing. Generally you don't need to xml encode them, Xooki will handle it for you. But as discussed above, sometimes you are forced to use some. So as you may see the source of this page, xml entities are encoded 3 times. If you want to display an xml encoded & then you will have to write &amp;amp;amp;. *IMPORTANT NOTE*: if you edit a page with Xooki which has some xml entities, Xooki will eat them and the triple encoding will disappear. Before saving you have to be sure to re-encode the & of the entities two times: in the page you will see &#x5D; which has to be replaced by &amp;amp;#x5D;. The simpler though is to edit this kind of file via a text editor and not a browser.