Thanks, Luc.

I had that idea, too.  It works sometimes but not every time.  Do you
suppose that workaround is undermined by imports and __init.py__ scripts,
where the imported objects have docstrings instead of line comments?

Tom

On Fri, Mar 7, 2025 at 4:47 AM Luc Saffre <luc.saf...@gmail.com> wrote:

> You should write your copyright notice as a comment (a # before each line)
> and not as a docstring. Because the module-level docstring is expected to
> contain a general description of your module.
>
> On Friday, 7 March 2025 at 01:49:54 UTC+2 Tom Diaz wrote:
>
>> We recently noticed that for every module of ours that we document with
>> the automodule directive,  Sphinx picks up a copyright string if it's in
>> the same file.
>>
>> For example, consider a module named whatever.py:
>>
>> """
>> Copyright (C) 2023 My Company, Inc.
>> """
>> .
>> .
>> class MyWorstNightmare:
>> """
>> This class contains test facilities to avoid serious problems:
>> *"""*
>>
>> Automodule will pick up the docstring "This class..." but also will stick
>> the copyright notice at the top of the generated document.
>>
>> That isn't a behavior we want, because the code being documented may have
>> a copyright notice a couple of years old, and we don't want readers to
>> confuse it with the copyright of the book that includes the automodule text.
>>
>> Is there a way to stop or work around this behavior?
>>
>> Thanks,
>> Tom
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sphinx-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sphinx-users/NDZ4-kMVQHM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sphinx-users+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/sphinx-users/cc2b0854-704f-405b-a5d8-ec405fecf6d5n%40googlegroups.com
> <https://groups.google.com/d/msgid/sphinx-users/cc2b0854-704f-405b-a5d8-ec405fecf6d5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
_______________________
Thomas R. Díaz
13 Lois Lane
Lexington, Massachusetts 02420
Text: (781) 454-9946

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sphinx-users/CAMFDu-Gt3dRsKuVVVBSVd%3Dyg36vYRzdBzYFi%2BpVzvrfQoTgGfw%40mail.gmail.com.

Reply via email to