Closed froschdesign closed 4 years ago
I created a PR on the theme repository to include the packages list: https://github.com/zendframework/zf-mkdoc-theme/pull/57
:+1: I really like this. Have you started work on it yet?
I'll be going through the zf-mkdock-theme PRs today, and we can then hopefully start building out all components as well; getting this in place would be a great last step in that process.
@weierophinney
Have you started work on it yet?
I have deleted all HTML, CSS und JS files and updated the prepare_component_list.php
:
require_once __DIR__ . '/vendor/autoload.php';
$root = realpath(getcwd());
$listFile = sprintf('%s/zf-component-list.json', $root);
if (! is_readable($listFile)) {
fwrite(STDERR, "Unable to locate zf-component-list.json in root directory; did you run 'make'?\n");
exit(1);
}
$json = file_get_contents($listFile);
$packages = json_decode($json, true);
// Group packages by type
$packagesByType = [
'learn' => [
'group_name' => 'Learn ZF',
'packages' => [],
],
'mvc' => [
'group_name' => 'MVC Framework',
'packages' => [],
],
'middleware' => [
'group_name' => 'Expressive and PSR-15 Middleware',
'packages' => [],
],
'projects' => [
'group_name' => 'Tooling and Composer Plugins',
'packages' => [],
],
'components' => [
'group_name' => 'Components',
'packages' => [],
],
];
$types = array_keys($packagesByType);
// Sort packages into various groups
$packagesByType = array_reduce(
$packages,
function ($grouped, $package) use ($types) {
if (! isset($package['group']) || ! in_array($package['group'], $types, true)) {
$package['group'] = 'components';
}
$grouped[$package['group']]['packages'][] = [
'name' => $package['name'],
'package' => $package['package'],
'url' => $package['url'],
'description' => $package['description'],
];
return $grouped;
},
$packagesByType
);
// Create YAML
$yaml = "\n " . Symfony\Component\Yaml\Yaml::dump(
[
'component_list' => array_values($packagesByType),
]
);
// Add list to mkdocs.yml
file_put_contents(__DIR__ . '/mkdocs.yml', $yaml, FILE_APPEND);
echo 'Added component list to mkdocs.yml';
The script requires symfony/yaml.
And the new index.md
:
# Zend Framework<br>Documentation
Documentation for the MVC Framework, Expressive, and all Components
Another idea for the packages overview: we have already a table of contents on every page. We should add this also for the package list:
I will create a pull request for this.
@weierophinney
Problem
At the moment we have two different entry pages for the documentation. One of them is outdated.
Suggestion
With version 1.0 of MkDocs we can add external links to the navigation. This allows us to move the documentation entry page from framework.zend.com to docs.zendframework.com.
gh-pages
)Preview
Extended
mkdocs.yml