chapel icon indicating copy to clipboard operation
chapel copied to clipboard

[Documentation]: Improve module descriptions in module index

Open Guillaume-Helbecque opened this issue 1 year ago • 6 comments

For some modules, the description in the module index is odd: it's either (1) the first line of the copyright (e.g., BlockCycDist, HashedDist), (2) an incomplete sentence (e.g., ChplFormat, JSON), or (3) empty (e.g., BlockCycDim, BlockDim).

odd-description

For (1) and (2), something wrong may occur in the way the "module index generator" parses the description of the modules. A partial fix for (1) is to add any comment using // .... after the copyright. However, I think it's more appropriate to solve the root cause.

Guillaume-Helbecque avatar Jul 30 '24 13:07 Guillaume-Helbecque

Yeesh, thanks for pointing this out, @Guillaume-Helbecque!

bradcray avatar Aug 12 '24 18:08 bradcray

To explain what's going on here, I'm fairly certain that the first line of the comment preceding the file's module declaration is used as its index entry, so in cases like BlockCycDist.chpl, only the standard copyright header precedes the module declaration, so that gets used; while for cases where the description is missing (which may be better than some other random, unintended line).

Perhaps now that we have attributes, we should really have some more intentional way of providing this line, like @chpldoc.indexSummary("Here's what this module does") but in the meantime, it'd be nice to fix at least some of the more broken cases, where obvious owners (to propose text at least, if not implement it) might be:

  • [x] BlockCycDist.chpl: me
  • [x] ChplFormat.chpl: @benharsh
  • [x] Debugger.chpl: @jabraham17
  • [x] DistributedBag.chpl: @Guillaume-Helbecque
  • [x] HashedDist.chpl: @mppf
  • [x] Image.chpl: @jabraham17
  • [x] JSON.chpl: @benharsh
  • [x] LayoutCS.chpl: me
  • [x] ObjectSerialization.chpl: @benharsh
  • [x] OS.chpl: needs a volunteer, author retired
  • [x] POSIX.chpl: ditto
  • [x] PrecisionSerializer.chpl: @jeremiah-corrado
  • [x] PrivateDist.chpl: ditto
  • [x] WeakPointer.chpl: @jeremiah-corrado
  • [x] Zarr.chpl: @brandon-neth

bradcray avatar Aug 12 '24 22:08 bradcray

Tagging @benharsh , @jeremiah-corrado , @brandon-neth separately since I accidentally saved my comment before completing it and am never sure whether @-notifications work when editing.

bradcray avatar Aug 12 '24 22:08 bradcray

I will open a PR to fix Image and Debugger this morning.

I can also take on the OS and POSIX modules

edit: PR opened here

jabraham17 avatar Aug 13 '24 13:08 jabraham17

@jeremiah-corrado : Missed this on the first pass, but I think PrecisionSerializer.chpl needs its first line condensed as well.

bradcray avatar Aug 16 '24 23:08 bradcray

Docs for JSON, ChplFormat, and ObjectSerialization: https://github.com/chapel-lang/chapel/pull/25774

benharsh avatar Aug 17 '24 01:08 benharsh

Taking stock of where we are here, I think that I was mistakenly looking at the 2.1 docs rather than the main docs when creating the checklist above, as Zarr is looking correct to me now that I'm looking at main. Sorry for the false alarm, @brandon-neth!

With that, I think that #25773 will complete this issue.

[edit: Note that some entries still do not have descriptions, but I wasn't as worried about those as ones that were cut off mid-sentence, took up multiple lines, or contained unintentional content (like the copyright)].

bradcray avatar Aug 23 '24 16:08 bradcray

@bradcray You were not mistaken, I snuck it in with my compressor PR. Sorry I didn't update you here!

brandon-neth avatar Aug 23 '24 16:08 brandon-neth

With #25773 merged, I think we're in much better shape here. Thanks for reporting this, @Guillaume-Helbecque and for the rapid response @brandon-neth , @benharsh , @Guillaume-Helbecque , @jeremiah-corrado , @mppf, and anyone else I've missed.

I've opened #25814 with a feature request (for chpldoc?) to specify these module index descriptions more explicitly using an attribute in hopes that it would help to avoid such issues going forward.

bradcray avatar Aug 26 '24 17:08 bradcray