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

The [algorithm] attribute should produce class="algorithm" in the output #759

Closed
jyasskin opened this issue Jul 20, 2016 · 3 comments
Closed

Comments

@jyasskin
Copy link
Collaborator

If I write:

<div algorithm>
  <p><dfn>some algorithm</dfn> must do the following steps:</p>
  <ol>
    <li>step 1
      <ol><li>step 1.1</li></ol>
    </li>
  </ol>
</div>

I should get the same formatting I'd get if I'd used <ol class="algorithm">.

The stylesheet already supports this with a

    ol.algorithm ol:not(.algorithm),
    .algorithm > ol ol:not(.algorithm) {

selector.

@mikewest
Copy link
Contributor

I want that style. :(

The specs I've worked on generally have followed the following pattern:

<h3 algorithm>Should |block| be considered an algorithm?</h3>

Given an element (|block|), the following algorithm returns
"`Algorithm`" or "`Not Algorithm`".

1.  If |block| is algorithmic enough, return "`Algorithm`".

2.  Return "`Not Algorithm.`"

The algorithm is implicitly ended by the next h* of the right level. It would be nice if we could somehow support this kind of syntax as well. I'd prefer not to add wrapper elements to the source just for styling...

@tabatkins
Copy link
Collaborator

tabatkins commented Jul 29, 2016

@jyasskin Done. The algorithm attribute now causes the generation of an algorithm class on the element.

@mikewest That's just a little bit too magic for me; I'm not sure that I want to automatically assume that all OLs inside of an algorithm section are the algorithm steps. That said, I just added a feature I've been planning for a while: you can manually specify the list container for markdown lists. Like:

<ol class=foo>
    1. first
    2. second
</ol>

This will use the OL you specified, rather than generating one automatically. So you'll be able to wrap your list accordingly, and won't have an extraneous wrapper element cluttering things.

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

No branches or pull requests

3 participants