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

Markup for examples with parts #178

Open
sean-fitzpatrick opened this issue May 12, 2022 · 4 comments
Open

Markup for examples with parts #178

sean-fitzpatrick opened this issue May 12, 2022 · 4 comments

Comments

@sean-fitzpatrick
Copy link
Collaborator

In #177 I've updated a number of <ol> environments that were using label="a" because the syntax has changed to marker="a".

But do we want to use ol at all for examples with multiple parts? Or should we restructure with task? (This is probably a question for @Alex-Jordan )

Right now we have a lot of examples structured like:

<example>
  <statement>
    <p>
      Do the following things:
    </p>
    <p>
      <ol marker="a">
        <li>The first thing</li>
        <li>The last thing</li>
      </ol>
    </p>
  </statement>
  <solution>
    <p>
      <ol marker="a">
        <li>
          <p>
            Solution to the first thing
          </p>
        </li>
        <li>
          <p>
            Solution to the last thing
          </p>
        </li>
      </ol>
    </p>
  </solution>
</example>

Would it make more sense for these to be written like this? Or should we keep things as they are?

<example>
  <introduction>
    <p>
      Do the following things:
    </p>
  </introduction>
  <task>
    <statement>
      <p>
        The first thing
      </p>
    </statement>
    <solution>
      <p>
        Solution to the first thing
      </p>
    </solution>
  </task>
  <task>
    <statement>
      <p>
        The last thing
      </p>
    </statement>
    <solution>
      <p>
        Solution to the last thing
      </p>
    </solution>
  </task>
</exercise>
@sean-fitzpatrick
Copy link
Collaborator Author

Follow-up question for someone (like @Alex-Jordan or @davidfarmer) who is better at scripting and regex than me:

if we want to make this change throughout the book, how hard would it be to do it semi-automatically?

@Alex-Jordan
Copy link
Collaborator

If it's high enough on the list of things to do, then I think such things should be structured with task, in general. I am unsure how good an idea it would be to automate converting them all. Occasionally, if the list within an example really is just a list (as opposed to a sequence of multiple sub-exercises), it should stay that way.

If I wanted to automate that anyway, I wouldn't feel comfortable doing it with text, regex, etc. Instead I'd try to use XSL. Start with an identity stylesheet that leaves everything alone. Then change how it acts towards example elements that have a statement that contains an ol. And you'd have to apply that stylesheet to each of the .ptx section files one at a time, not to the root file. And after doing all that, carefully review a diff for quality control.

@sean-fitzpatrick
Copy link
Collaborator Author

Yeah, thinking about it for awhile, I don't think I could do this without messing it up.
I'm going to look to see just how many of these there are.

@sean-fitzpatrick
Copy link
Collaborator Author

There are 93 examples that have parts in an ol. 69 of these have videos.

I'm probably not getting that done in a day!

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

2 participants