aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/md/dev
diff options
context:
space:
mode:
Diffstat (limited to 'doc/md/dev')
-rw-r--r--doc/md/dev/Development.md12
-rw-r--r--doc/md/dev/Plugin-system.md11
2 files changed, 15 insertions, 8 deletions
diff --git a/doc/md/dev/Development.md b/doc/md/dev/Development.md
index 5c085e03..c42e8ffe 100644
--- a/doc/md/dev/Development.md
+++ b/doc/md/dev/Development.md
@@ -6,7 +6,7 @@ Please read [Contributing to Shaarli](https://github.com/shaarli/Shaarli/tree/ma
6 6
7 7
8- [Unit tests](Unit-tests) 8- [Unit tests](Unit-tests)
9- Javascript linting - Shaarli uses [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript). 9- Javascript linting - Shaarli uses [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).
10Run `make eslint` to check JS style. 10Run `make eslint` to check JS style.
11- [GnuPG signature](GnuPG-signature) for tags/releases 11- [GnuPG signature](GnuPG-signature) for tags/releases
12 12
@@ -51,12 +51,12 @@ PHP (managed through [`composer.json`](https://github.com/shaarli/Shaarli/blob/m
51 51
52## Link structure 52## Link structure
53 53
54Every link available through the `LinkDB` object is represented as an array 54Every link available through the `LinkDB` object is represented as an array
55containing the following fields: 55containing the following fields:
56 56
57 * `id` (integer): Unique identifier. 57 * `id` (integer): Unique identifier.
58 * `title` (string): Title of the link. 58 * `title` (string): Title of the link.
59 * `url` (string): URL of the link. Used for displayable links (without redirector, url encoding, etc.). 59 * `url` (string): URL of the link. Used for displayable links (without redirector, url encoding, etc.).
60 Can be absolute or relative for Notes. 60 Can be absolute or relative for Notes.
61 * `real_url` (string): Real destination URL, can be redirected, encoded, etc. 61 * `real_url` (string): Real destination URL, can be redirected, encoded, etc.
62 * `shorturl` (string): Permalink small hash. 62 * `shorturl` (string): Permalink small hash.
@@ -66,7 +66,7 @@ containing the following fields:
66 * `thumbnail` (string|boolean): relative path of the thumbnail cache file, or false if there isn't any. 66 * `thumbnail` (string|boolean): relative path of the thumbnail cache file, or false if there isn't any.
67 * `created` (DateTime): link creation date time. 67 * `created` (DateTime): link creation date time.
68 * `updated` (DateTime): last modification date time. 68 * `updated` (DateTime): last modification date time.
69 69
70Small hashes are used to make a link to an entry in Shaarli. They are unique: the date of the item (eg. `20110923_150523`) is hashed with CRC32, then converted to base64 and some characters are replaced. They are always 6 characters longs and use only `A-Z a-z 0-9 - _` and `@`. 70Small hashes are used to make a link to an entry in Shaarli. They are unique: the date of the item (eg. `20110923_150523`) is hashed with CRC32, then converted to base64 and some characters are replaced. They are always 6 characters longs and use only `A-Z a-z 0-9 - _` and `@`.
71 71
72 72
@@ -163,11 +163,13 @@ See [`.travis.yml`](https://github.com/shaarli/Shaarli/blob/master/.travis.yml).
163 163
164## Static analysis 164## Static analysis
165 165
166Patches should try to stick to the [PHP Standard Recommendations](http://www.php-fig.org/psr/) (PSR), especially: 166Patches should try to stick to the [PHP Standard Recommendations](http://www.php-fig.org/psr/) (PSR), and must follow:
167 167
168- [PSR-1](http://www.php-fig.org/psr/psr-1/) - Basic Coding Standard 168- [PSR-1](http://www.php-fig.org/psr/psr-1/) - Basic Coding Standard
169- [PSR-2](http://www.php-fig.org/psr/psr-2/) - Coding Style Guide 169- [PSR-2](http://www.php-fig.org/psr/psr-2/) - Coding Style Guide
170- [PSR-12](http://www.php-fig.org/psr/psr-12/) - Extended Coding Style Guide
170 171
172These are enforced on pull requests using our Continuous Integration tools.
171 173
172**Work in progress:** Static analysis is currently being discussed here: in [#95 - Fix coding style (static analysis)](https://github.com/shaarli/Shaarli/issues/95), [#130 - Continuous Integration tools & features](https://github.com/shaarli/Shaarli/issues/130) 174**Work in progress:** Static analysis is currently being discussed here: in [#95 - Fix coding style (static analysis)](https://github.com/shaarli/Shaarli/issues/95), [#130 - Continuous Integration tools & features](https://github.com/shaarli/Shaarli/issues/130)
173 175
diff --git a/doc/md/dev/Plugin-system.md b/doc/md/dev/Plugin-system.md
index c29774de..f09fadc2 100644
--- a/doc/md/dev/Plugin-system.md
+++ b/doc/md/dev/Plugin-system.md
@@ -148,11 +148,16 @@ If a file needs to be included in server end, use simple relative path:
148`PluginManager::$PLUGINS_PATH . '/mything/template.html'`. 148`PluginManager::$PLUGINS_PATH . '/mything/template.html'`.
149 149
150If it needs to be included in front end side (e.g. an image), 150If it needs to be included in front end side (e.g. an image),
151the relative path must be prefixed with special data `_BASE_PATH_`: 151the relative path must be prefixed with special data:
152`($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH . '/mything/picture.png`. 152
153 * if it's a link that will need to be processed by Shaarli, use `_BASE_PATH_`:
154 for e.g. `$data['_BASE_PATH_'] . '/admin/tools`.
155 * if you want to include an asset, you need to add the root URL (base path without `/index.php`, for people using Shaarli without URL rewriting), then use `_ROOT_PATH_`:
156 for e.g
157`$['_ROOT_PATH_'] . '/' . PluginManager::$PLUGINS_PATH . '/mything/picture.png`.
153 158
154Note that special placeholders for CSS and JS files (respectively `css_files` and `js_files`) are already prefixed 159Note that special placeholders for CSS and JS files (respectively `css_files` and `js_files`) are already prefixed
155with the base path in template files. 160with the root path in template files.
156 161
157### It's not working! 162### It's not working!
158 163