Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ntd committed Dec 29, 2017
2 parents 641102e + d9bc20c commit 2ac5a63
Show file tree
Hide file tree
Showing 23 changed files with 632 additions and 389 deletions.
10 changes: 7 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/docs export-ignore
/tests export-ignore
/.travis.yml export-ignore
docs/ export-ignore
tests/ export-ignore
*.dist
.editorconfig export-ignore
.gitattributes export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
66 changes: 4 additions & 62 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,10 @@ inherit: true

checks:
php:
verify_property_names: true
verify_argument_usable_as_reference: true
verify_access_scope_valid: true
useless_calls: true
use_statement_alias_conflict: true
variable_existence: true
unused_variables: true
unused_properties: true
unused_parameters: true
unused_methods: true
unreachable_code: true
too_many_arguments: true
sql_injection_vulnerabilities: true
simplify_boolean_return: true
side_effects_or_types: true
security_vulnerabilities: true
return_doc_comments: true
return_doc_comment_if_not_inferrable: true
require_scope_for_properties: true
require_scope_for_methods: true
require_php_tag_first: true
psr2_switch_declaration: true
psr2_class_declaration: true
property_assignments: true
prefer_while_loop_over_for_loop: true
precedence_mistakes: true
precedence_in_conditions: true
phpunit_assertions: true
php5_style_constructor: true
parse_doc_comments: true
parameter_non_unique: true
parameter_doc_comments: true
param_doc_comment_if_not_inferrable: true
optional_parameters_at_the_end: true
one_class_per_file: true
no_unnecessary_if: true
no_trailing_whitespace: true
no_property_on_interface: true
no_non_implemented_abstract_methods: true
no_error_suppression: true
no_duplicate_arguments: true
no_commented_out_code: true
newline_at_end_of_file: true
missing_arguments: true
method_calls_on_non_object: true
instanceof_class_exists: true
foreach_traversable: true
fix_line_ending: true
fix_doc_comments: true
duplication: true
deprecated_code_usage: true
deadlock_detection_in_loops: true
code_rating: true
closure_use_not_conflicting: true
catch_class_exists: true
blank_line_after_namespace_declaration: false
avoid_multiple_statements_on_same_line: true
avoid_duplicate_types: true
avoid_conflicting_incrementers: true
avoid_closing_tag: true
assignment_of_null_return: true
argument_type_checks: true
duplication: true

