Skip to content

Commit

Permalink
new: build docs. #2
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkcup committed May 27, 2019
1 parent 0e7f318 commit 4f1e481
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }}
Expand All @@ -33,5 +37,6 @@ jobs: # a collection of steps
- vendor
- run:
command: |
./build-docs.sh
ls
hub --help
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea/
vendor/
composer.lock
/mkdocs.yml
/docs/
/site/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Laravel Socialite Providers
18 changes: 18 additions & 0 deletions build-docs.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions getValueFromJsonFile.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 4f1e481

Please sign in to comment.