Skip to content

Commit cb54ab4

Browse files
committed
generate:module creates skeletal mkdocs content
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
1 parent 32f56b3 commit cb54ab4

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

src/CRM/CivixBundle/Command/InitCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
108108
$basedir = new Path($ctx['basedir']);
109109
$ext->builders['dirs'] = new Dirs([
110110
$basedir->string('build'),
111+
$basedir->string('docs'),
111112
$basedir->string('templates'),
112113
$basedir->string('xml'),
113114
$basedir->string('images'),
@@ -117,6 +118,8 @@ protected function execute(InputInterface $input, OutputInterface $output) {
117118
$ext->builders['module'] = new Module(Services::templating());
118119
$ext->builders['license'] = new License($licenses->get($ctx['license']), $basedir->string('LICENSE.txt'), FALSE);
119120
$ext->builders['readme'] = new Template('readme.md.php', $basedir->string('README.md'), FALSE, Services::templating());
121+
$ext->builders['mkdocs'] = new Template('mkdocs.yml.php', $basedir->string('mkdocs.yml'), FALSE, Services::templating());
122+
$ext->builders['docindex'] = new Template('index.md.php', $basedir->string('docs/index.md'), FALSE, Services::templating());
120123
$ext->builders['screenshot'] = new CopyFile(dirname(dirname(dirname(dirname(__DIR__)))) . '/images/placeholder.png', $basedir->string('images/screenshot.png'), FALSE);
121124
$ext->loadInit($ctx);
122125
$ext->save($ctx, $output);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# <?php echo $fullName; ?>
2+
3+
## Overview
4+
5+
FIXME
6+
7+
### Features
8+
9+
* FIXME
10+
11+
## Requirements
12+
13+
* CiviCRM x.y or higher
14+
15+
## Known Issues
16+
17+
* None yet!
18+
19+
## Future plans
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Use mkdocs to generate a manual for this extension. For more information about
2+
# mkdocs, see https://docs.civicrm.org/dev/en/latest/documentation/#mkdocs
3+
site_name: <?php echo "$fullName\n"; ?>
4+
repo_url: https://lab.civicrm.org/extensions/FIXME
5+
theme: material
6+
7+
pages:
8+
- Home: index.md
9+
10+
markdown_extensions:
11+
- attr_list
12+
- admonition
13+
- def_list
14+
- codehilite(guess_lang=false)
15+
- toc(permalink=true)
16+
- pymdownx.superfences
17+
- pymdownx.inlinehilite
18+
- pymdownx.tilde
19+
- pymdownx.betterem
20+
- pymdownx.mark
21+
- pymdownx.magiclink

0 commit comments

Comments
 (0)