RunestoneInteractive / rs

A New Monorepo structure for Runestone
Other
39 stars 66 forks source link

Removing HTML ID from interactive exercises in PreTeXt #19

Open juliengiol opened 1 year ago

juliengiol commented 1 year ago

Hi,

I am writing an html document with PreTeXt. I would like to include interactive exercises such as these: https://pretextbook.org/examples/sample-article/html/section-interactive-exercises.html.

I don't want the HTML IDs such as "Multiple Choice (vector-space-dimension)" to show up.

Here is what I have learnt from Rob Beezer when I raised this issue over at the PreTeXt help forum:

"When hosting on Runestone, the HTML ID is used in the "assignment builder" to help instructors know which exercise they are assigning. This is part of Runestone's HTML-only history.

We put exercise numbers and titles (if authored!) into a "manifest" as part of a PreTeXt build meant for hosting on Runestone. So it is a Runestone enhancement to use that information in the assignment builder."

Is there a way I can prevent these IDs from showing up in my html document? Note that for now, I am using GitHub for hosting purposes.

Thanks, Julien

bnmnetp commented 1 year ago

Hi,

Short Answer:

To answer directly, there is not at the moment a way to hide those identifiers. We have not had a request to do so before.

Longer Answer: With a bit of patience, those identifiers will be phased out and will go away. They have served us well for 10 years, so it hasn't been a big priority. But with PreTeXt we have better options for labeling the exercises and we will move to doing that. I can't give you a timeline, but it is on my very long list of PreTeXt related enhancements.

Brad

petraBT commented 1 year ago

I want to second this request. It too am now hosting on GitHub (after having run my own Runestone server for a few years) and those IDs are less than pretty. I thought about writing a quick post-processing script for my html output but that seems very not in line with the ideas of PreTeXt.

Thanks- Petra

bnmnetp commented 1 year ago

It would be relatively easy for someone to prepare a PR that checks for dynamic_pages or the eBookConfig.useRunestoneServices flag on each page and to have the addCaption method (see runestonebase.js) become a no-op. This would effectively hide the identifiers on static html builds.

geoff-cox commented 11 months ago

I am just adding my support for this fix. I was also willing to write a post-processing script to remove them from the raw HTML, but I see they are dynamically rendered from Runestone. Manually removing them from the rendered page drastically improved the look of my textbook. Thanks!

Geoff

michelmonc commented 10 months ago

I will work on this_

geoff-cox commented 10 months ago

@michelmonc You might have a better solution, but FYI: https://github.com/RunestoneInteractive/rs/pull/380