filter:
paths: [code/*, tests/*]
paths:
- src/*
- tests/*
32 changes: 2 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details

sudo: false

language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0

env:
- DB=MYSQL CORE_RELEASE=3.2

matrix:
include:
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3.1
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3.2
allow_failures:
- php: 7.0

before_script:
- composer self-update || true
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- cd ~/builds/ss
- composer install

script:
- vendor/bin/phpunit autotoc/tests
- composer validate
- composer update
103 changes: 66 additions & 37 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,97 @@ of this ChangeLog is autogenerated by the following command:
git log \
--no-merges \
--date=format:'%Y-%m-%d' \
--pretty=format:'* %cd %H %s' \
--pretty=format:'* %cd %h %s' \
$(git ls-remote -t .|tail -1|cut -f1)..

### 2.0.0 (2017-12-29)

* 2017-12-29 1563696 Use short hashes in docs
* 2017-12-29 d3fb711 Add link to standard code of conduct
* 2017-12-29 4d7cbf6 Update gitattributes
* 2017-12-29 b57e3f1 Improve README
* 2017-12-29 b038d0a Move templates in namespaced directories
* 2017-12-29 ce1f91c Major refactoring for SS4
* 2017-12-21 b231412 Fix Tocifier instantiation call
* 2017-12-21 94378c6 Use the injector for instantiating the Tocifier
* 2017-12-21 a0a809c Add missing namespace to default augment callback
* 2017-12-21 f206387 Fix minor bugs in AutotocExtension
* 2017-12-20 f6bd258 Fix YAML configuration
* 2017-12-20 72daf19 Remove silverstripe recipe from composer
* 2017-12-20 6fd6dc4 Strip project-files-installed from composer.json
* 2017-12-20 7b4096f Restore old package name
* 2017-12-20 3d9ed8c Fix issue highlighted by phpcs
* 2017-12-20 e7bc91a Add support for PHP CodeSniffer
* 2017-12-20 c0349ff Update composer and scrutinizer according to mainline
* 2017-12-20 75aac40 Set minimum-stability to dev
* 2017-12-20 02dba28 Fix path in scrutinizer YAML
* 2017-12-20 9ebe50c Update travis infrastructure for SS4
* 2017-12-20 71ddc55 Fix Travis issue on old supported PHP
* 2017-12-20 2a9feb7 Update codebase for PHP 7
* 2017-12-19 40f8676 Initial porting to SilverStripe 4
* 2017-12-19 09443ea Update copyright in LICENSE.md
* 2017-03-19 30a2a3d Doc fix: the default augmenter is now setId()
* 2016-08-04 5bc2a28 Scrutinizer Auto-Fixes

### 1.2.0 (2016-08-03)

* 2016-08-04 e8eaecdef76f7af315ab0678508133db1a6ac1d6 Change default anchor method to setId
* 2016-08-04 e8eaecd Change default anchor method to setId

### 1.1.3 (2016-08-03)

* 2016-07-22 1ec20086c0e0b1eae290d3fb801f4e45712c71ed Allow customization of augmenting method
* 2016-07-22 1ec2008 Allow customization of augmenting method

### 1.1.2 (2016-05-26)

* 2016-05-26 cd1e45c82ceef1ace0e781b95e3102ca06b12cab Add CHANGELOG.md
* 2016-05-26 1bf8d5c77870d4530fc90517052c3525facc5dc7 Exclude docs from gitattributes
* 2016-05-26 d164ca96bce0068e9e0eb933fa6eaeea5a6bdf74 Correct documentation link
* 2016-05-26 2ecbf535ff5621a9b8c3252c44c1b505fc042c8b Reorganize documentation
* 2016-05-06 2bc6fca0b3dc03604d7e81fe5ef15714a3d31442 Trying to improve Scrutinizr ranking
* 2016-05-26 cd1e45c Add CHANGELOG.md
* 2016-05-26 1bf8d5c Exclude docs from gitattributes
* 2016-05-26 d164ca9 Correct documentation link
* 2016-05-26 2ecbf53 Reorganize documentation
* 2016-05-06 2bc6fca Trying to improve Scrutinizr ranking

### 1.1.1 (2016-05-06)

* 2016-05-06 2afe181dac53417957eabcb3f7b87e7be4420a0d Remove some redundancy from XPath expression
* 2016-05-06 4ba8f02c2d8577ded81bbfe040195b3be7ad3c71 Add tests for data-hide-from-toc
* 2016-05-06 b39695adc0a1bd547d5c0423ddd64dd54bbf10a2 Avoid bogus \n when augmenting the HTML
* 2016-05-06 e296a3dbe580730d1c21076e9c55e43822e2d3bb Added standard Scrutinizer config
* 2016-05-06 1d2c7d2b347dd1360f8fa0bd5ff28785641c457c Allow easy testing from CLI
* 2016-05-06 1bd030b1ce5c1824c858107c09de273fcecc54e5 Added minimum PHP version requirement.
* 2016-05-03 a71b0b9bf77370c8f514332430dd75a3f0b0fbde Added `data-hide-from-toc` attribute to ToC query.
* 2016-02-09 b6d81addeca6ffc35c7c802573fd3b49b6c0c70c Update copyright for 2016
* 2016-02-08 28d52d41bc978c434011278008831ad72bdcdec4 Add Scrutinizer badge to README.md
* 2016-01-16 0ca6cee029dff02784f8398afd045b64ee5b30db Added standard .gitattributes file
* 2016-05-06 2afe181 Remove some redundancy from XPath expression
* 2016-05-06 4ba8f02 Add tests for data-hide-from-toc
* 2016-05-06 b39695a Avoid bogus \n when augmenting the HTML
* 2016-05-06 e296a3d Added standard Scrutinizer config
* 2016-05-06 1d2c7d2 Allow easy testing from CLI
* 2016-05-06 1bd030b Added minimum PHP version requirement.
* 2016-05-03 a71b0b9 Added `data-hide-from-toc` attribute to ToC query.
* 2016-02-09 b6d81ad Update copyright for 2016
* 2016-02-08 28d52d4 Add Scrutinizer badge to README.md
* 2016-01-16 0ca6cee Added standard .gitattributes file

### 1.1.0 (2016-01-09)

* 2016-01-09 341eab334463753b73885fb883724ca8bc395dac Add TravisCI badge in README.md
* 2016-01-09 2218f7f071d645aec0a2dabb225f4a5cd0303986 Correct README.md typo
* 2016-01-09 f48cfcaf3d9686c71a5069935e10c9c057e064d7 Add Packagist stable version badge to README.md
* 2016-01-09 3c97621145fe6f4eda973d8a9022643b908f8c0e Improve README.md
* 2016-01-09 824fe2f791eedd652280fb94d5de43f4707eff5c Improve tests interoperability
* 2016-01-08 91f231c8ccc91282f902e30b96803e9d045168af Tocify custom field instead of Content
* 2016-01-08 e986d312841d0903596d7f376861fa661ed53c6d Empty lines after class are not needed in PSR-2 mode
* 2016-01-08 ad7896938d0810116db00648454e7de1b00b00f7 Enhance composer.json
* 2016-01-08 8ddd4459b69519e4f824658e58bfaa417d5d7537 Use YAML for configuration
* 2016-01-01 d5a78a5b094db5d27f4fbadc086c27ba8d9b8f54 Converted to PSR-2
* 2016-01-01 f06546b9387424d32f0274ad841c6920fff9a4f6 Added standard Travis config
* 2015-12-17 279fa104456e0e68ded252d245d5b84456d51d74 Added standard .editorconfig file
* 2016-01-09 341eab3 Add TravisCI badge in README.md
* 2016-01-09 2218f7f Correct README.md typo
* 2016-01-09 f48cfca Add Packagist stable version badge to README.md
* 2016-01-09 3c97621 Improve README.md
* 2016-01-09 824fe2f Improve tests interoperability
* 2016-01-08 91f231c Tocify custom field instead of Content
* 2016-01-08 e986d31 Empty lines after class are not needed in PSR-2 mode
* 2016-01-08 ad78969 Enhance composer.json
* 2016-01-08 8ddd445 Use YAML for configuration
* 2016-01-01 d5a78a5 Converted to PSR-2
* 2016-01-01 f06546b Added standard Travis config
* 2015-12-17 279fa10 Added standard .editorconfig file

### 1.0.3 (2014-02-20)

* 2014-02-20 e3a45766fa4e217378b4b2b90ab2da52beebe38e Do not handle $Content if does not exist
* 2014-01-18 4a98c25c40fbad4b0bf40963da543d148f130136 Improve composer.json compatibility
* 2014-01-06 1768739e46d796eaa52138e8689214df587b98e0 Revert "Use a less verbose package name"
* 2014-01-06 9a950978f04cfae7a72f6e7de4f4dca89b1d607a Use a less verbose package name
* 2014-02-20 e3a4576 Do not handle $Content if does not exist
* 2014-01-18 4a98c25 Improve composer.json compatibility
* 2014-01-06 1768739 Revert "Use a less verbose package name"
* 2014-01-06 9a95097 Use a less verbose package name

### 1.0.2 (2013-12-23)

* 2013-12-23 64f22e881d6036adfe1e4a6f9ea6c323d986d8fa Use proper license in composer.json
* 2013-12-23 f7ce9f35beda9c7460976bfda08c599abafd2d6b Add missing comma to composer.json
* 2013-12-23 64f22e8 Use proper license in composer.json
* 2013-12-23 f7ce9f3 Add missing comma to composer.json

### 1.0.1 (2013-12-23)

* 2013-12-23 e3719f095606eeb34f4fc01a4522b6cefb2217f6 Cite silverstrap as compatible theme in composer
* 2013-12-23 e3719f0 Cite silverstrap as compatible theme in composer

### 1.0.0 (2013-12-23)

Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Any open source product is only as good as the community behind it. You
can participate by sharing code, ideas, or simply helping others. No
matter what your skill level is, every contribution counts.

The main development happens into the `dev` branch, so pull requests are
expected to be done against `dev`. Anyway the project is so small that
contributions in master will not be surely rejected.
The main developement is done in `dev`: that is merged into `master` when
considered stable enough. When this happens, an appropriate release is tagged.
`dev` and `master` branches are compatibles with SilverStripe 4. For
SilverStripe 3 you should take a look at the `ss3` branch.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_Copyright © 2013-2016, Nicola Fontana <ntd@entidi.it>_
_Copyright © 2013-2017, Nicola Fontana <ntd@entidi.it>_
_All rights reserved._

Redistribution and use in source and binary forms, with or without modification,
Expand Down
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,30 @@ silverstripe-autotoc
Automatically generate the table of contents from the *Content* of a
page or, more generally, from any HTML field.

This module can be used without the CMS.

Installation
------------

If you use [composer](https://getcomposer.org/), you could just run the
following command:

composer require entidi/silverstripe-autotoc

To manually install it you should unpack or copy `silverstripe-autotoc`
into your SilverStripe root directory, rename it to `autotoc` and do a
`?flush`.

This module can be used without the CMS.
Manual installation is probably possible but not really tested.

Testing
-------

Part of this project (the _Tocifier_ class) is intentionally decoupled
from SilverStripe so it can be tested without pulling in all the
framework.

From the module root directory you can trigger the testing by calling
`phpunit` (that must be previously installed on your system):
Basically it boils down to the following commands:

phpunit --bootstrap tests/Bootstrap.php tests/
composer update
vendor/bin/phpunit

Other documentation
-------------------

* [Usage](docs/en/usage.md)
* [AutoTOC format](docs/en/format.md)
* [Autotoc format](docs/en/format.md)
* [Contributing](CONTRIBUTING.md)
* [Code of Conduct](https://docs.silverstripe.org/en/contributing/code_of_conduct)
* [BSD license](LICENSE.md)
* [ChangeLog](CHANGELOG.md)
* [Support](docs/en/support.md)
14 changes: 6 additions & 8 deletions _config/autotoc.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
Name: autotoc
After:
- framework
---
Autotoc:
augment_callback: [ Tocifier, SetId ]
eNTiDi\Autotoc\Autotoc:
augment_callback: eNTiDi\Autotoc\Tocifier::SetId
---
Only:
classexists: ContentController
classexists: SilverStripe\CMS\Controllers\ContentController
---
ContentController:
extensions:
- 'Autotoc'
SilverStripe\CMS\Controllers\ContentController:
extensions:
- eNTiDi\Autotoc\Autotoc
Loading

0 comments on commit 2ac5a63

Please sign in to comment.