Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 373145 - devmanual's eclass section should document and provide examples documentation tags
Summary: devmanual's eclass section should document and provide examples documentation...
Status: IN_PROGRESS
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Devmanual Team
URL: http://devmanual.gentoo.org/eclass-wr...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2011-06-26 19:33 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2022-03-16 02:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-eclass-writing-add-Documenting-Eclasses-section-and-.patch (0001-eclass-writing-add-Documenting-Eclasses-section-and-.patch,4.14 KB, patch)
2016-06-02 15:04 UTC, Michael Orlitzky
Details | Diff
0002-eclass-writing-add-documentation-to-the-first-existi.patch (0002-eclass-writing-add-documentation-to-the-first-existi.patch,1.86 KB, patch)
2016-06-02 15:05 UTC, Michael Orlitzky
Details | Diff
0003-eclass-writing-add-documentation-to-the-incorrect-us.patch (0003-eclass-writing-add-documentation-to-the-incorrect-us.patch,1.15 KB, patch)
2016-06-02 15:05 UTC, Michael Orlitzky
Details | Diff
0004-eclass-writing-add-documentation-to-the-build-system.patch (0004-eclass-writing-add-documentation-to-the-build-system.patch,2.20 KB, patch)
2016-06-02 15:05 UTC, Michael Orlitzky
Details | Diff
Improve the text with tables (eclass-writing-improve-the-eclass-documentation-sect.patch,11.95 KB, patch)
2016-10-30 00:37 UTC, Göktürk Yüksek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2011-06-26 19:33:33 UTC
For example, the URL points to a section of and eclass example which has the following:

    # domacosapp: install a macos .app file. Usage is 'domacosapp file' or
    # 'domacosapp file newfile'.

    domacosapp() {
    ...

This I think should be:

    # @FUNCTION: domacosapp
    # @USAGE: file [newfile]
    # @DESCRIPTION: Install a macos.app file.

It would also be nice if it could mention which @<TAG>s are allowed where. I.e., I noticed that @EXAMPLE for a @FUNCTION doesn't get outputted into the eclass's manpage by app-portage/eclass-manpages-20100821 so it appears not to be allowed for functions but to be allowed for the eclass's header's docs.

(I hope I filed this bug at the right place...)
Comment 1 Michael Orlitzky gentoo-dev 2016-06-02 15:04:43 UTC
Created attachment 436186 [details, diff]
0001-eclass-writing-add-Documenting-Eclasses-section-and-.patch
Comment 2 Michael Orlitzky gentoo-dev 2016-06-02 15:05:00 UTC
Created attachment 436188 [details, diff]
0002-eclass-writing-add-documentation-to-the-first-existi.patch
Comment 3 Michael Orlitzky gentoo-dev 2016-06-02 15:05:22 UTC
Created attachment 436190 [details, diff]
0003-eclass-writing-add-documentation-to-the-incorrect-us.patch
Comment 4 Michael Orlitzky gentoo-dev 2016-06-02 15:05:47 UTC
Created attachment 436192 [details, diff]
0004-eclass-writing-add-documentation-to-the-build-system.patch
Comment 5 Michael Orlitzky gentoo-dev 2016-06-02 15:06:39 UTC
I added a section about the documentation format, gave examples of the correct headers, and then went back and fixed all of the existing examples.
Comment 6 Göktürk Yüksek archtester gentoo-dev 2016-10-30 00:37:11 UTC
Created attachment 451901 [details, diff]
Improve the text with tables

Here's the take two in enhancing the text with tables: http://dev.gentoo.org/~gokturk/devmanual/bug373145/eclass-writing/index.html
Comment 7 Michael Orlitzky gentoo-dev 2016-10-30 02:01:15 UTC
(In reply to Göktürk Yüksek from comment #6)
> Created attachment 451901 [details, diff] [details, diff]
> Improve the text with tables
> 
> Here's the take two in enhancing the text with tables:
> http://dev.gentoo.org/~gokturk/devmanual/bug373145/eclass-writing/index.html

Thanks again for your work on this. I really like the overall layout. I have a few nitpicky suggestions, but feel free at any point to commit what you have and tell me to send a patch for the additional stuff.

1. Documenting Eclasses

   a. Instead of"empty new lines", I would call them "blank lines".
   b. Pick one of "elements" or "entities" and stick with it.
   c. The @CODE part is too hard to understand, but see #2 below.


2. Add an example for the @CODE tag. Once there's an example (and I can see how to use it), I might be able to come up with a better description for the "Documenting Eclasses" paragraph.

3. Since we're recommending that eclasses die in EAPIs that they don't support, it would be helpful to add such a check at the beginning of the existing example eclasses. People copy/paste examples more readily than they read the manual.

4. Some "which"es could be "that"s. I know this is pedantic, so I'll quote someone else (Knuth, Mathematical Writing):

  Which brings us to our next issue: Are whiches that could be thats always
  wrong? Don [Knuth] said that now that he knows the rules, he finds every
  "wicked which" an irritating distraction from his reading enjoyment. He
  seemed to imply that whiches in restrictive clauses are always wrong.

Basically, if you can change "which" to "that", then do it -- it will sound better.

5. An example with more than one author would help clarify how they go on separate lines.

6. The concept of "return value" in bash is a little murky... I suspect that @RETURN should also document any output from the function, but we can deal with this some other time.

7. Add examples of @ECLASS-VARIABLE and @VARIABLE.


What you have is already a huge improvement, so I don't want to hold this up forever trying to make it perfect. It's OK to commit something 90% there (but still an improvement) and then fix it up afterwards. I can send patches for most of the above if you like.
Comment 8 Göktürk Yüksek archtester gentoo-dev 2016-10-31 01:24:49 UTC
(In reply to Michael Orlitzky from comment #7)
> (In reply to Göktürk Yüksek from comment #6)
> > Created attachment 451901 [details, diff] [details, diff] [details, diff]
> > Improve the text with tables
> > 
> > Here's the take two in enhancing the text with tables:
> > http://dev.gentoo.org/~gokturk/devmanual/bug373145/eclass-writing/index.html
> 
> Thanks again for your work on this. I really like the overall layout. I have
> a few nitpicky suggestions, but feel free at any point to commit what you
> have and tell me to send a patch for the additional stuff.
> 
> 1. Documenting Eclasses
> 
>    a. Instead of"empty new lines", I would call them "blank lines".
Done.

>    b. Pick one of "elements" or "entities" and stick with it.
Elements sounded better.

>    c. The @CODE part is too hard to understand, but see #2 below.
I left this as is for now though I agree with the assessment.

> 
> 
> 2. Add an example for the @CODE tag. Once there's an example (and I can see
> how to use it), I might be able to come up with a better description for the
> "Documenting Eclasses" paragraph.
> 
> 3. Since we're recommending that eclasses die in EAPIs that they don't
> support, it would be helpful to add such a check at the beginning of the
> existing example eclasses. People copy/paste examples more readily than they
> read the manual.
> 
It could also help with people treating EAPIs as integers.

> 4. Some "which"es could be "that"s. I know this is pedantic, so I'll quote
> someone else (Knuth, Mathematical Writing):
> 
>   Which brings us to our next issue: Are whiches that could be thats always
>   wrong? Don [Knuth] said that now that he knows the rules, he finds every
>   "wicked which" an irritating distraction from his reading enjoyment. He
>   seemed to imply that whiches in restrictive clauses are always wrong.
> 
> Basically, if you can change "which" to "that", then do it -- it will sound
> better.
> 
Some of the whiches have been eliminated.

> 5. An example with more than one author would help clarify how they go on
> separate lines.
> 
> 6. The concept of "return value" in bash is a little murky... I suspect that
> @RETURN should also document any output from the function, but we can deal
> with this some other time.
> 
I think if there's no return value, the output can be explained in @DESCRIPTION instead.

> 7. Add examples of @ECLASS-VARIABLE and @VARIABLE.
> 
> 
> What you have is already a huge improvement, so I don't want to hold this up
> forever trying to make it perfect. It's OK to commit something 90% there
> (but still an improvement) and then fix it up afterwards. I can send patches
> for most of the above if you like.

Merged in https://github.com/gentoo/devmanual.gentoo.org/compare/092cc15...9623823 We still need to add the enhancements we speak of.
Comment 9 Ulrich Müller gentoo-dev 2020-01-23 11:55:17 UTC
(In reply to Göktürk Yüksek from comment #8)
> Merged in
> https://github.com/gentoo/devmanual.gentoo.org/compare/092cc15...9623823
> We still need to add the enhancements we speak of.

Are you going to follow up on this, or can this bug be closed?
Comment 10 Göktürk Yüksek archtester gentoo-dev 2020-01-27 21:18:18 UTC
Based on my re-reading of the bug, here are the missing enhancements:

2. Add an example for the @CODE tag. Once there's an example (and I can see how to use it), I might be able to come up with a better description for the "Documenting Eclasses" paragraph.

3. Since we're recommending that eclasses die in EAPIs that they don't support, it would be helpful to add such a check at the beginning of the existing example eclasses. People copy/paste examples more readily than they read the manual.
   (although somewhat addressed by 4ada72fc43918e1d8d652deb9e5f0d1e060a36ef)

5. An example with more than one author would help clarify how they go on separate lines.

7. Add examples of @ECLASS-VARIABLE and @VARIABLE.

I also see that the examples need a large overhaul (they still have "$Id$" in the header). I think this bug is still relevant and worth keeping open. I have no time frame for fixing it though.
Comment 11 Michael Orlitzky gentoo-dev 2020-01-28 20:52:30 UTC
(In reply to Göktürk Yüksek from comment #10)
> Based on my re-reading of the bug, here are the missing enhancements:

I think it would be helpful to split these into separate bugs, so that they can  individually be fixed by someone with a few hours but not a whole week of free time.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-03-16 02:46:56 UTC
FWIW, I did somewhat start to address this (the examples not so much) a while ago, as did ulm:

commit cd392d0c6cd064ac3a1381111e678f4fe111afcc
Author: Ulrich Müller <ulm@gentoo.org>
Date:   Thu Sep 2 17:36:26 2021 +0200

    eclass-writing: @DEAD must be the first tag

    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

commit b691f696abfbc33a4e3f3bea2100ebc466c24e6b
Author: Ulrich Müller <ulm@gentoo.org>
Date:   Thu Sep 2 09:54:21 2021 +0200

    eclass-writing: More documentation tags

    @SUBSECTION, @SUPPORTED_EAPIS, @PROVIDES, and @DEPRECATED.

    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

commit 336d16aa5fe8c564a15760659e1670a0e98e58b3
Author: Sam James <sam@gentoo.org>
Date:   Mon Mar 22 06:56:29 2021 +0000

    eclass-writing: add new eclass doc tags for Eclass Function Variables

    Adds:
    * @USER_VARIABLE
    * @INCLUDES_EPREFIX
    * @DEPRECATED

    Signed-off-by: Sam James <sam@gentoo.org>
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

commit b80285bdc37a51a2628bf4b7edd44717c15062cb
Author: Sam James <sam@gentoo.org>
Date:   Mon Mar 22 06:44:06 2021 +0000

    eclass-writing: add new eclass doc tags for Eclass Functions

    Adds:
    * @INCLUDES_EPREFIX
    * @DEPRECATED

    Signed-off-by: Sam James <sam@gentoo.org>
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

commit 3d47a2bc63aec2ac36b63eae6b84905487f6ddd6
Author: Sam James <sam@gentoo.org>
Date:   Mon Mar 22 06:37:51 2021 +0000

    eclass-writing: add new eclass doc tags for Eclass Variables

    Adds:
    * @PRE_INHERIT
    * @USER_VARIABLE
    * @OUTPUT_VARIABLE
    * @INCLUDES_EPREFIX
    * @DEPRECATED

    Signed-off-by: Sam James <sam@gentoo.org>
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

... but the rest of the points here seem to remain.

I agree with mjo that separate bugs should exist for those suggestions.