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

How to give path to srctree? #8

Closed
schodet opened this issue Mar 16, 2021 · 7 comments
Closed

How to give path to srctree? #8

schodet opened this issue Mar 16, 2021 · 7 comments

Comments

@schodet
Copy link
Contributor

schodet commented Mar 16, 2021

Hello,

the only way I found to give the path to srctree is to export the srctree variable before calling sphinx-build.

Is there a way to do it from the conf.py file?

Thanks.

Edit: s/srcdir/srctree/g

@schodet schodet changed the title How to give path to srcdir? How to give path to srctree? Mar 16, 2021
@return42
Copy link
Owner

What do you want to do?

srctreeis only needed here https://return42.github.io/linuxdoc/linux.html .. but this article left there for historical reasons (see remark box in the right upper corner).

@schodet
Copy link
Contributor Author

schodet commented Mar 22, 2021

I have my documentation in the doc directory, and my code in the parent directory, how should I point to a source file?

I tried relative path:

WARN: no relative pathname given / no SRCTREE:  features based on these settings might not work as expected!                                                                                                        
ERROR: no source file given!
…
/home/nicolas/work/.../api.rst:8: WARNING: kernel-doc refers to nonexisting document 

.. kernel-doc:: ../../src/api.h
…

Did I miss something?

@return42
Copy link
Owner

Did I miss something?

Sorry, my fail .. there was a mess with the srctree environment. I fixed it 687a8e8 ...

The argument <src-filename> is required and points to the source file. The pathname is relative to the pathname of the kernel-doc directive. Absolute pathnames are relative to environment srctree (if unset, defaults to CWD).

Do you like to pull from master and test it? / Thanks!

@schodet
Copy link
Contributor Author

schodet commented Mar 25, 2021

Just tested it, it works.

However, it breaks compatibility with what’s is in the kernel tree, not sure it’s right.

It would be also nice to have an option in conf.py to set the srctree.

By the way, you said that “something in kernel’s doc-build chain has been changed”, what changed exactly? What are your future plans for linuxdoc?

@return42
Copy link
Owner

However, it breaks compatibility with what’s is in the kernel tree, not sure it’s right.
By the way, you said that “something in kernel’s doc-build chain has been changed”, what changed exactly?

Linuxdoc was not made to compile linux's kernel documentation (see below).

When I started the project, the linux build chain to build the docs was simple but today there are a lot of perl scripts needed to do some "pre-compile" stuff and handle tasks that are typical for the kernel project but not for a common project (kernel development is special). E.g. the media tree needs some of these perl scripts and the sphinx command is very sprawling --> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/Makefile#n75

Today, if one wants a different theme for the kernel docs, I recommend to patch the sphinx theme in the kernel.

What are your future plans for linuxdoc?

I don't have any concrete plans ... except fixing the sphinx C domain issues when sphinx has consolidated it.

The kernel-doc markup (and the man builder) is just one feature of the linuxdoc package, other topics are Scalable figure and image handling or diff friendly table markup. I use this sphinx extensions in many projects.

It would be also nice to have an option in conf.py to set the srctree.

If I have time, I will add it ...

@schodet
Copy link
Contributor Author

schodet commented Mar 29, 2021

Thanks, I think the ticket can be closed.

About adding the option, I will give it a try.

@schodet schodet closed this as completed Mar 29, 2021
@schodet
Copy link
Contributor Author

schodet commented Mar 30, 2021

I opened #9 for the configuration item.

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

No branches or pull requests

2 participants