Orzu Ionut
07adbf521c
|
3 years ago | |
---|---|---|
.. | ||
README.md | 3 years ago | |
demo_document.pdf | 3 years ago | |
demo_searcher.json | 3 years ago |
README.md
Running S&D via CLI
Command
php artisan sd:run {path} {searchers*}
The command accepts two arguments:
- path: The path to the document file on which the Search&Displace will run
- searchers: This argument can be one of the following two types:
- file searchers: the argument must only have one group in the format 'path:replace_with', where path is the path to a valid JSON file
- inline searchers: the argument can have multiple groups of inline searchers in the format 'key: replace_with'. The 'key' represents a valid searcher found in the 'storage/app/searchers' directory, without the '.json' extension.
The 'replace_with' value is optional, not using it will remove the found text strings.
The resulted Markdown document will be created in the same directory as the input document file.
Examples
Note! These examples work when running the command from the root app directory, otherwise you have to input the correct paths in the command, including for the 'artisan' file.
-
Using valid JSON file searcher and removing all strings found
php artisan sd:run ./demo-cli/demo_document.pdf ./demo-cli/demo_searcher.json
-
Using valid JSON file searcher and replacing all strings found with the string 'EMAIL'
php artisan sd:run ./demo-cli/demo_document.pdf ./demo-cli/demo_searcher.json:EMAIL
-
Using valid searcher key (which exists in the directory 'storage/app/searchers') and removing all strings found
php artisan sd:run ./demo-cli/demo_document.pdf demo_searcher:EMAIL
-
Using valid searcher key (which exists in the directory 'storage/app/searchers') and replacing all strings found with the string 'EMAIL'
php artisan sd:run ./demo-cli/demo_document.pdf demo_searcher:EMAIL