Restructure the dev manual

This moves lots of pages around. The high-level changes are

* Better main sections, so it's more *general*, *into*, *basics* and *details*
* Move more general topics to a *Basic* section, which are not
  app-specific
* Remove app docs to the stuff that is likely used, anything else goes
  into "Digging deeper"
* Move general guides into a prologue
* Try to *compress*/combine some pages with similar content
* Try to have better consistencs on level ob abstraction across pages
* Split app development and maintenance pages into two sections
* Integrate bugtracker info into prologue
* Integrate Android pages into client APIs section

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst
2020-06-22 18:35:59 +02:00
parent 547810edd8
commit 2647cd93c7
71 changed files with 228 additions and 105 deletions

View File

@@ -1,15 +0,0 @@
============
Coding Style
============
.. sectionauthor:: Christoph Wurst <christoph@winzerhof-wurst.at>
PHP
---
Starting with Nextcloud 19 there is a shared `PHP Coding Standards Fixer <https://github.com/FriendsOfPhp/PHP-CS-Fixer>`_ configuration you can use to automatically format your app's source code. For full details see the `repository on Github <https://github.com/nextcloud/coding-standard/>`_.
JavaScript
----------
There is a shared configuration for `eslint <https://eslint.org/>`_ that you can use to automatically format your Nextcloud apps's JavaScript code. It consists of two parts: a `config package <https://github.com/nextcloud/eslint-config>`_ that contains the formatting preferences and a `plugin <https://github.com/nextcloud/eslint-plugin>`_ to detect deprecated and removed APIs in your code. See their readmes for instructions.

View File

@@ -1,38 +0,0 @@
===============
App development
===============
.. toctree::
:maxdepth: 1
intro
tutorial
upgrade-guide
bootstrap
npm
javascript-apis
requests/index
view/index
storage/index
changelog
classloader
code_signing
info
init
publishing
users
two-factor-provider
events
backgroundjobs
settings
notifications
flow
logging
repair
publicpage
testing
coding-style
psr
../api

View File

@@ -0,0 +1,13 @@
===============
App development
===============
.. toctree::
:maxdepth: 2
intro
tutorial
bootstrap
info
init
logging

View File

@@ -0,0 +1,10 @@
==============================
App publishing and maintenance
==============================
.. toctree::
:maxdepth: 2
code_signing
publishing
upgrade-guide

View File

@@ -1,6 +1,6 @@
=========
Container
=========
====================
Dependency injection
====================
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>

View File

@@ -1,6 +1,6 @@
====
View
====
=========
Front-end
=========
.. toctree::
:maxdepth: 2

View File

@@ -0,0 +1,17 @@
==============
Basic concepts
==============
.. toctree::
:maxdepth: 2
request_lifecycle
routing
dependency_injection
controllers
middlewares
events
front-end/index
backgroundjobs
logging
storage/index

View File

@@ -1,6 +1,6 @@
==========
Middleware
==========
===========
Middlewares
===========
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>

View File

@@ -5,10 +5,7 @@ Request lifecycle
.. toctree::
:maxdepth: 1
routes
middleware
container
controllers
api
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>, Morris Jobke <hey@morrisjobke.de>

View File

@@ -1,8 +1,8 @@
.. _androidindex:
===============================
Android application development
===============================
=======
Android
=======
Nextcloud provides an official Nextcloud Android client, which gives its users
access to their files on their Nextcloud. It also includes functionality like
automatically uploading pictures and videos to Nextcloud.

View File

@@ -1,12 +1,13 @@
.. _apiindex:
===============================
Client APIs
===============================
=======================
Clients and Client APIs
=======================
.. toctree::
:maxdepth: 2
android_library/index
WebDAV/index
OCS/index
LoginFlow/index

View File

@@ -1,6 +1,6 @@
.. only:: html
API Documentation
API documentation
=================

View File

@@ -0,0 +1,24 @@
==============
Digging deeper
==============
.. toctree::
:maxdepth: 2
api
changelog
debugging
classloader
flow
javascript-apis
npm
notifications
performance
psr
publicpage
repair
rest_apis
settings
testing
two-factor-provider
users

View File

@@ -1,6 +1,6 @@
===========
RESTful API
===========
=========
REST APIs
=========
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>

View File

@@ -1,13 +0,0 @@
==============================
General contributor guidelines
==============================
.. toctree::
:maxdepth: 2
code-of-conduct
devenv
security
codingguidelines
performance
debugging

View File

@@ -0,0 +1,19 @@
===============
Getting started
===============
Table of contents
-----------------
.. toctree::
:maxdepth: 1
general/index
app/index
core/index
design/index
android_library/index
client_apis/index
bugtracker/index
commun/index
api

View File

