Skip to content
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

docs: Add anchors to each setting's name in settings.html for direct linking #36733

Closed
rmloveland opened this issue Apr 10, 2019 · 2 comments · Fixed by #38923
Closed

docs: Add anchors to each setting's name in settings.html for direct linking #36733

rmloveland opened this issue Apr 10, 2019 · 2 comments · Fixed by #38923
Labels
A-docs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-easy Easy issue to tackle, requires little or no CockroachDB experience good first issue

Comments

@rmloveland
Copy link
Collaborator

In the docs, we'd like to be able to link to specific settings, as discussed during the review on cockroachdb/docs#4635

It can be done by manually adding anchors to the settings file copy in the docs repo. However, that file is auto-generated in this repo and then copied over periodically, so making edits via the docs repo would lead to conflicts that would need to be manually tracked and resolved.

Therefore this feature request is to add anchor tags to each setting in docs/generated/settings/settings.html so they can be linked to directly in the documentation. A solution (verified to work in the PR linked above) would be to add an anchor with the same name as the setting, e.g.

<tr><td><a name="sql.stats.automatic_collection.min_stale_rows"></a><code>sql.stats.automatic_collection.min_stale_rows</code></td><td>integer</td><td><code>500</code></td><td>target minimum number of stale rows per table that will trigger a statistics refresh</td></tr>
@awoods187 awoods187 added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Apr 22, 2019
@rmloveland rmloveland added E-easy Easy issue to tackle, requires little or no CockroachDB experience good first issue labels Jun 24, 2019
@kenliu kenliu added the A-docs label Jul 12, 2019
@arberiii
Copy link
Contributor

How is settings.html file generated?

I found this line (https://github.com/cockroachdb/cockroach/blob/master/pkg/cmd/docgen/funcs.go#L218) which may be used to generate it but was not sure.

@rmloveland
Copy link
Collaborator Author

That looks like the place!

I think adding an anchor link somewhere in the tr might do it, e.g., something like the following (untested) code:

s := fmt.Sprintf("<tr><td><a name="%s"></a><code>%s(%s) &rarr; %s</code></td><td>%s</td></tr>", name, name, linkArguments(args), linkArguments(ret), extra)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-easy Easy issue to tackle, requires little or no CockroachDB experience good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants