readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
7.99k stars 3.58k forks source link

Is there a way to use invoke to build the docs for rtfd? #4056

Closed mgiaco closed 6 years ago

mgiaco commented 6 years ago

Hello,

In the repository I saw that you also use pyinvoke for some work. Is there a way to use invoke to build the documentation? I am very new to sphinx and read the docs. I do have a project wich has an invoke task called "doc" which builds everything the right way. So I am looking for a way to call that on some commit hook or so.

So If I do any new commit to my repo read the docs should do something like running my

invoke doc with my python virtual environment, my requirements.txt is in the repository.

Is there way how I can achieve that?

Many thanks mathias

stsewd commented 6 years ago

Sorry, rtd only executes the sphinx build command, there is no way to execute other commands. You can also use the rtd configuration file https://docs.readthedocs.io/en/latest/yaml-config.html to build your docs.

agjohnson commented 6 years ago

@mgiaco Is there anything special you are trying to do with invoke? It sounds like you might just need to configure your yaml config.

We may in the future offer a readthedocs-build command that manages a build of your docs through read the docs. We also had orignally wanted to break out our yaml config and surround it with a wrapper command, so users could have local, reproducible builds. If we scaled back our implementation there, I could see having a build command that doesn't manage our virtualenv, but does replicate the commands we execute.

Anyways, that's probably a tangent. Look into the config file, that should allow you to specify everything you are doing locally.

mgiaco commented 6 years ago

@agjohnson Hi, and sorry for the late reply but it took some time to upload the project. There is nothing special I would like to do, I think. Okay maybe a little bit I use sphinx in combination with doxygen and breathe :-) Here is my project: https://github.com/liebherrnenzing/li_can_slv Normally I use a git clone --recursive .... After that i setup python (3.5x) with my requironment.txt. Then I can build the doc with inv doc and then everything is working the right way. So it would be so great If I could use the same approach on rtd.

Today I tried some different approaches to build the doc on rtd. But I do have some big problems with the doxygen source look up. The problem is doxygen could not find the relative source paths I have used. But I do not know how to fix that and that is not a special thing. There is a docs folder and the source is in the source folder. Breath uses the xml output of doxygen build to build the sphinx doc. So I need a doxygen build before the sphinx build. I followed the breathe documentation (https://github.com/michaeljones/breathe/blob/master/documentation/source/readthedocs.rst) here. No the doxygen is called before sphinx .. but I do not found any working solution for the path problem this afternoon.

Dose rtd really clone the whole repo? The build view is not really user friendly... It would be great if someone could see how the working copy looks like after the clone and so on... Also I found out that rtd starts the build at the path were the conf.py is found. Is there a way to change that? Is this really the normal way someone build his sphinx doc?

Also I do not know why rtd does not show my rtd theme I have used.

It would be great if you can help me a little bit.

many thanks

stsewd commented 6 years ago

@mgiaco can you please paste the build url here?

stsewd commented 6 years ago

And yes, rtd clone your full repo, also submodules.

mgiaco commented 6 years ago

Yes sure, I think you mean this one:

https://readthedocs.org/projects/li-can-slv/builds/7154160/

thanks

mgiaco commented 6 years ago

Hello,

Now I got some errors fixed. Doxygen build is okay now but I do have problems with the _static files. I do not know what I am missing. I have tried to build the doc in a similar way to rtd. I tried this approach:

I have generated a virtual env with the requirements.txt in the sphinx folder called py35_lcs_doc

(py35_lcs_doc) E:\github_lwn\li_can_slv\docs\sphinx (master)
λ sim_rtd.bat

(py35_lcs_doc) E:\github_lwn\li_can_slv\docs\sphinx (master)
λ sphinx-build -T -E -D language=en . _build/html

When I build it that way erverything is okay but on RTD there is a problem with the static files and folders.

Can someone help me here?

Here is the build URL: https://readthedocs.org/projects/li-can-slv/builds/7156755/

I have seen a warning there concerning the static part but i do not know how to fix that.

many thanks mathias

mgiaco commented 6 years ago

Is there a way to find out how the workspace on the rtd server looks like? I am wondering if the static data is there. Do I need any special handling with the static Content?

Many thanks

mgiaco commented 6 years ago

Does somebody has any idea?

RichardLitt commented 6 years ago

@mgiaco Please be patient. Read the Docs's open source is mostly volunteer run, and it takes us some time on occasion to respond to issues. Don't worry - someone will get to this issue eventually.

mgiaco commented 6 years ago

@RichardLitt okay no problem. many thanks

agjohnson commented 6 years ago

I'm not sure RTD core team can really help much here, so I'm going to close this issue. If you think there is a issue with Read the Docs, feel free to create a new issue.

It sounds like you might be having trouble with Sphinx usage though, so perhaps you should use stack overflow, irc, or other support channels to resolve your issue -- RTD core team isn't the best resource for requests like this.

mgiaco commented 6 years ago

No problem. I have already found a solution.