RunestoneInteractive / thinkcspy

How to Think Like a Computer Scientist, Interactive Edition
https://runestone.academy/ns/books/published/thinkcspy/index.html
Other
108 stars 190 forks source link

PreTeXt Conversion Issues #208

Open bnmnetp opened 2 years ago

bnmnetp commented 2 years ago

This issue will serve as a collection point for issues and discussion about the PreTeXt incarnation of the How to think book. Here is what I have received so far from @barbarer @pearcej and @bhoffman0 Thanks!

Early versions are updated here: https://blog.runestone.academy/beta/algorithms.html

bnmnetp commented 2 years ago

A few comments on what has been reported so far. Again, thanks.

The images will have to be adjusted. Pretext uses percentages for widths whereas RST is kind of free form. So it is going to take a bit of manual work to fix that. Not hard, just a pass through the book.

The code in MCQs and in the body of the text is a known problem in PreTeXt we will get it fixed.

The numbering of the checkpoints versus the unnumbered activecodes. This is a result of the fact that we didn't really have any way to differentiate between activecodes that were used in the text for students to play with and activecodes that were part of a check your understanding. The good news is that in PreTeXt we can make that sort of differentiation. But its impossible to automate.

bnmnetp commented 2 years ago

Students do not need to close the table of contents in order to do the activecodes.

I've had so many requests over the years to have a better way to navigate around the book than clicking the main icon to go back to the main toc and then to the chapter and then using our subchapter menu. This really seems to solve the problem for us. I'm guessing we have options for the default settings such as whether it is visible or not, and whether we show all of the sections in a chapter that is not active or whether we can collapse the non-active chapters.... I personally would rather have the chapter headings only except for the current chapter.

rbeezer commented 2 years ago

Some general responses. Everything so far is mostly understood already.

bnmnetp commented 2 years ago

@rbeezer @davidfarmer I did a little experimenting, and giving the codelens, activecode, and parsons divs a width of 150% makes them very usable. What if we simply add a class like full-width or wide to the top level div then we can catch that with a CSS rule that looks for .runestone.full-width ??

davidfarmer commented 2 years ago

On this page:

https://blog.runestone.academy/beta/our-first-turtle-program.html

which div in the first (turtle) example do you propose adding a class?

(I'd prefer something more semantic than "wide", but I need to understand the situation before making a suggestion.)

On Thu, 7 Apr 2022, Bradley Miller wrote:

@rbeezer @davidfarmer I did a little experimenting, and giving the codelens, activecode, and parsons divs a width of 150% makes them very usable. What if we simply add a class like full-width or wide to the top level div then we can catch that with a CSS rule that looks for .runestone.full-width

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you werementioned.[AABTULF6OYMMGZZVY56E5DTVD4LGVA5CNFSM5SXPN3Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOOR PWSZGOIELLPLA.gif] Message ID: @.***>

bnmnetp commented 2 years ago

For the turtle example it is the <div class="runestone ....."

We always have an outermost div which includes the runestone class for Parsons problems they look like this: <div class="runestone" style="max-width: none">

rbeezer commented 2 years ago

And we are putting these into our exercise class. Which I hope is present in the version Brad is generating.

But sometimes an ActiveCode will just be in-between paragraphs, not as an exercise. As an editable example, not something to assign.

davidfarmer commented 2 years ago

Is a width that accommodates 80 characters enough? Too much?

I see this as like a wide equation: show the whole thing if you can, otherwise give it a scroll bar.

I am fiddling with the CSS to see if the current markup is enough.

davidfarmer commented 2 years ago

I think the code examples on this page look okay, and the others do not need to be wider:

https://blog.runestone.academy/beta/our-first-turtle-program.html

Please let me know if I missed something.

Have not tested on multiple browsers yet.

(I am aware of the CSS problem with the background on a pre.)

bnmnetp commented 2 years ago

I think we ought to take this opportunity to do a bit of cleanup.

I would like to start by removing the alert and alert-warning classes from all of the components that use it. This is what currently gives some of them the yellowish background color. Not all of them use it and it was not done with much thought way back when. If we remove it, then we can consistently style all runestone components and give them a new and refreshed background color etc..

bnmnetp commented 2 years ago

David, the components that need to be wider are:

The others look better when they are smaller or the same width as the text.

bnmnetp commented 2 years ago

Quick proof of concept:

Screen Shot 2022-04-07 at 11 36 09 AM

Rob - removed those classes from my local copy of pretext-runestone.xsl. I can keep working on this and give you a PR once we are all happy. Doing this now would be a good way to ensure that the Runestone Components can be styled to be compliment your various color schemes.

Meanwhile David and I are messing with each other as we are both fiddling with CSS. 🤣

davidfarmer commented 2 years ago

I'm guessing the point I missed is that the parsons blocks should be next to, not above, the place to drag them.

It is fine to just remove CSS you don't want, like the "alert", and then I can put something back in the PTX css.

davidfarmer commented 2 years ago

If you reload, those parsons problems are side-by-side now.

A couple more issues:

1) The text of some turtle parsons problems refers to the image to the left. That means there should be a side-by-side in the source.

2) Those images which are too large have a 100% width on them. So that also needs to be corrected in the source.

3) The div.source and div.answer in a parsons problem have a hard-coded width and height. But the given height is not tall enough to contain the items in the source. That is why it intrudes on the Check and Reset buttons. So, however that height is calculated, it is getting the wrong answer.

It would be good to just let it use the height it needs, but it is not immediately obvious to me how to keep them the right height and not change when you drag away an option.

rbeezer commented 2 years ago

Hit the "Show in CodeLens" on the turtle program. Do we want that to the side as well? (A bit of space could be removed before the comment lines?)

I can keep working on this and give you a PR once we are all happy. Doing this now would be a good way to ensure that the Runestone Components can be styled to be compliment your various color schemes.

Beautiful! PR will be accepted nearly instantaneously. (Or holler and have me do it, super EZ.)

I'm guessing the point I missed is that the parsons blocks should be next to, not above, the place to drag them.

Yes, and it is a research result that they are better that way. I've been told. ;-)

the components that need to be wider are:... codelens

Not sure these are implemented, but should now be super-easy with what I have.

davidfarmer commented 2 years ago

When you hit the "Show in CodeLens" on the turtle program, up comes an iframe. Adjusting the attributes on the iframe is not enough to make it look good. So, maybe needs to be a separate issue.

On Thu, 7 Apr 2022, Rob Beezer wrote:

Hit the "Show in CodeLens" on the turtle program. Do we want that to the side as well? (A bit of space could be removed before the comment lines?)

  I can keep working on this and give you a PR once we are all happy. Doing this now would be a good
  way to ensure that the Runestone Components can be styled to be compliment your various color
  schemes.

Beautiful! PR will be accepted nearly instantaneously. (Or holler and have me do it, super EZ.)

  I'm guessing the point I missed is that the parsons blocks should
  be next to, not above, the place to drag them.

Yes, and it is a research result that they are better that way. I've been told. ;-)

  the components that need to be wider are:... codelens

Not sure these are implemented, but should now be super-easy with what I have.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you werementioned.[AABTULDQKZEAG5NUP7FI2LDVD6GFRA5CNFSM5SXPN3Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOOR PWSZGOIEOCEWY.gif] Message ID: @.***>

bnmnetp commented 2 years ago

Before you merge the PR please take a look at https://dev.runestoneacademy.org/ns/books/published/rune/exercises-12.html

I hacked in my cleanups and styling changes. Things look good except for the parsons problems.

rbeezer commented 2 years ago

Looking real nice.

The box around the math matching grows as you drop premises. The history matching has a bunch of space that gradually gets consumed. Which do we like? Whay do they behave differently?

PS I don't see the PR yet?

dsanders12 commented 2 years ago

@bnmnetp In Chapter 11.3 of the ReStructured Text version of the book there is the .txt file on the page, however it does not appear on the respective chapter of the PreText book. image image

knakaj commented 2 years ago

@bnmnetp Chapter 13.1 is missing content. On the reStructuredText version the page includes a lot of paragraphs as well as interactive windows, while on the pretext version there is only one paragraph displayed. I think the pretext version is missing a whole section, because what is named as 13.2 in Pretext, is 13.3 in reStructured Text.

Screen Shot 2022-06-29 at 7 49 25 PM Screen Shot 2022-06-29 at 7 49 43 PM Screen Shot 2022-06-29 at 7 46 27 PM
phattymcfee commented 2 years ago

@bnmnetp In chapter 5.4, a link is not working. On the reStructured text, clicking on this link opens a new page in the browser. image image However, when you click the same link on the PreTeXt it displays an error. image image

moisedk commented 2 years ago

Broken cross-reference link in Table 9.5.1. Screenshot from 2022-06-29 14-17-14

phattymcfee commented 2 years ago

In chapter 5.7, the PreTeXt book is missing some components that the reStructured version has including answers, discussion, show feedback, and Show Code tabs. Also, the solution links in the PreTeXt version seem out of place. PreTeXt - image reStructured - image

moisedk commented 2 years ago

Glossary and Summary mixed in 9.20 Screenshot from 2022-06-29 14-39-25

campbelle2 commented 2 years ago

Chapter 17.11 Exercises solution issues. In the PreTeXt version of thinkcspy some of the exercises here have a solution tab while some do not. The Restructured Text version has a completely different format for these exercises. Screenshot 2022-06-29 14 41 18 Screenshot 2022-06-29 14 41 25 Screenshot 2022-06-29 14 41 35

moisedk commented 2 years ago

Missing exercise questions and duplicate answers in 10.31. Exercise 1 & 11 Screenshot from 2022-06-29 15-07-37

bnmnetp commented 2 years ago

@campbelle2 @moisedk @phattymcfee --- These difference are to be expected...

For the problems where we do have answers they will need to be moved into an <answer> tag. rather than using the tabbed interface of the old book.

We are no longer going to have the discussion as they were mostly spam or people posting answers not actually having discussion, so that can be eliminated.

The plan is for you to fix these issues and make pull requests, not just report them as issues. 😄

Thanks!

dsanders12 commented 2 years ago

@bnmnetp Shall we attempt to solve any issues we come across and submit PR's before notifying that we have found an issue? Also, shall we comment issues we have in this forum, or create the issue outside of this?

bnmnetp commented 2 years ago

We can use this issue as the central clearing house.

If you have a question on what to do, this is a great place to comment or ask for help. All the right people are subscribed to this issue.

campbelle2 commented 2 years ago

There is a global issue where active code windows with include statements are missing in the Pretext version. I initially found the issue in chapter 19.2; there are active codes that include a different active code's class (the Point class) but the include statement is not present in the Pretext version so the active codes encounter the error: NameError: name 'Point' is not defined on line 1. This issue is present in every active code window that should have an include statement.