# Path: ckanext/showcase/utils.py
# DATASET_TYPE_NAME = 'showcase'
# def check_edit_view_auth(id):
# def check_new_view_auth():
# def read_view(id):
# def manage_datasets_view(id):
# def migrate(allow_duplicates):
# def _get_related_dataset(related_id):
# def _find_duplicates(lst):
# def _gen_new_title(title, related_id):
# def _add_dataset_search(showcase_id, showcase_name):
#     def drill_down_url(alternative_url=None, **by):
#     def remove_field(key, value=None, replace=None):
#     def _sort_by(fields):
#     def pager_url(q=None, page=None):
# def _search_url(params, name):
# def _encode_params(params):
# def url_with_params(url, params):
# def delete_view(id):
# def dataset_showcase_list(id):
# def manage_showcase_admins():
# def remove_showcase_admin():
# def markdown_to_html():
# def upload():


import click
from ckanext.showcase import utils
# -*- coding: utf-8 -*-



# Click commands for CKAN 2.9 and above


@click.group()
def showcase():
    '''showcase commands
    '''
    pass


@showcase.command()
@click.option('--allow-duplicates',
                default=False,
                help='Allow related items with duplicate titles to be migrated. Duplicate showcases will be created as "duplicate_<related-name>_<related-id>".')
def migrate(allow_duplicates):
    """
        showcase migrate [options]
    """
    utils.migrate(allow_duplicates)


@showcase.command()
def markdown_to_html():
    '''
        showcase markdown-to-html
    '''

# Path: ckanext/showcase/utils.py
# DATASET_TYPE_NAME = 'showcase'
# def check_edit_view_auth(id):
# def check_new_view_auth():
# def read_view(id):
# def manage_datasets_view(id):
# def migrate(allow_duplicates):
# def _get_related_dataset(related_id):
# def _find_duplicates(lst):
# def _gen_new_title(title, related_id):
# def _add_dataset_search(showcase_id, showcase_name):
#     def drill_down_url(alternative_url=None, **by):
#     def remove_field(key, value=None, replace=None):
#     def _sort_by(fields):
#     def pager_url(q=None, page=None):
# def _search_url(params, name):
# def _encode_params(params):
# def url_with_params(url, params):
# def delete_view(id):
# def dataset_showcase_list(id):
# def manage_showcase_admins():
# def remove_showcase_admin():
# def markdown_to_html():
# def upload():


# Path: ckanext/showcase/commands/cli.py
import click
from ckanext.showcase import utils

# -*- coding: utf-8 -*-



# Click commands for CKAN 2.9 and above


@click.group()
def showcase():
    '''showcase commands
    '''
    pass


@showcase.command()
@click.option('--allow-duplicates',
                default=False,
                help='Allow related items with duplicate titles to be migrated. Duplicate showcases will be created as "duplicate_<related-name>_<related-id>".')
def migrate(allow_duplicates):
    """
        showcase migrate [options]
    """
    utils.migrate(allow_duplicates)


@showcase.command()
def markdown_to_html():
    '''
        showcase markdown-to-html
    '''

    utils.markdown_to_html()