Commit 565f1cad authored by Cédric CORAZZA's avatar Cédric CORAZZA

Import initial.

parents
Pipeline #4550 skipped
This diff is collapsed.
======================
ownCloud Documentation
======================
Documentation is published on `<https://doc.owncloud.org>`_ and
`<https://doc.owncloud.com>`_.
The `documentation Wiki <https://github.com/owncloud/documentation/wiki>`_ is
available for tips, tricks, edge cases, and anyone who wants to contribute more
easily, without having to learn Git and Sphinx.
See the `Style Guide <https://github.com/owncloud/documentation/blob/master/style_guide.rst>`_ for formatting and style conventions.
Manuals
-------
This repository hosts four manuals:
* **Users' Manual**
* **Administration Manual**
* **Developers Manual**
Please work in the appropriate branch. Stable7 is for ownCloud 7, stable8 is 8.0, stable8.1 is 8.1, stable8.2 is 8.2, and master is version 9.
Please wrap lines at 80 characters.
**Important: Please copy the links to any relevant Github PRs or issues at the end of every doc page. This makes it much easier to go back and find information and fact-check.** Like this example::
.. Github references
.. Foo PR title #100 https://github.com/owncloud/core/pull/100
.. note:: ``configuration_server/config_sample_php_parameters.rst`` is auto-generated from the core
config.sample.php file; changes to this file must be made in core `<https://github.com/owncloud/core/tree/master/config>`_
Spelling and Capitalization Conventions
---------------------------------------
As this grows it may be moved to its own page.
* ownCloud Apps Store
* synchronize
* Web (Web page, Web site)
License
-------
All documentation in this repository is licensed under the Creative Commons
Attribution 3.0 Unported license (`CC BY 3.0`_).
.. _CC BY 3.0: http://creativecommons.org/licenses/by/3.0/deed.en_US
Style
-----
Source files are written using the `Sphinx Documentation Generator
<http://sphinx.pocoo.org/>`_. The syntax follows the `reStructuredText
<http://docutils.sourceforge.net/rst.html>`_ style, and can also be edited
from GitHub.
Editing
-------
Contributing to the documentation requires a Github account. Make sure you are
working in the correct branch for your version of ownCloud or client apps.
If your edits pertain to multiple manual versions, be prepared to backport as
needed.
To edit a document, you can edit the .rst files on your local system, or work
directly on Github. The latter is only suitable for small fixes and improvements
because substantial editing efforts can better be controlled on your local PC.
The best way is to install a complete Sphinx build environment and work on your
local PC. You will be able to make your own local builds, which is the fastest
and best way to preview for errors. Sphinx will report syntax errors, missing
images, and formatting errors. The Github preview is not complete and misses
many mistakes. Create a new branch against the master or stable branch you are
editing, make your edits, then push your new branch to Github and open a new PR.
To edit on Github, fork the repository (see top-right of the screen, under
your username). You will then be able to make changes easily. Once done,
you can create a pull request and get the changes reviewed and back into
the official repository.
Building
--------
Linux / OS X
^^^^^^^^^^^^
First, make sure that the following are installed:
* Python 2 (2.6.0 or better, Python 3 is not yet supported!)
* Python Image Library (PIL) - (the package is called something like ``python-pillow``)
* Sphinx (e.g. ``sudo yum install python-sphinx``),
on Mac: ``sudo easy_install Sphinx``
* Sphinx PHPDomain (e.g. ``sudo easy_install sphinxcontrib-phpdomain``)
* rst2pdf (e.g. ``sudo easy_install rst2pdf``)
* If you're on Arch Linux, the build script is called sphinx-build2 which
will fail. You will need to provide a link to the expected script name::
sudo ln -s /usr/bin/sphinx-build2 /usr/bin/sphinx-build
...then enter any manual directory, then run ``make html``. The result can
be found in the ``_build/html`` subdirectory. PDFs can be built with the
``make latexpdf`` command and are found in _build/latex/ directory.
The openSUSE way
~~~~~~~~~~~~~~~~
* sudo zypper in python-Sphinx
* sudo zypper in python-rst2pdf
* sudo zypper in python-sphinxcontrib-phpdomain # requires repository "devel:languages:python"
* sudo zypper in pdfjam # pull in latexpdf and all of texlive
* sudo zypper in texlive-threeparttable
* sudo zypper in texlive-wrapfig
* sudo zypper in texlive-multirow
* cd user_manual
* make latexpdf
* okular _build/latex/ownCloudUserManual.pdf
The Debian/Ubuntu way
~~~~~~~~~~~~~~~~~~~~~
* sudo apt-get install python-pil
* sudo apt-get install python-sphinx
* sudo apt-get install python-sphinxcontrib.phpdomain
* sudo apt-get install rst2pdf
* sudo apt-get install texlive-fonts-recommended
* sudo apt-get install texlive-latex-extra
* sudo apt-get install texlive-latex-recommended
* cd user_manual
* make latexpdf
* evince _build/latex/ownCloudUserManual.pdf
The Arch Linux way
~~~~~~~~~~~~~~~~~~
* sudo pacman -S community/python2-rst2pdf
* sudo pacman -S community/python2-sphinx
* aur/sphinxcontrib-phpdomain from AUR
* sudo pacman -S extra/texlive-core texlive-latexextra
* cd user_manual
* make latexpdf
* PDFVIEWER _build/latex/ownCloudUserManual.pdf
Windows
^^^^^^^
Running ``setup.cmd`` will install Python 2.7 and install all dependencies.
Enter any manual and clicking the "Build HTML" shortcut will create a HTML
build. Likewise, "Build PDF" will build the PDF using the more lightweight,
but feature-incomplete RST2PDF tool. The results are in ``_build/html`` and
``_build/pdf`` respectively.
Importing Word and OpenDocument files
-------------------------------------
Sometimes, existing documentation might be in Word or LibreOffice documents. To
make it part of this documentation collection, follow these steps:
Prerequisites
^^^^^^^^^^^^^
1. Install Python 2.x
2. Install odt2sphinx (``easy_install odt2sphinx``)
3. Install GCC/clang (`Xcode command line tools`_ required on Mac OS)
Process
^^^^^^^
1. ``doc/docx`` files need to be stored as odt first
2. Run ``odt2sphinx my.docx``
3. Move the resulting ``rst`` files in place and reference them
4. Wrap text lines at 80 chars, apply markup fixes
.. _CC BY 3.0: http://creativecommons.org/licenses/by/3.0/deed.en_US
.. _`Xcode command line tools`: http://stackoverflow.com/questions/9329243/xcode-4-4-and-later-install-command-line-tools
========================
Sphinx Bootstrap Theme
========================
This repository integrates the Twitter Bootstrap_ CSS / JavaScript framework
as a Sphinx_ theme_. A live demo_ is available to preview the theme.
.. _Bootstrap: http://twitter.github.com/bootstrap/
.. _Sphinx: http://sphinx.pocoo.org/
.. _theme: http://sphinx.pocoo.org/theming.html
.. _demo: http://ryan-roemer.github.com/sphinx-bootstrap-theme
Installation
============
To install the theme, download the theme directory and update your
configuration
1. Create a "_themes" directory in your project source root.
2. Get the "bootstrap" themes either as raw files or as a zipfile from
the repository.
a. Most current way is to just clone this repo or download the full
repo source and move the "bootstrap" directory to "_themes".
b. Alternatively, there are some prepackaged theme zip files (containing
only the theme files), which can be read directly by Sphinx. See the
repo downloads_ page for available packages. Then download
"bootstrap.zip"::
$ cd /path/to/_themes
$ wget https://github.com/downloads/ryan-roemer/sphinx-bootstrap-theme/bootstrap.zip
In addition to the "current" release, the GitHub zipfiles have either git
hash releases (for development builds) or tags for official tagged
releases. E.g.::
bootstrap.zip
bootstrap-v0.0.2.zip
bootstrap-f51d73491e9bae68eb1b1c57059d9e0ece03d125.zip
3. Edit your configuration file to point to the bootstrap theme::
# Activate the theme.
sys.path.append(os.path.abspath('_themes'))
html_theme_path = ['_themes']
html_theme = 'bootstrap'
# (Optional) Use a shorter name to conserve nav. bar space.
html_short_title = "Demo"
# (Optional) Logo. Should be exactly 32x32 px to fit the nav. bar.
# Path should be relative to the html_static_path setting (e.g.,
# "_static") in source.
html_logo = "my_logo.png"
.. _downloads: https://github.com/ryan-roemer/sphinx-bootstrap-theme/downloads
Theme Notes
===========
Sphinx
------
The theme places the global TOC, local TOC, navigation (prev, next) and
source links all in the top Bootstrap navigation bar, along with the Sphinx
search bar on the left side.
The global (site-wide) table of contents is the "Site" navigation dropdown,
which is a multi-level deep rendering of the ``toctree`` for the entire site.
The local (page-level) table of contents is the "Page" navigation dropdown,
which is a multi-level rendering of the current page's ``toc``.
Generally speaking, this is a quick and dirty hack to get the basic theme
going, so there are likely some oversights and lurking issues. Help and
bug filings for the project are most welcome.
Bootstrap
---------
The theme uses Twitter Bootstrap v2.0. You can override any static JS/CSS files
by dropping different versions in your Sphinx "_static" directory.
Licenses
========
Sphinx Bootstrap Theme is licensed under the MIT_ license.
Twitter Bootstrap is licensed under the Apache_ license.
.. _MIT: https://github.com/ryan-roemer/sphinx-bootstrap-theme/blob/master/LICENSE.txt
.. _Apache: https://github.com/twitter/bootstrap/blob/master/LICENSE
<li class="dropdown">
<a href="{{ pathto(master_doc) }}" class="dropdown-toggle" data-toggle="dropdown">{{ _('Site') }} <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc">{{ toctree(maxdepth=1) }}</ul>
</li>
{% extends "basic/layout.html" %}
{% set script_files = script_files + ['_static/bootstrap.js'] %}
{% set css_files = ['_static/bootstrap.css', '_static/bootstrap-sphinx.css'] + css_files %}
{# Sidebar: Rework into our Boostrap nav section. #}
{% macro navBar() %}
<div id="navbar" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="{{ pathto(master_doc) }}">{{ project|e }}</a>
<span class="navbar-text pull-left"><b>{{ version|e }}</b></span>
<ul class="nav">
<li class="divider-vertical"></li>
{% block sidebartoc %}
{% include "globaltoc.html" %}
{% include "localtoc.html" %}
{% endblock %}
{% block sidebarrel %}
{% include "relations.html" %}
{% endblock %}
{% block sidebarsourcelink %}
{% include "sourcelink.html" %}
{% endblock %}
</ul>
{% block sidebarsearch %}
{% include "searchbox.html" %}
{% endblock %}
</ul>
</div>
</div>
</div>
</div>
{% endmacro %}
{%- block extrahead %}
<script type="text/javascript">
(function () {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL's to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($ul, minLevel) {
var findA;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
var level = level || 0,
$items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
pad = 15 + ((level - minLevel) * 10);
if (tag === 'a' && level >= minLevel) {
// Add to existing padding.
$item.css('padding-left', pad + "px");
console.log(level, $item, 'padding-left', pad + "px");
} else if (tag === 'ul') {
// Recurse.
findA($item, level + 1);
}
});
};
console.log("HERE");
findA($ul);
};
$(document).ready(function () {
// Add styling, structure to TOC's.
$(".dropdown-menu").each(function () {
$(this).find("ul").each(function (index, item){
var $item = $(item);
$item.addClass('unstyled');
});
$(this).find("li").each(function () {
$(this).parent().append(this);
});
});
// Patch in level.
patchToc($("ul.globaltoc"), 2);
patchToc($("ul.localtoc"), 2);
// Enable dropdown.
$('.dropdown-toggle').dropdown();
});
}());
</script>
{% endblock %}
{% block header %}{{ navBar() }}{% endblock %}
{# Silence the sidebar's, relbar's #}
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{% endblock %}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{%- block content %}
<div class="container">
{% block body %} {% endblock %}
</div>
{%- endblock %}
{%- block footer %}
<footer class="footer">
<div class="container">
<p class="pull-right"><a href="#">Back to top</a></p>
<p>
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}<br/>
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}<br/>
{%- endif %}
{%- endif %}
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/>
{%- endif %}