sschwarzer
2022-5-21 21:05:09

I’d like to be able to open the Racket glossary <https://github.com/sschwarzer/racket-glossary> with raco docs racket-glossary .

I installed the package with raco pkg install git+<https://github.com/sschwarzer/racket-glossary> and can list the package with raco pkg show -l

raco docs racket-glossary opens the Racket documentation search, but doesn’t find anything. The help for raco docs --help says the syntax is raco docs [ &lt;option&gt; ... ] [&lt;search-terms&gt;] ...

I guess normally search terms are defined implicitly when describing an API, but the Racket glossary doesn’t have an API. What’s the recommended way to define a search term so that raco docs works?


sschwarzer
2022-5-21 21:08:43

Or is there a better way to open the documentation?

The background is that I don’t want to publish the glossary as a package as long as it has so few entries, but I want to explain users how they can install and view the current version from Github.

Of course you can open the generated HTML documentation by opening the file in a webbrowser, but it would be easier to use raco docs instead of describing where the file can be found.


sorawee
2022-5-21 21:10:55

Two things:

• The keyword that you should use is either “Glossary of Racket concepts” or “glossary” (where “glossary” is the file name of your Scribble file) • If you want additional keyword, I think you can do that by using section-index.


sschwarzer
2022-5-21 21:28:36

Yes, I’d like something more specific than “glossary”, and the whole title is cumbersome to type. Thanks to your help, I created the index entry with @section-index{racket-glossary}

Now, raco docs racket-glossary opens the search results page with the “racket-glossary” term.

Is there a way to open the found page directly if there’s only one search hit?


sorawee
2022-5-21 21:29:40

AFAIK, no. Feel free to hack JS to improve it.


sschwarzer
2022-5-21 21:30:04

Thanks, but no thanks. :smile:


sschwarzer
2022-5-21 21:30:39

But thanks for section-index, of course. :slightly_smiling_face:


sorawee
2022-5-21 21:32:03

Another possibility is to rename your scribble file, in case that was not clear


sschwarzer
2022-5-21 21:40:34

No, it actually wasn’t clear. I thought the possibility of using glossary came from the word “Glossary” in the document title.


sorawee
2022-5-21 21:40:50

really?!?


sschwarzer
2022-5-21 21:41:21

I said, I thought that, I didn’t say it was actually the case.


sorawee
2022-5-21 21:41:58

When you changed the file name, did you update info.rkt as well?


sschwarzer
2022-5-21 21:44:06

My experiments so far were with the scribblings/glossary.scrbl filename. The info.rkt contains

#lang info (define collection "racket-glossary") (define deps '("base")) (define build-deps '("scribble-lib" "racket-doc" "rackunit-lib")) (define scribblings '(("scribblings/glossary.scrbl" ()))) (define pkg-desc "Glossary of Racket concepts") (define version "0.1.0-dev") (define pkg-authors '(sschwarzer)) (define license '(Apache-2.0 OR MIT))


sorawee
2022-5-21 21:45:01

ohhh!


sorawee
2022-5-21 21:45:10

Let me clear up something that I just realized


sorawee
2022-5-21 21:45:22

When you said “No, it actually wasn’t clear.“, I didn’t read carefully


sorawee
2022-5-21 21:45:35

When I saw the word “No”, I thought you meant “No, it doesn’t work”


sschwarzer
2022-5-21 21:46:17

I had added (edited) the word “clear” in after you were confused because I thought I wasn’t clear in my answer.


sorawee
2022-5-21 21:46:45

lolol


sorawee
2022-5-21 21:46:49

unclear-ception


sschwarzer
2022-5-21 21:48:47

My understanding is that glossary.scrbl as filename is specific enough because it’s in the racket-glossary collection (and therefore kind of “namespace”). I don’t want to hijack the “glossary” term for all the Racket documentation. :slightly_smiling_face: If needed, I’d change the file name from glossary.scrbl to racket-glossary.scrbl if you think it’s advisable.


sorawee
2022-5-21 21:49:20

yeah, all Scribble file names share one single namespace


sschwarzer
2022-5-21 21:49:50

I guess I should change it to racket-glossary.scrbl then!


sorawee
2022-5-21 21:49:54

A lot of people named the file “manual.scrbl” and there are a lot of conflicts


sorawee
2022-5-21 21:50:04

Another possibility, actually, is to adjust info.rkt


sschwarzer
2022-5-21 21:50:16

Adjust in which way?


sorawee
2022-5-21 21:50:42

The scribblings entry has a couple of options to adjust the name. I don’t recall exactly how to do it. You need to look it up


sschwarzer
2022-5-21 21:51:11

Then it’s probably more straightforward to change the file name, I guess?


sorawee
2022-5-21 21:51:19

Yeah, sure


sschwarzer
2022-5-21 21:51:34

Thanks a lot, will do. :+1: