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

update/fix xrefs in derived classes section #770

Merged
merged 6 commits into from
Oct 1, 2024

Conversation

wrigjl
Copy link
Contributor

@wrigjl wrigjl commented Sep 30, 2024

This is a replacement for #767, but updated to the current master. Please apply and try a build before merging. Please send along the pretext output if it fails (I've built it twice with pretext 2.6.1).

@pearcej
Copy link
Owner

pearcej commented Sep 30, 2024

I upgraded from 2.3.0 to 2.7.0. It builds without trouble.

@wrigjl
Copy link
Contributor Author

wrigjl commented Sep 30, 2024

I'll upgrade to 2.7.0 as well

@pearcej
Copy link
Owner

pearcej commented Sep 30, 2024

I posted about the Nodetab issue in Discord. I think the converter put them into the conversion. I would really prefer not to remove the Python because my students did their CS1 in Python. @bnmnetp convinced me to keep them in the original RST version "as pseudocode."

@bnmnetp
Copy link
Contributor

bnmnetp commented Sep 30, 2024

The tabs were added after the conversion program... Things in tabbed interface will need a script or some manual work to help out.

@wrigjl
Copy link
Contributor Author

wrigjl commented Sep 30, 2024

Ok, I think we can follow the example in BigONotation.ptx (search for xml:id="algo_analysis_dummycode_1"). This provides both in a listing box. It's not ideal, but it is effective. Let me know what you think and leave this open... I'll ping you when there's something new to look at.

@pearcej
Copy link
Owner

pearcej commented Sep 30, 2024

I think that what was done in BigONotation.ptx is better, but the Python code will be a distraction for most users who did not have CS1 in Python, and it makes it that much more obvious when the code indentation is wrong, like in every piece of code on the BigONotation.ptx page.

@pearcej
Copy link
Owner

pearcej commented Sep 30, 2024

@bnmnetp do you know if tabbing of code been discussed at all among the leadership of the RST to PreTeXt conversion initiative?

@bnmnetp
Copy link
Contributor

bnmnetp commented Sep 30, 2024

@pearcej -- So, tabs were implemented in PreTeXt sometime this spring if I recall correctly. Various people have been contributing to the converter at https://github.com/bnmnetp/Runestone2PreTeXt including.

That code is there for anyone to update. Now that the PreTeXt is defined adding the output mechanisms to support the XML would not be too bad.

Working on that is an easy enough one-off contribution that I'm not making it a priority for myself to write code for newly supported conversions. Each book comes with its own priorities, and I think we are getting toward the end. of books that will get converted. After that the converter has limited use.

So, if it makes your life easier to update the code to emit PreTeXt versions of tabs, then I'm happy to advise, but I simply don't have the time to take responsibility for writing it. -- Andrew Scholer may also be a good resources as he has really become quite an expert on XSL.

@wrigjl
Copy link
Contributor Author

wrigjl commented Sep 30, 2024

I don't think rerunning conversion tools is where we're at. It's easier just to fix the existing ptx. That said, I'm having a devil of a time finding any reference to tab groups in ptx. and I found this ominous comment in Runestone2PreTeXt:

<!-- PreTeXt does not have tabbed grouping like Runestone, but they have better ways to break up questions
-->

@bnmnetp
Copy link
Contributor

bnmnetp commented Sep 30, 2024

@wrigjl for sure there comes a point where the manual updates are way better than starting over and reconverting.

See here: https://pretextbook.org/examples/sample-book/noparts/html/interactive-projects.html

For the source you can clone the https://github.com/PreTeXtBook/pretext repo and look at the source under examples/sample-book -- rune.xml. OR check out the annotated sample book which lets you view source for each question. (https://pretextbook.org/examples/sample-book/annotated/interactive-projects.html)
especially something like 3.20.1

@wrigjl
Copy link
Contributor Author

wrigjl commented Sep 30, 2024

Ah! task is what I'm looking for, great =) Thanks @bnmnetp for the pointer.

@wrigjl
Copy link
Contributor Author

wrigjl commented Sep 30, 2024

Here's what I have so far. Note: I don't know if it's possible to change (a) and (b) to something else. This uses the exploration tag because listing can't have a task tag (which is the pretext way of saying tab)

image

To get this to work also requires some editing of the publication.ptx. Specifically, adding the line below to the html build:

<exercises tabbed-tasks="inline project"/>

@bnmnetp
Copy link
Contributor

bnmnetp commented Sep 30, 2024

