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. Uses the old markdown_extensions syntax
because that's all the publishing infrastructure supports now.

Fixes #161
  • Loading branch information
ejegg committed Oct 18, 2019
1 parent 32f56b3 commit cb54ab4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CRM/CivixBundle/Command/InitCommand.php
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
@@ -0,0 +1,19 @@
# <?php echo $fullName; ?>

## Overview

FIXME

### Features

* FIXME

## Requirements

* CiviCRM x.y or higher

## Known Issues

* None yet!

## Future plans
21 changes: 21 additions & 0 deletions src/CRM/CivixBundle/Resources/views/Code/mkdocs.yml.php
@@ -0,0 +1,21 @@
# 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
theme: material

pages:
- Home: index.md

markdown_extensions:
- attr_list
- admonition
- def_list
- codehilite(guess_lang=false)
- toc(permalink=true)
- pymdownx.superfences
- pymdownx.inlinehilite
- pymdownx.tilde
- pymdownx.betterem
- pymdownx.mark
- pymdownx.magiclink

0 comments on commit cb54ab4

Please sign in to comment.