refactor: Cleanup git state - commit all staged changes
Major refactoring cleanup: - Add new controller architecture (class-controller-*.php) - Add new settings-v2 UI (views/settings-v2/) - Add new CSS architecture (agentic-sidebar.css, tokens) - Add esbuild build pipeline (scripts/build.js, package.json) - Add composer dependencies (vendor/) - Add frontend src directory (assets/js/src/index.jsx) - Add documentation files - Remove old/obsolete files (class-settings.php, old CSS) This commits all pending changes from previous refactoring efforts.
This commit is contained in:
67
vendor/parsica-php/parsica/docs/installation.md
vendored
Normal file
67
vendor/parsica-php/parsica/docs/installation.md
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: Installation & Requirements
|
||||
---
|
||||
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
<Tabs
|
||||
defaultValue="cli"
|
||||
values={[
|
||||
{ label: 'Command line', value: 'cli', },
|
||||
{ label: 'composer.json', value: 'composer', },
|
||||
]
|
||||
}>
|
||||
<TabItem value="cli">
|
||||
|
||||
```bash
|
||||
composer require parsica-php/parsica
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="composer">
|
||||
|
||||
```json
|
||||
"require": {
|
||||
"parsica-php/parsica": "dev-main"
|
||||
}
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
## Requirements
|
||||
|
||||
- PHP 7.4 or higher
|
||||
- [The multibyte string extension for PHP (aka mbstring)](https://www.php.net/manual/en/book.mbstring.php)
|
||||
|
||||
(@TODO: add polyfill for mbstring).
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
In a .php file, make sure the Composer autoloader is included:
|
||||
|
||||
`require_once __DIR__.'/../vendor/autoload.php';`
|
||||
|
||||
Import parsers and combinators:
|
||||
|
||||
`use function Parsica\Parsica\char;`
|
||||
|
||||
You can combine multiple imports in one statement:
|
||||
|
||||
`use function Parsica\Parsica\{between, char, atLeastOne, alphaChar};`
|
||||
|
||||
Finally, add some code:
|
||||
|
||||
```php
|
||||
<?php
|
||||
$parser = between(char('{'), char('}'), atLeastOne(alphaChar()));
|
||||
$result = $parser->tryString("{Hello}");
|
||||
echo $result->output();
|
||||
// outputs "Hello"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user