Not to be pedantic, but tasks are PreTeXt's semantic way of saying that this exercise has several parts. Different output methods get different renderings. We just choose to display them as tabs. Have you tried giving the task a title? Not sure that is the answer, but it would be the first thing I would try before asking on the pretext-support group.

@pearcej
Copy link
Owner

pearcej commented Sep 30, 2024

@bnmnetp I don't see the explanation as pedantic. It is most helpful! Tasks look like what we are hoping for. Thanks!

@wrigjl
Copy link
Contributor Author

wrigjl commented Oct 1, 2024

Yes, titles don't change the (a), (b) markings. In the image below "C++ implementation" is the title of the first task. Also, you can link to the specific task and the knowl will show the code (w/out syntax highlights). However, if you link to the exploration as a whole, you get a knowl that says "The interactive that belongs here is already on the page and cannot appear multiple times. Scroll to interactive.

image

Btw, the tasks appear to be a little strange still. On this page, https://pretextbook.org/examples/sample-book/annotated/interactive-projects.html find exercise 3.20.2 and click "Introduction", (a), (b), etc. Introduction is unique, from (a) through conclusion, they all render the same (and aren't supposed to).

@bnmnetp
Copy link
Contributor

bnmnetp commented Oct 1, 2024

I would have made the title the first tag inside a task

@wrigjl
Copy link
Contributor Author

wrigjl commented Oct 1, 2024

That's where it is:

            <exploration xml:id="expl-code">
                <title>Implementation of the algorithm</title>
                <task xml:id="task-cpp">
                <title>C++ implementation</title>
                <statement>                        
                <program language="cpp" line-numbers="yes">
                 ...

@bnmnetp
Copy link
Contributor

bnmnetp commented Oct 1, 2024

OK... That was just a guess on my part.... I'm not in charge of PreTeXt syntax. I would ask on the pretext-support google group if there is a way to change the labels on the tabs. I'm not a PreTeXt expert but there are plenty on that list.

@wrigjl
Copy link
Contributor Author

wrigjl commented Oct 1, 2024

No sweat, I appreciate all of your suggestions. All in all, I think this is the way to go for the html/runestone rendering (even if we're stuck with (a), (b), ...), and I'm going to apply it to this section and see what it looks like.

@pearcej
Copy link
Owner

pearcej commented Oct 1, 2024

Even though the (a) (b) with the task titles is not exactly what I would ideally hope for, it certainly seems close enough! Thanks to both @bnmnetp and @wrigjl for all of your time.

@wrigjl
Copy link
Contributor Author

wrigjl commented Oct 1, 2024

@pearcej This is worth looking at again. This is an attempt at using task's to tab group the C++ and python implementations.

@pearcej
Copy link
Owner

pearcej commented Oct 1, 2024

@wrigjl Exploration 1.13.1. The complete LogicGate class looks good. The others all only show the C++ implementation on both tabs in my local build. Are the later two explorations working for you locally?

@wrigjl
Copy link
Contributor Author

wrigjl commented Oct 1, 2024

I think this is a a bug in the pretext markup. I'll see if it's a known issue.

Signed-off-by: Jason L. Wright <jAson@thought.net>
@wrigjl
Copy link
Contributor Author

wrigjl commented Oct 1, 2024

This appears to be a pretext markup bug for sure (it happens in the sample book, too). I propose we move forward with this, but without the change to pretext/publication-rs-for-all.xml which causes them to be inline/tabbed. The idea is that the pretext folks will likely fix things and then we can just toggle the inlining again.

@pearcej Can you try a build with this applied but with the following line deleted from publication-rs-for-all.xml and see if you think it's just too ugly?

<exercises tabbed-tasks="inline project"/>

@pearcej
Copy link
Owner

pearcej commented Oct 1, 2024

It seems like the best choice for now.

@wrigjl
Copy link
Contributor Author

wrigjl commented Oct 1, 2024

@pearcej Ok, let's merge this as it stands (I removed the inlining from the pretext publication file and made sure the branch was completely up to date).

Btw, I showed the tab problem to Rob Beezer and he was aware of it. We also had a discussion about better handling the (a) (b) markers and I think those will (eventually) look nicer too

@pearcej
Copy link
Owner

pearcej commented Oct 1, 2024

Great news about what Rob said.

@pearcej pearcej merged commit c4d3f5d into pearcej:master Oct 1, 2024
@wrigjl wrigjl deleted the updating-derived-section-deux branch October 1, 2024 16:10
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

Successfully merging this pull request may close these issues.

3 participants