diff options
| author | 2019-12-03 22:37:40 +0100 | |
|---|---|---|
| committer | 2019-12-03 22:37:40 +0100 | |
| commit | 705318aa39a605a4d869db588f6cffb12019a611 (patch) | |
| tree | 36383dfee24999f9928957621b655e67b20714b7 /docs/en/developers | |
| parent | 0de7e84380dff5222e6728aacbbb42abaac51dd9 (diff) | |
Translate docs with po4a (#2590)
* [i18n] Add docs po4a script
* Add proof of concept
* Add a few more translations
* Hush ShellCheck and shfmt
* Make that list po4a-friendly
* drat, this document could've probably been auto-generated
* Definitive proof that it's translated from French ;-)
* Add some brand spanking new French translation
* More translation
* Mostly finish that config page
* Fix up FAQ
* More contributing
* Dev first steps
* Let's ignore that admin stuff at the very least for now
* Translate release new version, make French the source first and copy all translations
Then replace French with English in the source.
Much quicker than any alternative route.
* And add the English translation
* Minor stylistic leftover from French
* Most of first steps
* Forgot the extensions
* Use po4a 0.56 to get rid of way too many newlines
* Fix up those newlines
* No point linking to Firefox integration anymore from the new user guide
* Start on main view
* A bunch of main view stuff
* More main view
* And some subscriptions before going to bed
* First steps for devs
* More dev first steps
* Incomplete French → English dev/GH translation
Because I need to ask about that mailing list thing
* Fix typo in docs/en/developers/02_Github.md
* Translate & complete devs/github to English
* Fix up most of extensions
* Is that supposed to be a non-breaking space? Let's see
* Match up some users/mobile access
* More users/mobile access
* Add fresh French translation to Fever API
* Fix typo
* Match frontend todo thingies
* Fix a typo
* Some extensions strings
* Remove Fx subscription service from the docs
Cf. https://github.com/FreshRSS/FreshRSS/pull/2606
* Add translation for https://github.com/FreshRSS/FreshRSS/pull/2643
* fix typo as per https://github.com/FreshRSS/FreshRSS/pull/2643#discussion_r345433009
* Add some more French translations
* Update French translation as per @aledeg comment https://github.com/FreshRSS/FreshRSS/pull/2590#discussion_r345465909
* Translate some of the meaningless stuff
* Translate the rest of contributing.md to French
* Fix conflicts
* Translate Docker first steps to French
* Update with change from #2665
* Add @aledeg corrections
* Overlooked a couple @aledeg corrections thanks to GitHub autohide
* Latest @aledeg suggestions
Diffstat (limited to 'docs/en/developers')
| -rw-r--r-- | docs/en/developers/01_First_steps.md | 52 | ||||
| -rw-r--r-- | docs/en/developers/02_Github.md | 118 | ||||
| -rw-r--r-- | docs/en/developers/03_Backend/05_Extensions.md | 108 | ||||
| -rw-r--r-- | docs/en/developers/05_Release_new_version.md | 112 |
4 files changed, 306 insertions, 84 deletions
diff --git a/docs/en/developers/01_First_steps.md b/docs/en/developers/01_First_steps.md index 28c249be4..6c6177aec 100644 --- a/docs/en/developers/01_First_steps.md +++ b/docs/en/developers/01_First_steps.md @@ -45,7 +45,7 @@ $ TAG=dev-arm make start You can find the full list of available tags [on the Docker hub](https://hub.docker.com/r/freshrss/freshrss/tags). -You might want to rebuild the Docker image locally. You can do it with: +If you want to build the Docker image yourself, you can use the following command: ```console $ make build @@ -65,18 +65,18 @@ If you want to create your own FreshRSS extension, take a look at the [extension # Coding style -If you want to contribute to the source code, it is important to follow the project coding style. The actual code does not follow it throughout the project, but every time we have an opportunity, we should fix it. +If you want to contribute to the source code, it's important to follow the project's coding style. The actual code doesn't always follow it throughout the project, but we should fix it every time an opportunity presents itself. -Contributions which do not follow the coding style will be rejected as long as the coding style is not fixed. +Contributions which don't follow the coding style will be rejected as long as the coding style is not fixed. -## Spaces, tabs and white spaces +## Spaces, tabs and other whitespace characters -### Indent -Code indent must use tabs. +### Indentation +Code indentation must use tabs. ### Alignment -Once the code is indented, it might be useful to align it to ease the reading. In that case, use spaces. +Once the code has been correctly indented, it might be useful to align it for ease of reading. In that case, please use spaces. ```php $result = a_function_with_a_really_long_name($param1, $param2, @@ -85,9 +85,9 @@ $result = a_function_with_a_really_long_name($param1, $param2, ### End of line -The end of line character must be a line feed (LF) which is a default end of line on *NIX systems. This character must not follow other white spaces. +The newline character must be a line feed (LF), which is the default line ending on *NIX systems. This character must not follow other white space. -It is possible to verify if there is white spaces before the end of line, with the following Git command: +You can verify if there is any unintended white space at the end of line with the following Git command: ```bash # command to check files before adding them in the Git index @@ -100,13 +100,13 @@ git diff --check --cached Every file must end by an empty line. -### With commas, dots and semi-columns +### Commas, dots and semi-columns -There is no space before those characters but there is one after. +There should no space before those characters, but there should be one after. -### With operators +### Operators -There is a space before and after every operator. +There should be a space before and after every operator. ```php if ($a == 10) { @@ -116,9 +116,9 @@ if ($a == 10) { echo $a ? 1 : 0; ``` -### With brackets +### Parentheses -There is no spaces in the brackets. There is no space before the opening bracket except if it is after a keyword. There is no space after the closing bracket except if it is followed by a curly bracket. +There should be no spaces in between brackets. There should be no spaces before the opening bracket, except if it's after a keyword. There shouldn't be any spaces after the closing bracket, except if it's followed by a curly bracket. ```php if ($a == 10) { @@ -132,7 +132,7 @@ if ((int)$a == 10) { ### With chained functions -It happens most of the time in Javascript files. When there is chained functions, closures and callback functions, it is hard to understand the code if not properly formatted. In those cases, we add a new indent level for the complete instruction and reset the indent for a new instruction on the same level. +It happens most of the time in Javascript files. When there are chained functions with closures and callback functions, it's hard to understand the code if not properly formatted. In those cases, we add a new indent level for the complete instruction and reset the indent for a new instruction on the same level. ```javascript // First instruction @@ -151,9 +151,9 @@ shortcut.add("shift+" + shortcuts.mark_read, function () { ## Line length -Lines should be shorter than 80 characters. However, in some case, it is possible to extend that limit to 100 characters. +Lines should strive to be shorter than 80 characters. However, this limit may be extended to 100 characters when strictly necessary. -With functions, parameters can be declared on different lines. +With functions, parameters can be declared on multiple lines. ```php function my_function($param_1, $param_2, @@ -164,11 +164,11 @@ function my_function($param_1, $param_2, ## Naming -All the code elements (functions, classes, methods and variables) must describe their usage in concise way. +All code elements (functions, classes, methods and variables) must describe their usage succinctly. ### Functions and variables -They must follow the "snake case" convention. +Functions and variables must follow the "snake case" naming convention. ```php // a function @@ -181,7 +181,7 @@ $variable_name; ### Methods -They must follow the "lower camel case" convention. +Methods must follow the "lower camel case" naming convention. ```php private function methodName() { @@ -191,7 +191,7 @@ private function methodName() { ### Classes -They must follow the "upper camel case" convention. +Classes must follow the "upper camel case" naming convention. ```php abstract class ClassName {} @@ -199,16 +199,16 @@ abstract class ClassName {} ## Encoding -Files must be encoded with UTF-8 character set. +Files must be encoded with the UTF-8 character set. ## PHP compatibility -Ensure that your code is working with a PHP version as old as what FreshRSS officially supports. +Please ensure that your code works with the oldest PHP version officially supported by FreshRSS. ## Miscellaneous ### Operators -They must be at the end of the line if a condition runs on more than one line. +Operators must be at the end of the line if a condition is split over more than one line. ```php if ($a == 10 || @@ -223,7 +223,7 @@ If the file contains only PHP code, the PHP closing tag must be omitted. ### Arrays -If an array declaration runs on more than one line, each element must be followed by a comma even the last one. +If an array declaration runs on more than one line, each element must be followed by a comma, including the last one. ```php $variable = [ diff --git a/docs/en/developers/02_Github.md b/docs/en/developers/02_Github.md index c16a6d040..a1677d2af 100644 --- a/docs/en/developers/02_Github.md +++ b/docs/en/developers/02_Github.md @@ -1,11 +1,123 @@ # Reporting a bug or a suggestion -**TODO** +Despite the care given to FreshRSS, it's still possible that bugs occur. The project is young and development is dynamic, so it can be corrected quickly. You might also have a feature in mind that doesn't yet exist. Regardless whether your idea seems silly, far-fetched, useless or too specific, please don't hesitate to propose it to us! "Ideas in the air" often find an attentive ear. It's new external perspectives that make the project evolve the most. + +If you're convinced that you should be heard, here's how you can go about it. + +## On GitHub + +GitHub is the ideal platform to submit your requests. It allows us to discuss a problem or suggestion with others and it often generates new ideas. Let's not neglect this "social" aspect! + + 1. [Go to the bug ticket manager](https://github.com/FreshRSS/FreshRSS/issues) + 2. Start by checking if a similar request hasn't already been made. If so, please feel free to add your voice to the request. + 3. If your request is new, [open a new bug ticket](https://github.com/FreshRSS/FreshRSS/issues/new) + 4. Finally, write your request. If you're fluent in English, it's the preferred language because it allows for discussion with the largest number of people. + 5. Please follow the tips below to make it easier to let your ticket be heard. + +## Informal + +Not everyone likes or uses GitHub for a variety of legitimate reasons. That is why you can also contact us in a more informal way. + +* On [our Mattermost chat](https://framateam.org/signup_user_complete/?id=e2680d3e3128b9fac8fdb3003b0024ee) +* On [the mailing lists](https://freshrss.org/announce-of-the-mailing-lists.html) +* At events / meetings around Free Software +* Over a beer in a bar +* Etc. + +## Tips + +Here are some tips to help you present your bug report or suggestion: + + +* **Pay attention to spelling**. Even if it's not always easy, try your best! +* **Give an explicit title to your request**, even if it's a bit long. This not only helps us understand your request, but also to find your ticket later. +* **One request = one ticket.** You may have lots of ideas while being afraid to spam the bug manager: it doesn't matter. It's better to have a few too many tickets than too many requests in one. We'll close and consolidate requests when possible. +* If you report a bug, think about **providing us with the FreshRSS logs** (accessible in the FreshRSS `data/log/` folder) and the **PHP logs** (the location may vary by distribution, but consider searching in `/var/log/httpd` or `/var/log/apache`). +* If you can't find the log files, specify it in your ticket so we know you've already searched. +* Not all bugs require logs, but if you have any doubts, it is better to provide them to us. Logs are important and very useful for debugging! +* The logs may reveal confidential information, so **be careful not to disclose anything sensitive.** + +In addition, when facing a bug, you're encouraged to follow this message format (from the [Sam & Max website](http://sametmax.com/template-de-demande-daide-en-informatique/): + +### What's my goal? + +Give the general context of what you were trying to do. + +### What have I been trying to do? + +Explain step by step what you have done so that we can reproduce the bug. + +### What results have I achieved? + +The bug: what you see that shouldn't have happened. Here you can provide the logs. + +### What was the expected result? + +So that we understand what you consider to be the problem. + +### What are my circumstances? + +Remember to give the following information if you know it: + + 1. Which browser? Which version? + 2. Which server: Apache, Nginx? Which version? + 3. Which version of PHP? + 4. Which database: SQLite, MySQL, MariaDB, PostgreSQL? Which version? + 5. Which distribution runs on the server? And... which version? # Branching -**TODO** +## Basic +If you are new to Git, here are some of the resources you might find useful: + +* [GitHub's blog post](https://github.com/blog/120-new-to-git) +* <http://try.github.com/> +* <http://sixrevisions.com/resources/git-tutorials-beginners/> +* <http://rogerdudler.github.io/git-guide/> + +## Getting the latest code from the FreshRSS repository +First you need to add the official repo to your remote repo list: +```bash +git remote add upstream git@github.com:FreshRSS/FreshRSS.git +``` + +You can verify the remote repo is successfully added by using: +```bash +git remote -v show +``` + +Now you can pull the latest development code: +```bash +git checkout dev +git pull upstream dev +``` + +## Starting a new development branch +```bash +git checkout -b my-development-branch +``` # Sending a patch -**TODO** +```bash +# Add the changed file, here actualize_script.php +git add app/actualize_script.php +# Commit the change and write a proper commit message +git commit +# Double check all looks well +git show +# Push it to your fork +git push +``` + +Now you can create a PR based on your branch. Please make sure to file it against the `dev` branch! + +## How to write a commit message + +A commit message should succintly describe the changes on the first line. For example: + +> Fix broken icon + +If necessary, this can be followed by a blank line and a longer explanation. + +For further tips, see [here](https://chris.beams.io/posts/git-commit/). diff --git a/docs/en/developers/03_Backend/05_Extensions.md b/docs/en/developers/03_Backend/05_Extensions.md index 4610e4b90..3977faae6 100644 --- a/docs/en/developers/03_Backend/05_Extensions.md +++ b/docs/en/developers/03_Backend/05_Extensions.md @@ -2,9 +2,9 @@ ## About FreshRSS -FreshRSS is an RSS / Atom feeds aggregator written in PHP since October 2012. The official site is located at [freshrss.org](https://freshrss.org) and its repository is hosted by Github: [github.com/FreshRSS/FreshRSS](https://github.com/FreshRSS/FreshRSS). +FreshRSS is an RSS / Atom feed aggregator written in PHP dating back to October 2012. The official site is located at [freshrss.org](https://freshrss.org) and the official repository is hosted on Github: [github.com/FreshRSS/FreshRSS](https://github.com/FreshRSS/FreshRSS). -## Problem to solve +## The problem FreshRSS is limited in its technical possibilities by various factors: @@ -18,7 +18,7 @@ Another solution consists of an extension system. By allowing users to write the 1. Reducing the amount of source code a new contributor has to take in 2. Unofficial integration of novelties -3. No necessity of forking or main developer approvement. +3. No forking or main developer approval required. Note: it is quite conceivable that the functionalities of an extension can later be officially integrated into the FreshRSS code. Extensions make it easy to propose a proof of concept. @@ -30,10 +30,10 @@ This data sheet should refer to the official FreshRSS and Minz documentation (th ### MVC Architecture -Minz relies on and imposes an MVC architecture for projects using it. This architecture consists of three main components: +Minz relies on and imposes an MVC architecture on projects using it. This architecture consists of three main components: * The model: this is the base object that we will manipulate. In FreshRSS, categories, flows and articles are templates. The part of the code that makes it possible to manipulate them in a database is also part of the model but is separated from the base model: we speak of DAO (for "Data Access Object"). The templates are stored in a `Models` folder. -* The view: this is what the user sees. The view is therefore simply HTML code mixed with PHP to display dynamic information. The views are stored in an `views` folder. +* The view: this is what the user sees. The view is therefore simply HTML code mixed with PHP to display dynamic information. The views are stored in a `views` folder. * The controller: this is what makes it possible to link models and views. Typically, a controller will load templates from the database (like a list of items) to "pass" them to a view for display. Controllers are stored in a `Controllers` directory. ### Routing @@ -64,7 +64,7 @@ When loading the address http://exemple.com?c=hello&a=world, the `world` action Note: if `c` or `a` is not specified, the default value for each of these variables is `index`. So the address http://exemple.com?c=hello will execute the `index` action of the `hello` controller. -Later, the `hello/world` convention will be used to refer to a controller/action pair. +From now on, the `hello/world` naming convention will be used to refer to a controller/action pair. ### Views @@ -123,7 +123,7 @@ To take full advantage of the Minz routing system, it is strongly discouraged to </p> ``` -Should it be decided one day to use a "url rewriting" system to have addresses in a http://exemple.com/controller/action format, all previous addresses would become ineffective! +If one day it was decided to use a "url rewriting" system to have addresses in a http://exemple.com/controller/action format, all previous addresses would become ineffective! So use the `Minz_Url` class and its `display()` method instead. `Minz_Url::display()` takes an array of the following form as its argument: @@ -144,7 +144,7 @@ echo Minz_Url::display($url_array); ?> ``` -Since this can become a bit tedious to use in the long run, especially in views, it is preferable to use the `_url()' shortcut: +Since this can become a bit tedious to use in the long run, especially in views, it is preferable to use the `_url()` shortcut: ```php <?php @@ -192,8 +192,8 @@ $url_array = [ 'c' => 'hello', 'a' => 'world', ]; -$feedback_good = 'Tout s\'est bien passé !'; -$feedback_bad = 'Oups, quelque chose n\'a pas marché.'; +$feedback_good = 'All went well!'; +$feedback_bad = 'Oops, something went wrong.'; Minz_Request::good($feedback_good, $url_array); @@ -210,17 +210,17 @@ It is common (and that's an understatement) to want to show some text to the use The solution is to use the `Minz_Translate` class, which allows dynamic translation of FreshRSS (or any Minz-based application). Before using this module, it is necessary to know where to find the strings to be translated. Each language has its own subdirectory in a parent directory named `i18n`. For example, English language files are located in `i18n/fr/`. There are seven different files: -- `admin.php` for anything related to FreshRSS administration -- `conf.php` for configuration -- `feedback.php` contains translations of feedback messages -- `gen.php` stores what is global to FreshRSS (gen for "general") -- `index.php` for the main page that lists feeds and the About page -- `install.php` contains strings related FreshRSS installation -- `sub.php` for subscription management (sub for "subscription") +* `admin.php` for anything related to FreshRSS administration +* `conf.php` for configuration +* `feedback.php` contains translations of feedback messages +* `gen.php` stores what is global to FreshRSS (gen for "general") +* `index.php` for the main page that lists feeds and the About page +* `install.php` contains strings related FreshRSS installation +* `sub.php` for subscription management (sub for "subscription") This organization makes it possible to avoid a single huge translation file. -The translation files are quite simple: it is only a matter of returning a PHP table containing the translations. Extract from `app/i18n/en/gen.php`: +The translation files are quite simple: it's only a matter of returning a PHP table containing the translations. As an example, here's an extract from `app/i18n/fr/gen.php`: ```php <?php @@ -263,7 +263,7 @@ There is a small special case that sometimes makes life easier: the `_` identifi Here we are! We've talked about the most useful features of Minz and how to run FreshRSS correctly and it's about time to address the extensions themselves. -An extension allows you to add functionality easily to FreshRSS without having to touch the core of the project directly. +An extension allows you to easily add functionality to FreshRSS without having to touch the core of the project directly. ### Basic files and folders @@ -273,8 +273,8 @@ The convention requires that the main directory name be preceded by an "x" to in The main directory of an extension must contain at least two **mandatory** files: -- A `metadata.json` file that contains a description of the extension. This file is written in JSON. -- An `extension.php` file containing the entry point of the extension (which is a class that inherits Minz_Extension). +* A `metadata.json` file that contains a description of the extension. This file is written in JSON. +* An `extension.php` file containing the entry point of the extension (which is a class that inherits Minz_Extension). Please note that there is a not a required link between the directory name of the extension and the name of the class inside `extension.php`, but you should follow our best practice: @@ -292,11 +292,11 @@ There is an example HelloWorld extension that you can download from [our GitHub You may also need additional files or subdirectories depending on your needs: -- `configure.phtml` is the file containing the form to parameterize your extension -- A `static/` directory containing CSS and JavaScript files that you will need for your extension (note that if you need to write a lot of CSS it may be more interesting to write a complete theme) -- A `Controllers` directory containing additional controllers -- An `i18n` directory containing additional translations -- `layout` and` views` directories to define new views or to overwrite the current views +* `configure.phtml` is the file containing the form to parameterize your extension +* A `static/` directory containing CSS and JavaScript files that you will need for your extension (note that if you need to write a lot of CSS it may be more interesting to write a complete theme) +* A `Controllers` directory containing additional controllers +* An `i18n` directory containing additional translations +* `layout` and` views` directories to define new views or to overwrite the current views In addition, it is good to have a `LICENSE` file indicating the license under which your extension is distributed and a` README` file giving a detailed description of it. @@ -304,16 +304,16 @@ In addition, it is good to have a `LICENSE` file indicating the license under wh The `metadata.json` file defines your extension through a number of important elements. It must contain a valid JSON array containing the following entries: -- `name` : the name of your extension -- `author` : your name, your e-mail address ... but there is no specific format to adopt -- `description` : a description of your extension -- `version` : the current version number of the extension -- `entrypoint` : Indicates the entry point of your extension. It must match the name of the class contained in the file `extension.php` without the suffix` Extension` (so if the entry point is `HelloWorld`, your class will be called` HelloWorldExtension`) -- `type` : Defines the type of your extension. There are two types: `system` and` user`. We will study this difference right after. +* `name`: the name of your extension +* `author`: your name, your e-mail address ... but there is no specific format to adopt +* `description`: a description of your extension +* `version`: the current version number of the extension +* `entrypoint`: Indicates the entry point of your extension. It must match the name of the class contained in the file `extension.php` without the suffix` Extension` (so if the entry point is `HelloWorld`, your class will be called` HelloWorldExtension`) +* `type`: Defines the type of your extension. There are two types: `system` and` user`. We will study this difference right after. Only the `name` and` entrypoint` fields are required. -### Choose between « system » or « user » +### Choosing between `system` and `user` A __user__ extension can be enabled by some users and not by others (typically for user preferences). @@ -327,24 +327,24 @@ In addition, this class must be inherited from the `Minz_Extension` class to ben Your class will benefit from four methods to redefine: -- `install()` is called when a user clicks the button to activate your extension. It allows, for example, to update the database of a user in order to make it compatible with the extension. It returns `true` if everything went well or, if not, a string explaining the problem. -- `uninstall()` is called when a user clicks the button to disable your extension. This will allow you to undo the database changes you potentially made in `install ()`. It returns `true` if everything went well or, if not, a string explaining the problem. -- `init()` is called for every page load *if the extension is enabled*. It will therefore initialize the behavior of the extension. This is the most important method. -- `handleConfigureAction()` is called when a user loads the extension management panel. Specifically, it is called when the `?c=extension&a=configured&e=name-of-your-extension` URL is loaded. You should also write here the behavior you want when validating the form in your `configure.phtml` file. +* `install()` is called when a user clicks the button to activate your extension. It allows, for example, to update the database of a user in order to make it compatible with the extension. It returns `true` if everything went well or, if not, a string explaining the problem. +* `uninstall()` is called when a user clicks the button to disable your extension. This will allow you to undo the database changes you potentially made in `install ()`. It returns `true` if everything went well or, if not, a string explaining the problem. +* `init()` is called for every page load *if the extension is enabled*. It will therefore initialize the behavior of the extension. This is the most important method. +* `handleConfigureAction()` is called when a user loads the extension management panel. Specifically, it is called when the `?c=extension&a=configured&e=name-of-your-extension` URL is loaded. You should also write here the behavior you want when validating the form in your `configure.phtml` file. In addition, you will have a number of methods directly inherited from `Minz_Extension` that you should not redefine: -- The "getters" first: most are explicit enough not to detail them here - `getName()`, `getEntrypoint()`, `getPath()` (allows you to retrieve the path to your extension), `getAuthor()`, `getDescription()`, `getVersion()`, `getType()`. -- `getFileUrl($filename, $type)` will return the URL to a file in the `static` directory. The first parameter is the name of the file (without `static /`), the second is the type of file to be used (`css` or` js`). -- `registerController($base_name)` will tell Minz to take into account the given controller in the routing system. The controller must be located in your `Controllers` directory, the name of the file must be` <base_name>Controller.php` and the name of the `FreshExtension_<base_name>_Controller` class. +* The "getters" first: most are explicit enough not to detail them here - `getName()`, `getEntrypoint()`, `getPath()` (allows you to retrieve the path to your extension), `getAuthor()`, `getDescription()`, `getVersion()`, `getType()`. +* `getFileUrl($filename, $type)` will return the URL to a file in the `static` directory. The first parameter is the name of the file (without `static /`), the second is the type of file to be used (`css` or` js`). +* `registerController($base_name)` will tell Minz to take into account the given controller in the routing system. The controller must be located in your `Controllers` directory, the name of the file must be` <base_name>Controller.php` and the name of the `FreshExtension_<base_name>_Controller` class. **TODO** -- `registerViews()` -- `registerTranslates()` -- `registerHook($hook_name, $hook_function)` +* `registerViews()` +* `registerTranslates()` +* `registerHook($hook_name, $hook_function)` -### The « hooks » system +### The "hooks" system You can register at the FreshRSS event system in an extensions `init()` method, to manipulate data when some of the core functions are executed. @@ -363,16 +363,16 @@ class HelloWorldExtension extends Minz_Extension The following events are available: -- `entry_before_display` (`function($entry) -> Entry | null`): will be executed every time an entry is rendered. The entry itself (instance of FreshRSS\_Entry) will be passed as parameter. -- `entry_before_insert` (`function($entry) -> Entry | null`): will be executed when a feed is refreshed and new entries will be imported into the database. The new entry (instance of FreshRSS\_Entry) will be passed as parameter. -- `feed_before_insert` (`function($feed) -> Feed | null`): will be executed when a new feed is imported into the database. The new feed (instance of FreshRSS\_Feed) will be passed as parameter. -- `freshrss_init` (`function() -> none`): will be executed at the end of the initialization of FreshRSS, useful to initialize components or to do additional access checks -- `menu_admin_entry` (`function() -> string`): add an entry at the end of the "Administration" menu, the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) -- `menu_configuration_entry` (`function() -> string`): add an entry at the end of the "Configuration" menu, the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) -- `menu_other_entry` (`function() -> string`): add an entry at the end of the header dropdown menu (i.e. after the "About" entry), the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) -- `nav_reading_modes` (`function($reading_modes) -> array | null`): **TODO** add documentation -- `post_update` (`function(none) -> none`): **TODO** add documentation -- `simplepie_before_init` (`function($simplePie, $feed) -> none`): **TODO** add documentation +* `entry_before_display` (`function($entry) -> Entry | null`): will be executed every time an entry is rendered. The entry itself (instance of FreshRSS\_Entry) will be passed as parameter. +* `entry_before_insert` (`function($entry) -> Entry | null`): will be executed when a feed is refreshed and new entries will be imported into the database. The new entry (instance of FreshRSS\_Entry) will be passed as parameter. +* `feed_before_insert` (`function($feed) -> Feed | null`): will be executed when a new feed is imported into the database. The new feed (instance of FreshRSS\_Feed) will be passed as parameter. +* `freshrss_init` (`function() -> none`): will be executed at the end of the initialization of FreshRSS, useful to initialize components or to do additional access checks +* `menu_admin_entry` (`function() -> string`): add an entry at the end of the "Administration" menu, the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) +* `menu_configuration_entry` (`function() -> string`): add an entry at the end of the "Configuration" menu, the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) +* `menu_other_entry` (`function() -> string`): add an entry at the end of the header dropdown menu (i.e. after the "About" entry), the returned string must be valid HTML (e.g. `<li class="item active"><a href="url">New entry</a></li>`) +* `nav_reading_modes` (`function($reading_modes) -> array | null`): **TODO** add documentation +* `post_update` (`function(none) -> none`): **TODO** add documentation +* `simplepie_before_init` (`function($simplePie, $feed) -> none`): **TODO** add documentation ### Writing your own configure.phtml diff --git a/docs/en/developers/05_Release_new_version.md b/docs/en/developers/05_Release_new_version.md index e1a23c8ba..d8e3026f3 100644 --- a/docs/en/developers/05_Release_new_version.md +++ b/docs/en/developers/05_Release_new_version.md @@ -1 +1,111 @@ -**TODO** +# Preparing the release + +In order to get as much feedback as possible before a release, it's preferable to announce it on GitHub by creating a dedicated ticket ([see examples] (https://github.com/FreshRSS/FreshRSS/search?utf8=%E2%9C%93&q=Call+for+testing&type=Issues)). This should be done **at least one week in advance**. + +It's also recommended to make the announcement on mailing@freshrss.org. + +# Check the dev status + +Before releasing a new version of FreshRSS, you must ensure that the code is stable and free of major bugs. Ideally, our tests should be automated and executed before any publication. + +You must also **make sure that the CHANGELOG file is up to date** in the dev branch with the updates of the version(s) to be released. + +# Git process + +```bash +$ git checkout master +$ git pull +$ git merge --ff dev +$ vim constants.php +# Update version number x.y.y.z of FRESHRSS_VERSION +$ git commit -a +Version x.y.z +$ git tag -a x.y.z +Version x.y.z +$ git push && git push --tags +``` + +# Updating `update.freshrss.org` + +It's important to update update.freshrss.org since this is the default service for automatic FreshRSS updates. + +The repository managing the code is located on GitHub: [FreshRSS/update.freshrss.org] (https://github.com/FreshRSS/update.freshrss.org/). + +## Writing the update script + +The scripts are located in the `./scripts/` directory and must take the form `update_to_x.y.z.z.php`. This directory also contains `update_to_dev.php` intended for updates of the dev branch (this script must not include code specific to a particular version!) and `update_util.php`, which contains a list of functions useful for all scripts. + +In order to write a new script, it's better to copy/paste the last version or to start from `update_to_dev.php`. The first thing to do is to define the URL from which the FreshRSS package will be downloaded (`PACKAGE_URL`). The URL is in the form of `https://codeload.github.com/FreshRSS/FreshRSS/zip/x.y.z`. + +There are then 5 functions that have to be executed: + +* `apply_update()` takes care of saving the directory containing the data, checking its structure, downloading the FreshRSS package, deploying it and cleaning it all up. This function is pre-filled but adjustments can be made if necessary (e.g., reorganization of the `./data` structure). It returns `true` if no problem has occurred or a string indicating a problem; +* `need_info_update()` returns `true` if the user must intervene during the update or `false` if not; +* `ask_info_update()` displays a form to the user if `need_info_update()` has returned `true`; +* `save_info_update()` is responsible for saving the information filled out by the user (from the `ask_info_update()` form); +* `do_post_update()` is executed at the end of the update and takes into account the code of the new version (e.g., if the new version changes the `Minz_Configuration` object, you will benefit from these improvements). + +## Updating the versions file + +Once the script has been written and versioned, it's necessary to update the `./versions.php' file which contains a mapping table indicating which versions are updated to which other versions. + +Here's an example of a `versions.php` file: + +```php +<?php +return array( + // STABLE + '0.8.0' => '1.0.0', + '0.8.1' => '1.0.0', + '1.0.0' => '1.0.1', // doesn't exist (yet) + // DEV + '1.1.2-dev' => 'dev', + '1.1.3-dev' => 'dev', + '1.1.4-dev' => 'dev', +); +``` + +And here's how this table works: + +* on the left you can find the N version, on the right the N+1 version; +* the `x.y.z.z-dev` versions are **all** updated to `dev`; +* stable versions are updated to stable versions; +* it's possible to skip several versions at once, provided that the update scripts support it; +* it's advisable to indicate the correspondence of the current version to its potential future version by specifying that this version does not yet exist. As long as the corresponding script does not exist, nothing will happen. + +It's **very strongly** recommended to keep this file organized according to version numbers by separating stable and dev versions. + +## Deployment + +Before updating update.freshrss.org, it's better to test with dev.update.freshrss.org, which corresponds to pre-production. So update dev.update.freshrss.org and change the `FRESHRSS_UPDATE_WEBSITE` URL of your FreshRSS instance. Start the update and check that it's running correctly. + +When you're satisfied, update update.freshrss.org with the new script, test it again, and then move on. + +# Updating the FreshRSS services + +Two services need to be updated immediately after the update. + +* rss.freshrss.org; +* demo.freshrss.org (public login: `demo` / `demodemo`). + +# Publicly announce the release + +When everything's working, it's time to announce the release to the world! + +* on GitHub by creating[a new release](https://github.com/FreshRSS/FreshRSS/releases/new) +* on the freshrss.org blog, at least for stable versions (write the article on[FreshRSS/freshrss.org](https://github.com/FreshRSS/freshrss.org)) +* on Twitter ([@FreshRSS](https://twitter.com/FreshRSS) account) +* and on mailing@freshrss.org + +# Starting the next development version + +```bash +$ git checkout dev +$ vim constants.php +# Update the FRESHRSS_VERSION +$ vim CHANGELOG.md +# Prepare the changelog for the next version +$ git add CHANGELOG.md && git commit && git push +``` + +Also remember to update update.freshrss.org so that it takes the current development version into account. |