@@ -103,7 +103,7 @@ User interface
PHP
---
The Nextcloud coding style guide is based on `PEAR Coding Standards <http://pear.php.net/manual/en/standards.php>`_.
Starting with Nextcloud 19 there is a shared `PHP Coding Standards Fixer <https://github.com/FriendsOfPhp/PHP-CS-Fixer>`_ configuration you can use to automatically format your app's source code. For full details see the `repository on Github <https://github.com/nextcloud/coding-standard/>`_.
Always use::
@@ -261,12 +261,10 @@ with ``Data``.
JavaScript
----------
In general take a look at `JSLint <http://www.jslint.com>`_ without the whitespace rules.
There is a shared configuration for `eslint <https://eslint.org/>`_ that you can use to automatically format your Nextcloud apps's JavaScript code. It consists of two parts: a `config package <https://github.com/nextcloud/eslint-config>`_ that contains the formatting preferences and a `plugin <https://github.com/nextcloud/eslint-plugin>`_ to detect deprecated and removed APIs in your code. See their readmes for instructions.
* Use a :file:`js/main.js` or :file:`js/app.js` where your program is started
* Complete every statement with a **;**
* Use **var** to limit variable to local scope
* To keep your code local, wrap everything in a self executing function. To access global objects or export things to the global namespace, pass all global objects to the self executing function.
* Use **const** or **let** to limit variable to local scope
* Use JavaScript strict mode
* Use a global namespace object where you bind publicly used functions and objects to

View File

@@ -0,0 +1,89 @@
=========
Debugging
=========
Debug mode
----------
When debug mode is enabled in Nextcloud, a variety of debugging features are enabled - see debugging documentation. Set ``debug`` to ``true`` in :file:`/config/config.php` to enable it:
.. code-block:: php
<?php
$CONFIG = array (
'debug' => true,
... configuration goes here ...
);
Identifying errors
------------------
Nextcloud uses custom error PHP handling that prevents errors being printed to Web server log files or command line output. Instead, errors are generally stored in Nextcloud's own log file, located at: :file:`/data/nextcloud.log`
Debugging variables
-------------------
You should use exceptions if you need to debug variable values manually, and not alternatives like trigger_error() (which may not be logged).
e.g.:
.. code-block:: php
<?php throw new \Exception( "\$user = $user" ); // should be logged in Nextcloud ?>
not:
.. code-block:: php
<?php trigger_error( "\$user = $user" ); // may not be logged anywhere ?>
To disable custom error handling in Nextcloud (and have PHP and your Web server handle errors instead), see Debug mode.
Using a PHP debugger (XDebug)
-----------------------------
Using a debugger connected to PHP allows you to step through code line by line, view variables at each line and even change values while the code is running. The de-facto standard debugger for PHP is XDebug, available as an installable package in many distributions. It just provides the PHP side however, so you will need a frontend to actually control XDebug. When installed, it needs to be enabled in :file:`php.ini`, along with some parameters to enable connections to the debugging interface:
.. code-block:: ini
zend_extension=/usr/lib/php/modules/xdebug.so
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
XDebug will now (when activated) try to connect to localhost on port 9000, and will communicate over the standard protocol DBGP. This protocol is supported by many debugging interfaces, such as the following popular ones:
- vdebug - Multi-language DBGP debugger client for Vim
- SublimeTextXdebug - XDebug client for Sublime Text
- PHPStorm - in-built DBGP debugger
For further reading, see the XDebug documentation: http://xdebug.org/docs/remote
Once you are familiar with how your debugging client works, you can start debugging with XDebug. To test Nextcloud through the web interface or other HTTP requests, set the ``XDEBUG_SESSION_START`` cookie or POST parameter. Alternatively, there are browser extensions to make this easy:
- The Easiest XDebug (Firefox): https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/
- XDebug Helper (Chrome): https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc
For debugging scripts on the command line, like ``occ`` or unit tests, set the ``XDEBUG_CONFIG`` environment variable.
Debugging JavaScript
--------------------
By default all JavaScript files in Nextcloud are minified (compressed) into a single file without whitespace. To prevent this, see Debug mode.
Debugging HTML and templates
----------------------------
By default Nextcloud caches HTML generated by templates. This may prevent changes to app templates, for example, from being applied on page refresh. To disable caching, see Debug mode.
Using alternative app directories
---------------------------------
It may be useful to have multiple app directories for testing purposes, so you can conveniently switch between different versions of applications. See the configuration file documentation for details.

View File

@@ -0,0 +1,9 @@
===============
Getting started
===============
.. toctree::
:maxdepth: 2
devenv
codingguidelines

View File

@@ -14,12 +14,12 @@ Table of contents
.. toctree::
:maxdepth: 2
general/index
app/index
design/index
android_library/index
client_apis/index
prologue/index
getting_started/index
basics/index
app_development/index
core/index
bugtracker/index
commun/index
api
digging_deeper/index
app_publishing_maintenance/index
design/index
client_apis/index

View File

@@ -7,7 +7,6 @@ Bugtracker
:hidden:
codereviews
kanban
triaging
Thank you for helping Nextcloud by reporting bugs. Before submitting an issue, please read

View File

@@ -1,5 +1,5 @@
=========================
Community code of conduct
=========================
===============
Code of conduct
===============
We want the Nextcloud community to be a fun and productive environment for everyone. For that reason, we ask all contributors and participants to familiarize themselves with our `Code of Conduct <https://nextcloud.com/code-of-conduct>`_.

View File

@@ -0,0 +1,13 @@
========
Prologue
========
.. toctree::
:maxdepth: 2
code-of-conduct
help_communication
bugtracker/index
development_process
security
performance