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

Disable the auto-generation of section IDs ? #668

Open
lcawl opened this issue Mar 5, 2019 · 8 comments
Open

Disable the auto-generation of section IDs ? #668

lcawl opened this issue Mar 5, 2019 · 8 comments
Labels
asciidoc Asciidoc and our Asciidoctor extensions defer enhancement Something we'd like to improve team-discuss

Comments

@lcawl
Copy link
Contributor

lcawl commented Mar 5, 2019

While reviewing the differences between the old and new (Asciidoctor) output for #666, we noticed that there are a lot of autogenerated section IDs. For example:
<a id="_fix_split_brain_can_occur_even_with_minimum_master_nodes_status_done_v1_4_0_beta1">
<a id="_using_lucene_checksums_to_verify_shards_during_snapshot_restore_status_done_v1_3_3">

Per https://asciidoctor.org/docs/user-manual/#auto-generated-ids, you can disable the auto-generation of section IDs, by unsetting the sectids attribute.

Should we consider doing this? It would mean that if we want to be able to link to a section, we'd have to explicitly add an anchor, which is what we had discussed as a best practice anyway.

If we do want to do this, would then want to consider whether we do it for all books or a subset.

Related to #647

@nik9000
Copy link
Member

nik9000 commented Mar 6, 2019

I had a thought on this topic this morning. I wonder if we should keep generating the ID but detect when someone is linking to them and float some text on the screen explaining that the ID isn't permanent but that they can open a PR to make a permanent ID. Since most of our docs are public this is a thing that folks outside of Elastic the company can do. That way we can know that any non-auto-generated IDs are there for some reason. We can even git blame to figure out who made them.

@lcawl
Copy link
Contributor Author

lcawl commented Mar 6, 2019

If that's feasible, it sounds pretty magical

@nik9000
Copy link
Member

nik9000 commented Mar 7, 2019

If that's feasible, it sounds pretty magical

We'd have to use a heuristic to detect if an ID was auto-generated or not. So long as the heuristic is good I think we can do it. And I think "does it start with _ is a good heuristic. We could also fail the docs build if you declare any IDs that start with _ and tell you that those look too much like auto-generated-ids. At least, we can do that in Asciidoctor.

@nik9000
Copy link
Member

nik9000 commented Mar 7, 2019

@dedemorton mentioned today that page names also come from the IDs. I hadn't really thought of that for #668 (comment) . My point in that issue was about the ids on the page, not the ids that turn into the page's name. I think we 100% should make folks specify the name of every page.

Another point from @nrichers an @kellyemurphy: some of our docs won't have an edit link because they are private. They'll need different language about how to ask to make the link real. Assuming we do want to generate these at all.

@debadair debadair added the enhancement Something we'd like to improve label Sep 24, 2019
@debadair
Copy link
Contributor

We absolutely should avoid generating pages with automatically generated IDs. Magic would be nice, but disabling them would at least keep from perpetuating the problem.

@nik9000
Copy link
Member

nik9000 commented Sep 25, 2019 via email

@dedemorton
Copy link
Contributor

We absolutely should avoid generating pages with automatically generated IDs.

Agreed. I suspect that most of these were fixed during the migration to asciidoctor. I think we should allow auto-generated section IDs, though, unless Nik can create a script that we can run against the docs...or hire an intern. I never want to have to backport to 25 branches ever again.

@nik9000
Copy link
Member

nik9000 commented Sep 25, 2019 via email

@gtback gtback added the asciidoc Asciidoc and our Asciidoctor extensions label May 14, 2020
@gtback gtback added the defer label Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asciidoc Asciidoc and our Asciidoctor extensions defer enhancement Something we'd like to improve team-discuss
Projects
None yet
Development

No branches or pull requests

5 participants