Skip to content

Commit

Permalink
generate:module creates skeletal mkdocs content
Browse files Browse the repository at this point in the history
Just generates mkdocs.yml and docs/index.md with a couple of Template
builders in the main InitCommand for now. Alternatively, could create
a Docs builder and/or command.

Fixes totten#161
  • Loading branch information
ejegg committed May 1, 2021
1 parent f736811 commit f19e8bb
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CRM/CivixBundle/Command/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$basedir = new Path($ctx['basedir']);
$ext->builders['dirs'] = new Dirs([
$basedir->string('build'),
$basedir->string('docs'),
$basedir->string('templates'),
$basedir->string('xml'),
$basedir->string('images'),
Expand All @@ -117,6 +118,8 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$ext->builders['module'] = new Module(Services::templating());
$ext->builders['license'] = new License($licenses->get($ctx['license']), $basedir->string('LICENSE.txt'), FALSE);
$ext->builders['readme'] = new Template('readme.md.php', $basedir->string('README.md'), FALSE, Services::templating());
$ext->builders['mkdocs'] = new Template('mkdocs.yml.php', $basedir->string('mkdocs.yml'), FALSE, Services::templating());
$ext->builders['docindex'] = new Template('index.md.php', $basedir->string('docs/index.md'), FALSE, Services::templating());
$ext->builders['screenshot'] = new CopyFile(dirname(dirname(dirname(dirname(__DIR__)))) . '/images/placeholder.png', $basedir->string('images/screenshot.png'), FALSE);
$ext->loadInit($ctx);
$ext->save($ctx, $output);
Expand Down
19 changes: 19 additions & 0 deletions src/CRM/CivixBundle/Resources/views/Code/index.md.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# <?php echo $fullName; ?>

## Overview

FIXME

### Features

* FIXME

## Requirements

* CiviCRM x.y or higher

## Known Issues

* None yet!

## Future plans
29 changes: 29 additions & 0 deletions src/CRM/CivixBundle/Resources/views/Code/mkdocs.yml.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use mkdocs to generate a manual for this extension. For more information about
# mkdocs, see https://docs.civicrm.org/dev/en/latest/documentation/#mkdocs
site_name: <?php echo "$fullName\n"; ?>
repo_url: https://lab.civicrm.org/extensions/FIXME
site_description: 'A guide for the <?php echo "$fullName\n"; ?> extension.'
site_author: FIXME
theme:
name: material

nav:
- Home: index.md

markdown_extensions:
- attr_list
- admonition
- def_list
- pymdownx.highlight
guess_lang: false
- toc:
permalink: true
- pymdownx.superfences
- pymdownx.inlinehilite
- pymdownx.tilde
- pymdownx.betterem
- pymdownx.mark

plugins:
- search:
lang: en

0 comments on commit f19e8bb

Please sign in to comment.