Skip to content

add 'bare-anchors style property #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevebyan
Copy link
Contributor

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.

@mflatt
Copy link
Member

mflatt commented Jun 26, 2025

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.)

@stevebyan
Copy link
Contributor Author

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 stevebyan marked this pull request as draft July 15, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants