-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7956ed1
commit 8a5715c
Showing
18 changed files
with
1,096 additions
and
175 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# CLI Note | ||
|
||
CLI Note is an experiment to use a console application as a slide deck. | ||
|
||
## Usage | ||
|
||
Use [jaem3l/cli-note-presentation](https://github.com/jaem3l/cli-note-presentation) as skeleton for your presentation. | ||
|
||
## Example | ||
|
||
To execute a simple example you can just clone this repository: | ||
|
||
```bash | ||
$ git clone git@github.com:jaem3l/cli-note.git | ||
$ cd cli-note | ||
$ composer install | ||
$ ./cli-note | ||
``` | ||
|
||
## Controls | ||
|
||
**Start at specific slide** | ||
|
||
```bash | ||
$ ./cli-note --start-at=10 | ||
$ ./cli-note -s 10 | ||
``` | ||
|
||
**While presentation** | ||
|
||
* `p`, `prev` or `previous`: render previous slide | ||
* `c` or `current`: render current slide again | ||
* `n` or `next`: render next slide | ||
* `f` or `first`: render first slide | ||
* `l` or `last`: render last slide | ||
|
||
## Slides | ||
|
||
CLI Note ships with seven different built-in slides | ||
|
||
* CanvasSlide - an abstract slide to render various canvas elements based on [chr-hertel/console-canvas](https://github.com/chr-hertel/console-canvas) | ||
* CodeSlide - to print highlighted code snippets | ||
* ImageSlide - to print images | ||
* ListSlide - to print a list with a headline | ||
* ProcessSlide - to print the output of a child process | ||
* TextSlide - to print a text file with formatting possible | ||
* TitleSlide - to print a title and an optional subtitle | ||
|
||
## Disclaimer | ||
|
||
This is just a project to demonstrate the capabilities of Symfony Console Component for SymfonyWorld 2020. | ||
Use this on your own risk and do not expect this to be actively maintained. |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
use jæm3l\CliNote\Slide; | ||
use jæm3l\CliNote\DependencyInjection\SlidePass; | ||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\ConsoleEvents; | ||
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; | ||
use Symfony\Component\ErrorHandler\ErrorHandler; | ||
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
ErrorHandler::register(); | ||
$container = new ContainerBuilder(); | ||
|
||
// Configure console. | ||
$container->addCompilerPass(new AddConsoleCommandPass()); | ||
$container->registerForAutoconfiguration(Command::class) | ||
->addTag('console.command'); | ||
|
||
// Configure event dispatcher. | ||
$container->setParameter('event_dispatcher.event_aliases', ConsoleEvents::ALIASES); | ||
$container->addCompilerPass(new RegisterListenersPass()); | ||
$container->registerForAutoconfiguration(EventSubscriberInterface::class) | ||
->addTag('kernel.event_subscriber'); | ||
|
||
// Configure slides. | ||
$container->addCompilerPass(new SlidePass()); | ||
$container->registerForAutoconfiguration(Slide::class) | ||
->addTag('cli_note.slide'); | ||
|
||
// Load slides.yaml. | ||
(new YamlFileLoader($container, new FileLocator(__DIR__.'/config')))->load('services.yaml'); | ||
(new YamlFileLoader($container, new FileLocator(getcwd())))->load('slides.yaml'); | ||
|
||
$container->setParameter('base_path', getcwd()); | ||
$container->compile(); | ||
|
||
$container | ||
->get('CliNote') | ||
->run(); |
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.