Yancy::Plugin::Editor - Yancy content editor, admin, and management application
version 1.030
use Mojolicious::Lite; plugin Yancy => { backend => 'sqlite://myapp.db', read_schema => 1, editor => { # XXX }, };
XXX
This plugin has the following configuration options.
XXX schema openapi default_controller backend moniker
A base route to add Yancy to. This allows you to customize the URL and add authentication or authorization. Defaults to allowing access to the Yancy web application under /yancy, and the REST API under /yancy/api.
/yancy
/yancy/api
The URL to use for the "Back to Application" link. Defaults to /.
/
$app->yancy->editor->include( $template_name );
Include a template in the editor, before the rest of the editor. Use this to add your own Vue.JS components to the editor.
$app->yancy->editor->menu( $category, $title, $config );
Add a menu item to the editor. The $category is the title of the category in the sidebar. $title is the title of the menu item. $config is a hash reference with the following keys:
$category
$title
$config
The name of a Vue.JS component to display for this menu item. The component will take up the entire main area of the application, and will be kept active even after another menu item is selected.
Yancy plugins should use the category Plugins. Other categories are available for custom applications.
Plugins
app->yancy->editor->include( 'plugin/editor/custom_element' ); app->yancy->editor->menu( 'Plugins', 'Custom Item', { component => 'custom-element', }, ); __END__ @@ plugin/editor/custom_element.html.ep <template id="custom-element-template"> <div :id="'custom-element'"> Hello, world! </div> </template> %= javascript begin Vue.component( 'custom-element', { template: '#custom-element-template', } ); % end
<img alt="screenshot of yancy editor showing custom element" src="https://raw.github.com/preaction/Yancy/master/eg/doc-site/public/screenshot-custom-element.png?raw=true" />
Get the route where the editor will appear.
my $openapi = $c->yancy->openapi;
Get the Mojolicious::Plugin::OpenAPI object containing the OpenAPI interface for this Yancy API.
This is the main Yancy web application. You should not override this. If you need to, consider filing a bug report or feature request.
Yancy::Help::Config, Mojolicious::Plugin::Yancy, Yancy
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2019 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Yancy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yancy
CPAN shell
perl -MCPAN -e shell install Yancy
For more information on module installation, please visit the detailed CPAN module installation guide.