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

Section ID should include the icon class #691

Closed
xcoulon opened this issue Jul 5, 2020 · 2 comments · Fixed by #730
Closed

Section ID should include the icon class #691

xcoulon opened this issue Jul 5, 2020 · 2 comments · Fixed by #730
Assignees
Milestone

Comments

@xcoulon
Copy link
Member

xcoulon commented Jul 5, 2020

For example:

== icon:warning[] or what icon:note[] to do

should render as

<div class="sect1">
<h2 id="_warning_or_what_note_to_do"><span class="icon">[warning]</span> or what <span class="icon">[note]</span> to do</h2>
<div class="sectionbody">

</div>
</div>

(note the id="_warning_or_what_note_to_do" in the <h2> element)

@xcoulon xcoulon added this to the v0.5.0 milestone Jul 5, 2020
@gdamore
Copy link
Collaborator

gdamore commented Jul 5, 2020

I actually think that we should probably create an interface, for stuff like this, so that renderElementID can look at the elements, and get the "elementID" portion from that element, and concatenate them together.

Right now our forest of element types has no common API, which is probably somewhat unfortunate.

I'm also thinking that instead of creating local custom types in the render at the call site, we could actually have local types that implement a "Render" method. E.g.

// in the SGML or HTML packages...

type Table = types.Table

func (t Table) Render() (string, error) { .... }

Attribute substitution and expansion (intermediate parsing) might also be handled in a similar way.

This probably deserves a bit (ok a lot) more thought.

@gdamore
Copy link
Collaborator

gdamore commented Jul 13, 2020

Actually what about images -- should they pick up the alt text?

And what about if the icon has an alternate text (alt) applied?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants