From Nate:
I think there's 2.5 approaches we can do here:
- Add a properties button to manipulate the ID of an element
- Automagically generate a unique ID for each heading on the page
- Do both
Referencing: https://github.com/elliotlewis/Redactor-Extras#properties
This would grant the most control. You could do this for any element (in theory, though it might have limits depending on what Redactor gives us access to)
Estimated effort: 1-1.5 hours. We should reference the plugin we already made for resource links for how to manipulate the HTML.
Every heading (h1, h2, h3, etc...) could receive a unique ID.
This could be the text for the page, or we could do something like #section-<number>. This would grant less control since the process is automatic, but it would happen without needing to manually do it every time you wanted to link to something.
Estimated effort: 2-3 hours. We already do some HTML manipulation in the text component to compute resource links from global identifiers, we could add a pass that searches for headers and adds unique ids.
In addition to the approaches above, we could do both: add the ability to set an ID property on an HTML attribute, then automatically generate IDs for headings. If an ID has already been specified by an admin, we won't automatically change it.
Estimated effort: 1-1.5 hours (in addition to the effort for the other approaches)
