scribble icon indicating copy to clipboard operation
scribble copied to clipboard

add 'bare-anchors style property

Open stevebyan opened this issue 7 months ago • 2 comments

Add a 'bare-anchors style property that causes the html renderer to omit the "Link to here" hover links on titles and section headers. This just leaves the bare anchor tag, without the "Link to here" decoration.

This change removes the need for CSS to hide the link and disclose it only during a mouser hover. A user can still obtain a link to the title or section from the Table of Contents sidebar.

This change facilitates the use of Scribble html output in contexts other than Racket documentation.

stevebyan avatar May 28 '25 21:05 stevebyan

As implemented here, the bare-anchors? parameter looks unnecessary. The (part-style? d 'bare-anchors) check could be moved to render-part-content where (bare-anchors?) is used, right?

However, I think it would make sense for bare-anchors? to apply to all subparts, instead of just the immediate part, and then it only needs to be set at the top of a document to disable anchors everywhere. In that case, the parameter is useful, but it would need to be parameterized as [bare-anchors? (or (bare-anchors?) (part-style? d 'bare-anchors))].

Am I following correctly? Does automatically propagating 'bare-anchors to subparts seem like a good idea?

(Minor: there should be a history note for this change with a bump to the scribble-lib version number.)

mflatt avatar Jun 26 '25 13:06 mflatt

As implemented here, the bare-anchors? parameter looks unnecessary. The (part-style? d 'bare-anchors) check could be moved to render-part-content where (bare-anchors?) is used, right?

My first cut was to implement this as a command-line option that applied globally. But yeah, I should implement the style as something that can be applied locally.

However, I think it would make sense for bare-anchors? to apply to all subparts, instead of just the immediate part, and then it only needs to be set at the top of a document to disable anchors everywhere. In that case, the parameter is useful, but it would need to be parameterized as [bare-anchors? (or (bare-anchors?) (part-style? d 'bare-anchors))].

Am I following correctly? Does automatically propagating 'bare-anchors to subparts seem like a good idea?

That was my intent. I didn't consider the possibility that someone would want to use it case-by-case.

(Minor: there should be a history note for this change with a bump to the scribble-lib version number.)

Thanks. I should update the docs, too.

stevebyan avatar Jul 15 '25 19:07 stevebyan