diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c5d853..959d55d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,6 +21,10 @@ jobs: # a collection of steps mkdir -p ~/hub tar -C ~/hub -zxvf /tmp/hub.tgz --strip-components=1 sudo ln -s `realpath ~/hub/bin/hub` /usr/local/bin/ + - run: + command: | + sudo apt install -y python-pip + sudo -H pip install mkdocs - restore_cache: # special step to restore the dependency cache if `composer.json` does not change keys: - composer-v1-{{ checksum "composer.json" }} @@ -33,5 +37,6 @@ jobs: # a collection of steps - vendor - run: command: | + ./build-docs.sh ls hub --help diff --git a/.gitignore b/.gitignore index 072705c..7495df0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .idea/ vendor/ composer.lock +/mkdocs.yml +/docs/ +/site/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..76301e8 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Laravel Socialite Providers diff --git a/build-docs.sh b/build-docs.sh new file mode 100755 index 0000000..3266042 --- /dev/null +++ b/build-docs.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +mkdir -p docs +cp README.md docs/ +echo "site_name: 'Laravel Socialite Providers' +theme: 'readthedocs' +nav: + - index: 'README.md'" > mkdocs.yml + +for file in `ls */composer.json`; do + package_id=`node getValueFromJsonFile.js $file` + echo $package_id + dir_name=`dirname $file` + cp $dir_name/README.md docs/$package_id.md + grep $package_id.md mkdocs.yml || echo " - $dir_name: '$package_id.md'" >> mkdocs.yml +done + +mkdocs build --clean diff --git a/getValueFromJsonFile.js b/getValueFromJsonFile.js new file mode 100644 index 0000000..dd2c189 --- /dev/null +++ b/getValueFromJsonFile.js @@ -0,0 +1,8 @@ +'use strict'; + +const fs = require('fs'); +const args = process.argv; + +let rawdata = fs.readFileSync(args[2]); +let data = JSON.parse(rawdata); +console.log(data.extra.component.id);