PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
264 stars 206 forks source link

Programming languages for Sage cells inside knowls #1347

Open rbeezer opened 4 years ago

rbeezer commented 4 years ago

Sage cells in knowls are not being configured for different (programming) languages, like R, Python, Octave, etc.

Outside of knowls, we have put the language on the Evaluate button. So, we might have button text "Evaluate (Python)".

Can we pass in a list to the knowls code to make multiple configurations, each with its own label text? Items of this list might need to be pairs (with correct syntax!):

[(python, 'Evaluate (Python)'),....]

This is a follow-on from #981.

davidfarmer commented 4 years ago

Passing a list may involve a major change to the knowls code. (Or maybe not: I will investigate.)

A global variable, which is not particularly frowned upon in Javascript (not like in some other languages) could do what you want.

On Wed, 12 Aug 2020, Rob Beezer wrote:

Sage cells in knowls are not being configured for different (programming) languages, like R, Python, Octave, etc.

Outside of knowls, we have put the language on the Evaluate button. So, we might have button text "Evaluate (Python)".

Can we pass in a list to the knowls code to make multiple configurations, each with its own label text? Items of this list might need to be pairs (with correct syntax!):

[(python, 'Evaluate (Python)'),....]

This is a follow-on from #981.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, orunsubscribe.[AABTULFVJRYEZWSUNKHO5EDSAMPYFA5CNFSM4P5OBN5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KDKAKG Q.gif]

rbeezer commented 4 years ago

I meant setting a variable, like have now. "Passing" was colloquial, not technical. (Sorry!)

I think it would mean looping over that list, building several "makeSageCell()" calls. (Function name may not be correct.)

On August 12, 2020 9:16:25 PM PDT, "David W. Farmer" notifications@github.com wrote:

Passing a list may involve a major change to the knowls code.> (Or maybe not: I will investigate.)>

A global variable, which is not particularly frowned upon> in Javascript (not like in some other languages) could do> what you want.>

On Wed, 12 Aug 2020, Rob Beezer wrote:>

Sage cells in knowls are not being configured for different (programming) languages, like R, Python, Octave, etc.>

Outside of knowls, we have put the language on the Evaluate button. So, we might have button text "Evaluate> (Python)".>

Can we pass in a list to the knowls code to make multiple configurations, each with its own label text? Items of> this list might need to be pairs (with correct syntax!):>

[(python, 'Evaluate (Python)'),....]>

This is a follow-on from #981.>

—> You are receiving this because you are subscribed to this thread.> Reply to this email directly, view it on GitHub, orunsubscribe.[AABTULFVJRYEZWSUNKHO5EDSAMPYFA5CNFSM4P5OBN5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KDKAKG> Q.gif]>

-- > You are receiving this because you authored the thread.> Reply to this email directly or view it on GitHub:> https://github.com/rbeezer/mathbook/issues/1347#issuecomment-673244737

JeanSebastienTurcotte commented 4 years ago

@rbeezer Sorry if you already had my ping in #981 , but it seems something is still lacking there. I didn't get an email when I posted in 981, so I figured notification are maybe off on a closed thread.