File tree Expand file tree Collapse file tree 4 files changed +22
-3838
lines changed
Expand file tree Collapse file tree 4 files changed +22
-3838
lines changed Original file line number Diff line number Diff line change 11vendor
2+ composer.lock
Original file line number Diff line number Diff line change 11# Doctrine Docs Builder
22
33A package for generating Doctrine repo docs in a unified way. Its purpose is to abstract the underlying method away from
4- the generating command. It assumes the input directory is in ` docs/en ` at the root of the repo (for now).
4+ the generating command. It assumes:
5+
6+ - it's run from the project root, and
7+ - the docs reside in ` docs/en/ ` .
8+
9+ It uses [ phpdocumentor] ( https://github.com/phpDocumentor/guides ) tooling for parsing the RST files.
10+
11+ This project is considered an internal tool and therefore, you shouldn't use this project in your application. This
12+ repository doesn't provide any support, and doesn't guarantee backward compatibility. Any or the entire project can
13+ change, or even disappear, at any moment without prior notice.
514
615## Usage:
716
817``` shell
9- composer require --dev doctrine/docs-builder
10- ./vendor/bin/build-docs.sh [< output> ]
18+ composer require --dev doctrine/docs-builder -d docs
19+ ./docs/ vendor/bin/build-docs.sh [< output> ]
1120```
1221
13- The output directory defaults to ` output ` at the root of your project .
22+ The output directory defaults to ` docs/ output` .
1423
1524Optionally, declare a script in your root ` composer.json ` for convenience:
1625
1726```
1827"scripts": {
19- "docs": "./vendor/bin/build-docs.sh @additional_args"
28+ "docs": "./docs/ vendor/bin/build-docs.sh @additional_args"
2029}
2130```
2231
Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22
3- usage=" $( basename " $0 " ) [-h] [<outputDir>] -- generate the docs to given output dir [default: output]"
3+ usage=" $( basename " $0 " ) [-h] [<outputDir>] -- generate docs to given output dir [default: docs/ output]"
44
55# shellcheck disable=SC2034
66if getopts " :h" option
99 exit
1010fi
1111
12- rootDir=$PWD
13-
14- inputDir=" docs/en"
12+ docsRoot=" $PWD /docs"
1513
1614outputArg=" ${1} "
1715firstChar=$( echo " $1 " | cut -c1-1)
1816
1917if [ " $firstChar " != " /" ] && [ " $firstChar " != " " ]
2018then
21- # Output directory should be relative to working directory
22- outputArg=" $rootDir /$outputArg "
19+ # The output path provided is not an absolute path;
20+ # therefore treat the path as relative to the working dir (project root).
21+ outputArg=" $docsRoot /$outputArg "
2322fi
2423
25- defaultOutputDir=" $rootDir /output"
24+ defaultOutputDir=" $docsRoot /output"
2625outputDir=" ${outputArg:- ${defaultOutputDir:- default} } "
2726
28- baseDir=$( dirname " $( dirname " $0 " ) " )
29- output=$( composer install -d " $baseDir " 2>&1 ) || print " $output "
30-
31- " $baseDir /vendor/bin/guides" -vvv --no-progress --fail-on-log " $rootDir /$inputDir " --output=" $outputDir "
27+ " $docsRoot /vendor/bin/guides" -vvv --no-progress --fail-on-log " $docsRoot /en" --output=" $outputDir "
You can’t perform that action at this time.
0 commit comments