-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #173: script added to generate documentation from multiple repository #174
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
|
||
function clean() { | ||
rm -rf $BUILD_DIR | ||
} | ||
|
||
function cloner() { | ||
URL_SPLIT=(${1//// }) | ||
REPONAME=(${URL_SPLIT[3]//./ }) | ||
git clone $1 ${REPONAME}_temp & | ||
} | ||
|
||
function repoCleaner() { | ||
URL_SPLIT=(${1//// }) | ||
REPONAME=(${URL_SPLIT[3]//./ }) | ||
cd ${REPONAME}_temp | ||
mkdir ../$REPONAME | ||
cp -a docs/. ../$REPONAME/. | ||
cd .. | ||
rm -rf ${REPONAME}_temp | ||
} | ||
|
||
BASE=$(pwd) | ||
|
||
if [ "${WEBUI:-false}" == "true" ]; then | ||
BUILD_DIR=$(pwd)/temp/$EMAIL/$UNIQUEID | ||
mkdir -p $BUILD_DIR | ||
cd $BUILD_DIR | ||
else | ||
git clone https://github.com/fossasia/yaydoc.git yaydocclone | ||
BASE=$(pwd)/yaydocclone | ||
BUILD_DIR=$(pwd)/temp | ||
echo -e "build dir" | ||
echo -e $BUILD_DIR | ||
mkdir -p $BUILD_DIR | ||
cd $BUILD_DIR | ||
fi | ||
|
||
cloner $GITURL | ||
|
||
IFS=', ' read -r -a SUBPROJECTS <<< "$SUBPROJECT" | ||
|
||
for element in "${SUBPROJECTS[@]}" | ||
do | ||
cloner $element | ||
done | ||
|
||
wait | ||
|
||
repoCleaner $GITURL | ||
for element in "${SUBPROJECTS[@]}" | ||
do | ||
repoCleaner $element | ||
done | ||
|
||
cp -a ${BASE}/modules/scripts/ $BUILD_DIR/ | ||
cp -a ${BASE}/modules/templates/ $BUILD_DIR/ | ||
|
||
mkdir _themes | ||
|
||
cp -a ${BASE}/fossasia_theme $BUILD_DIR/_themes/ | ||
|
||
URL_SPLIT=(${GITURL//// }) | ||
USERNAME=${URL_SPLIT[2]} | ||
REPONAME=(${URL_SPLIT[3]//./ }) | ||
|
||
pip install -r $BASE/requirements.txt | ||
sphinx-quickstart -q -v "($(date +%Y-%m-%d.%H:%M:%S))" -a $USERNAME -p $REPONAME -t templates/ -d html_theme=alabaster -d html_logo=$LOGO | ||
|
||
rm index.rst | ||
|
||
python $BASE/modules/scripts/genindex.py ./ | ||
make html | ||
shopt -s extglob | ||
if [ "${WEBUI:-false}" == "true" ]; then | ||
|
||
|
||
rm -r !(_build) | ||
|
||
cp -a _build/html/. ./ | ||
|
||
rm -r _build | ||
|
||
cd .. | ||
mv ${UNIQUEID} ${UNIQUEID}_preview | ||
zip -r -q ${UNIQUEID}.zip ${UNIQUEID}_preview | ||
else | ||
source <(curl -s https://raw.githubusercontent.com/fossasia/yaydoc/master/publish_docs.sh) | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index generated by genindex.py differs from what is needed as the index for a master project. For now assume that the user provides a suitable index and proceed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now build dir will look like this
all the files will be removed and docs/ folder files will be copied to specific project folder. Then I'm generating index.rst from the root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last issue, what about the README's of the sub-projects. since they won't be in subproject/docs, they won't be included in the build. How about, if we copy the entire repo inside BUILD_DIR and visit subproject/docs and generate index if needed for each subproject and then, for the main index, we just add a toctree with links to all sub-indices? views @Sch00lb0y @imujjwal96
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it is a good idea. Should I work on this now? or to raise a new issue after the merge. Cause meanwhile I can work on WEBUI and you guys can work on travis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool. Just create a new issue and this PR should be good to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@imujjwal96
Please check this discussion for this