Skip to content
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 1 commit into from
Jun 27, 2017

Conversation

poonai
Copy link
Contributor

@poonai poonai commented Jun 23, 2017

Description

I have added bash script which generate documentation from serveral git urls

Related Issue

close #173

Motivation and Context

this script allow us to implement the multiple repository documentation in travis and WEBUI

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix
  • New feature

Checklist:

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • There is a corresponding issue for this pull request.
  • Mentioned the Issue number in the pull request commit message Fixes #<number> commit message
  • There is only one commit per issue.

@poonai
Copy link
Contributor Author

poonai commented Jun 23, 2017

@imujjwal96 @pri22296 I have the script. please give your suggestion

@imujjwal96
Copy link
Contributor

Can you please show a demo deployment with Travis?


rm index.rst

python $BASE/modules/scripts/genindex.py ./
Copy link
Member

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.

Copy link
Contributor Author

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

Project1
Project2

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.

Copy link
Member

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

Copy link
Contributor Author

@poonai poonai Jun 26, 2017

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

Copy link
Member

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

Copy link
Contributor Author

@poonai poonai Jun 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imujjwal96

From where have you generated the start page?

Please check this discussion for this

@poonai poonai force-pushed the script branch 5 times, most recently from b6bdb8d to a9f7f14 Compare June 24, 2017 08:47
@poonai
Copy link
Contributor Author

poonai commented Jun 25, 2017

fi


IFS=', ' read -r -a SUBPROJECTS <<< "$SUBPROJECT"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restore previous value of IFS after reading

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pri22296 How do you expect url's to be filled?
", " of ","?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the best way would be that we split with a ',' and then strip whitespaces from both ends.

@imujjwal96
Copy link
Contributor

From where have you generated the start page?

@pri22296
Copy link
Member

pri22296 commented Jun 25, 2017

@Sch00lb0y could you make configuration vars in your test repo public? No need to encrypt them. would help a lot in reviewing! and please set DEBUG="true". I would like to see the generated index in this case!


cp -a ${BASE}/fossasia_theme $BUILD_DIR/_themes/

URL_SPLIT=(${SUBPROJECTS[0]//// })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand, you are using the first entry of subproject as the parent right? could you change that? subprojects are meant to be child projects. Use the current project as the parent.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember having a discussion over this.

Copy link
Contributor Author

@poonai poonai Jun 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I made this script by having web UI on the mind. Once it gets merged. we'll raise a separate issue for Travis and anyone one of you work on Travis by that time I'll work on #169. That's why I didn't touch generate_ci.sh. if you want me to make changes for Travis in this PR also no problem. I'll make necessary changes.

Copy link
Member

@pri22296 pri22296 Jun 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I can see that in the PR for webUI, you are taking a list of urls as input. Instead take GITURL as a single url like before and then take SUBPROJECTS as a list of urls. If SUBPROJECT would be empty, it would reduce to the single repo model like we have setup for now. Better to make the change now than later.

Copy link
Contributor Author

@poonai poonai Jun 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pri22296 check once. this way of implementation okay?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this seems good for now. please look at my other comments too!

@poonai poonai force-pushed the script branch 2 times, most recently from 0258dd7 to 00a0b84 Compare June 25, 2017 11:58
generate.sh Outdated
echo -e "Cloning Repository...\n"
git clone -q ${GITURL} "$UNIQUEID" && cd $_
echo -e "Repository Cloned Successfully!\n"
if ! [ "${SUBPROJECT:-nothing}" == "nothing" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why nothing? use a empty string instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have resolved

mv ${UNIQUEID} ${UNIQUEID}_preview
zip -r -q ${UNIQUEID}.zip ${UNIQUEID}_preview
else
source <(curl -s https://raw.githubusercontent.com/sch00lb0y/yaydoc/script/publish_docs.sh)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix this link

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have resolved

@poonai
Copy link
Contributor Author

poonai commented Jun 26, 2017

@imujjwal96 Please check

@imujjwal96
Copy link
Contributor

From where have you generated the start page?

@poonai
Copy link
Contributor Author

poonai commented Jun 26, 2017

@imujjwal96 start page is created by using genindex.py. please check this discussion for the generating start page https://github.com/fossasia/yaydoc/pull/174/files#r123954904

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants