From 15324a68e889d7557e59e43153f698dacb8b51b2 Mon Sep 17 00:00:00 2001 From: Elliott Eggleston Date: Tue, 8 Oct 2019 11:30:33 +0200 Subject: [PATCH] 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 --- src/CRM/CivixBundle/Command/InitCommand.php | 3 +++ .../Resources/views/Code/index.md.php | 19 +++++++++++++++++++ .../Resources/views/Code/mkdocs.yml.php | 19 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 src/CRM/CivixBundle/Resources/views/Code/index.md.php create mode 100644 src/CRM/CivixBundle/Resources/views/Code/mkdocs.yml.php diff --git a/src/CRM/CivixBundle/Command/InitCommand.php b/src/CRM/CivixBundle/Command/InitCommand.php index 1204d967..f77d4e96 100644 --- a/src/CRM/CivixBundle/Command/InitCommand.php +++ b/src/CRM/CivixBundle/Command/InitCommand.php @@ -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'), @@ -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); diff --git a/src/CRM/CivixBundle/Resources/views/Code/index.md.php b/src/CRM/CivixBundle/Resources/views/Code/index.md.php new file mode 100644 index 00000000..738e391c --- /dev/null +++ b/src/CRM/CivixBundle/Resources/views/Code/index.md.php @@ -0,0 +1,19 @@ +# + +## Overview + +FIXME + +### Features + +* FIXME + +## Requirements + +* CiviCRM x.y or higher + +## Known Issues + +* None yet! + +## Future plans diff --git a/src/CRM/CivixBundle/Resources/views/Code/mkdocs.yml.php b/src/CRM/CivixBundle/Resources/views/Code/mkdocs.yml.php new file mode 100644 index 00000000..74fbd821 --- /dev/null +++ b/src/CRM/CivixBundle/Resources/views/Code/mkdocs.yml.php @@ -0,0 +1,19 @@ +site_name: +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