Various small improvements

This commit is contained in:
Daniel Rudolf 2018-01-21 23:06:38 +01:00
parent b129a4fb12
commit 888190f15a
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538
7 changed files with 22 additions and 13 deletions

7
.gitignore vendored
View file

@ -10,7 +10,12 @@ desktop.ini
.DS_Store
._*
# Composer
# composer
/composer.lock
/composer.phar
/vendor
# phpDocumentor
/.build/phpdoc
/.build/phpdoc.cache
/phpDocumentor.phar

View file

@ -11,9 +11,10 @@
<file>.</file>
<!--
Exclude _build/ and vendor/ dirs as well as minified JavaScript files
Exclude .build/, .github/ and vendor/ dirs as well as minified JavaScript files
-->
<exclude-pattern type="relative">^_build/</exclude-pattern>
<exclude-pattern type="relative">^.build/</exclude-pattern>
<exclude-pattern type="relative">^.github/</exclude-pattern>
<exclude-pattern type="relative">^vendor/</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>

View file

@ -2,10 +2,10 @@
<phpdoc>
<title><![CDATA[Pico API Documentation]]></title>
<parser>
<target>_build/phpdoc.cache</target>
<target>.build/phpdoc.cache</target>
</parser>
<transformer>
<target>_build/phpdoc</target>
<target>.build/phpdoc</target>
</transformer>
<transformations>
<template name="clean"/>
@ -15,8 +15,9 @@
<file>index.php</file>
<file>index.php.dist</file>
<!-- exclude build environment -->
<ignore>_build/*</ignore>
<!-- exclude .build and .github directories -->
<ignore>.build/*</ignore>
<ignore>.github/*</ignore>
<!-- exclude user config -->
<ignore>config/*</ignore>

View file

@ -153,7 +153,7 @@ As soon as development reaches a point where feedback is appreciated, a pull req
Build & Release process
-----------------------
We're using [Travis CI](https://travis-ci.com) to automate the build & release process of Pico. It generates and deploys a [PHP class documentation](http://picocms.org/phpDoc/) (powered by [phpDoc](http://phpdoc.org)) for new releases and on every commit to the `master` branch. Travis also prepares new releases by generating Pico's pre-built release packages, a version badge, code statistics (powered by [cloc](https://github.com/AlDanial/cloc)) and updates our website (the [`picocms.github.io` repo](https://github.com/picocms/picocms.github.io)). Please refer to our [`.travis.yml`](https://github.com/picocms/Pico/blob/master/.travis.yml) and the [`_build` directory](https://github.com/picocms/Pico/tree/master/_build) for details.
We're using [Travis CI](https://travis-ci.com) to automate the build & release process of Pico. It generates and deploys a [PHP class documentation](http://picocms.org/phpDoc/) (powered by [phpDoc](http://phpdoc.org)) for new releases and on every commit to the `master` branch. Travis also prepares new releases by generating Pico's pre-built release packages, a version badge, code statistics (powered by [cloc](https://github.com/AlDanial/cloc)) and updates our website (the [`picocms.github.io` repo](https://github.com/picocms/picocms.github.io)). Please refer to our [`.travis.yml`](https://github.com/picocms/Pico/blob/master/.travis.yml), the [`picocms/ci-tools` repo](https://github.com/picocms/ci-tools) and the [`.build` directory](https://github.com/picocms/Pico/tree/master/.build) for details.
As insinuated above, it is important that each commit to `master` is deployable. Once development of a new Pico release is finished, trigger Pico's build & release process by pushing a new Git tag. This tag should reference a (usually empty) commit on `master`, which message should adhere to the following template:

View file

@ -115,6 +115,8 @@ You want to contribute to Pico? We really appreciate that! You can help make Pic
3. Pico's Core: The supreme discipline is to work on Pico's Core. Your contribution should help *every* Pico user to have a better experience with Pico. If this is the case, fork Pico from https://github.com/picocms/Pico and open a [pull request][PullRequests]. We look forward to your contribution!
By contributing to Pico, you accept and agree to the *Developer Certificate of Origin* for your present and future contributions submitted to Pico. Please refer to the ["Developer Certificate of Origin" section in our `CONTRIBUTING.md`][ContributionGuidelinesDCO].
[Packagist.org]: http://packagist.org/packages/picocms/pico
[LatestRelease]: https://github.com/picocms/Pico/releases/latest
[composer]: https://getcomposer.org/
@ -133,6 +135,7 @@ You want to contribute to Pico? We really appreciate that! You can help make Pic
[IssuesSearch]: https://github.com/picocms/Pico/search?type=Issues
[PullRequests]: https://github.com/picocms/Pico/pulls
[ContributionGuidelines]: https://github.com/picocms/Pico/blob/master/CONTRIBUTING.md
[ContributionGuidelinesDCO]: https://github.com/picocms/Pico/blob/master/CONTRIBUTING.md#developer-certificate-of-origin
[EditInlineDocs]: https://github.com/picocms/Pico/edit/master/content-sample/index.md
[EditUserDocs]: https://github.com/picocms/picocms.github.io/tree/master/_docs
[EditDevDocs]: https://github.com/picocms/picocms.github.io/tree/master/_development

View file

@ -324,7 +324,8 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface
* plugin's API is older than Pico's API. {@see PicoDeprecated} furthermore
* throws a exception when it can't provide compatibility in such cases.
* However, we still have to decide whether this plugin is compatible to
* newer API versions, what defaults to "no" by default.
* newer API versions, what requires some special (version specific)
* precaution and is therefore usually not the case.
*
* @return void
*

View file

@ -1425,7 +1425,7 @@ class Pico
*
* @return string prepared Markdown contents
*/
public function prepareFileContent($rawContent, array $meta)
public function prepareFileContent($rawContent, array $meta = array())
{
// remove meta header
$metaHeaderPattern = "/^(\/(\*)|---)[[:blank:]]*(?:\r)?\n"
@ -1549,9 +1549,7 @@ class Pico
protected function readPages()
{
$contentDir = $this->getConfig('content_dir');
$contentDirLength = strlen($contentDir);
$contentExt = $this->getConfig('content_ext');
$contentExtLength = strlen($contentExt);
$this->pages = array();
$files = $this->getFiles($contentDir, $contentExt, self::SORT_NONE);
@ -1562,7 +1560,7 @@ class Pico
continue;
}
$id = substr($file, $contentDirLength, -$contentExtLength);
$id = substr($file, strlen($contentDir), -strlen($contentExt));
// trigger onSinglePageLoading event
// skip inaccessible pages (e.g. drop "sub.md" if "sub/index.md" exists) by default