-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #97 Add a debug CLI command (ogizanagi)
This PR was squashed before being merged into the 0.x-dev branch. Discussion ---------- Add a debug CLI command Introduce a new `debug:stenope:content` that'll be useful in multiple ways, to debug, list, filter and inspect contents managed by Stenope: ## List ```bash bin/console debug:stenope:content "App\Model\Page" ``` ![Capture d’écran 2021-05-28 à 16 40 01](https://user-images.githubusercontent.com/2211145/120000690-5fba9480-bfd3-11eb-957a-db473f718fd6.png) ## Show ```bash bin/console debug:stenope:content "App\Model\Index" README ``` ![Capture d’écran 2021-05-28 à 16 37 51](https://user-images.githubusercontent.com/2211145/120000413-110cfa80-bfd3-11eb-83dc-67e0d7298359.png) (change verbosity to display more) ## Order & Filter ```bash bin/console debug:stenope:content "App\Model\Article" \ --filter="not:outdated" \ --filter="slug contains:rebranding" \ --order="desc:date" ``` ![Capture d’écran 2021-05-28 à 16 37 03](https://user-images.githubusercontent.com/2211145/120000280-f33f9580-bfd2-11eb-9ef2-1c70fe6c91d3.png) --- There are some minor improvments / changes included in this PR as well: - handle fragment (anchors) when linking content between them ([see how we reference another document with an anchor](https://github.com/StenopePHP/Stenope/pull/97/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R58) in the documentation changes in this PR) - added the ability to provide a filter function for a specific property (it allows the `--filter=field contains:text` feature exposed in the command) - added the `TableOfContent` class. Small BC break (change your typehints from `Headline[]` to `TableOfContent`), but it allows to dump a simpler representation of the TOC when inspecting a content in non-verbose mode. It may also be useful later in case we need to introduce more data/config inside the TOC. - `ContentManager::getContents` now returns the slugs as keys ### TODO - [x] Add some functional tests for the debug command - [x] Add unit & functional tests for resolving links with anchors - [x] Add unit tests for filtering with a callable for a specific property - [x] Add tests to reflect the keys for `ContentManager::getContents` - Later: interactively ask the class if not provided - Later: allow partial classname if no conflict and ask between matches otherwise - Later: dedicated & more powerful parser classes for orders & filters Commits ------- 0279673 Add a debug CLI command
- Loading branch information
Showing
27 changed files
with
625 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
## Development | ||
|
||
### Depenencies | ||
### Dependencies | ||
|
||
make install | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ stenope: | |
- vendor | ||
patterns: | ||
- '*.md' | ||
depth: <=1 | ||
|
||
App\Model\Page: | ||
type: files | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.