Linking Sage cells in a wiki

27 views
Skip to first unread message

Thomas Judson

unread,
Jul 17, 2017, 8:04:31 AM7/17/17
to sage...@googlegroups.com, sage-s...@googlegroups.com
I am trying to link two Sage cells in a wikidot webpage.  The following code successfully executes

[[html]]
<script>sagecell.makeSagecell({"inputLocation": ".sage"});</script>
<div class="sage">
  <script type="text/x-sage">
a = 10
Z8 = Integers(8)
Z8</script>
</div>
[[/html]]

I would like to add a second linked cell that executes the command

Z8.list()

If possible, I would like to include text between the cells.

So far I haven’t had any luck.  Any ideas would be appreciated.

Tom Judson

=========
Thomas W. Judson, Associate Professor
Department of Mathematics and Statistics
Stephen F. Austin State University
P.O. Box 13040-3040 SFA Station
Nacogdoches, TX  75962

OFFICE: 316 Math




Rob Beezer

unread,
Jul 17, 2017, 2:09:14 PM7/17/17
to sage...@googlegroups.com
Dear Tom,

Have you tried putting

, linked: true

into your sagecell.makeSagecell() right after the inputLocation specification?

See:
https://github.com/sagemath/sagecell/blob/master/doc/embedding.rst#linked-cells

Rob
> EMAIL: juds...@sfasu.edu <mailto:juds...@sfasu.edu>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cell" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to sage-cell+...@googlegroups.com
> <mailto:sage-cell+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cell/0F2D67B8-3A31-4CC2-B705-A82CE03D13F8%40gmail.com
> <https://groups.google.com/d/msgid/sage-cell/0F2D67B8-3A31-4CC2-B705-A82CE03D13F8%40gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Thomas Judson

unread,
Jul 18, 2017, 10:56:41 AM7/18/17
to sage-cell, bee...@ups.edu
Yup, I already tried that one.  And every variation of the following that I could think of.

<script>sagecell.makeSagecell({"inputLocation": ".sage", linked: true});</script>
<div class="sage">
<script type="text/x-sage">
Z8 = Integers(8)
Z8</script>
[[/html]]
<script>sagecell.makeSagecell({"inputLocation": ".sage", linked: true});</script>
<div class="sage">
<script type="text/x-sage">
Z8.list()
</script>
[[/html]]

The second cell isn't linked.

Thomas Judson

unread,
Jul 18, 2017, 11:56:33 AM7/18/17
to sage-cell, bee...@ups.edu
Solved the problem.

The following works.

<script>sagecell.makeSagecell({"inputLocation": ".sage", linked: true});</script>
<div class="sage">
<script type="text/x-sage">
Z8 = Integers(8)
Z8</script>
</div>
<div>
this is some text
</div>
<script>sagecell.makeSagecell({"inputLocation": ".sage", linked: true});</script>
<div class="sage">
<script type="text/x-sage">
Z8.list()
</script>
</div>
[[/html]]

On Monday, July 17, 2017 at 8:09:14 PM UTC+2, Robert Beezer wrote:

Rob Beezer

unread,
Jul 18, 2017, 1:42:31 PM7/18/17
to sage...@googlegroups.com
I'd have thought that second "script" tag would be unnecessary. But maybe there
is something about the wiki software getting in the way?
> > EMAIL: juds...@sfasu.edu <javascript:> <mailto:juds...@sfasu.edu
> <javascript:>>
> >
> >
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "sage-cell" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> email
> > to sage-cell+...@googlegroups.com <javascript:>
> > <mailto:sage-cell+...@googlegroups.com <javascript:>>.
> <https://groups.google.com/d/msgid/sage-cell/0F2D67B8-3A31-4CC2-B705-A82CE03D13F8%40gmail.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cell" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to sage-cell+...@googlegroups.com
> <mailto:sage-cell+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cell/3cd55e98-f752-4281-96ab-dc3a374f8cd4%40googlegroups.com
> <https://groups.google.com/d/msgid/sage-cell/3cd55e98-f752-4281-96ab-dc3a374f8cd4%40googlegroups.com?utm_medium=email&utm_source=footer>.

David Farmer

unread,
Jul 18, 2017, 1:48:07 PM7/18/17
to sage...@googlegroups.com

When we harvest the contents of the wiki, we will need to strip
out those extra tags. (Not difficult, but we need to remember to do it.)
> email to sage-cell+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cell/MTAwMDAzMS5iZWV6ZXI.1500399750%40quikprotect.

Tom Judson

unread,
Jul 19, 2017, 3:15:44 AM7/19/17
to sage-support, sage...@googlegroups.com
Actually, the problem is not this specific computation but being able to link Sage cells in a wiki in general.  However, the following works.
<script>sagecell.makeSagecell({"inputLocation": ".sage", linked: true});</script>
<div class="sage">
<script type="text/x-sage">
Z8 = Integers(8)
Z8</script>
</div>
<div>
<p>this is some text</p>
</div>
<div class="sage">
<script type="text/x-sage">
Z8.list()
</script>
</div>
<div class="sage">
<script type="text/x-sage">
a = Z8.an_element(); a
</script>
</div>
<div class="sage">
<script type="text/x-sage">
a.parent()
</script>
</div>
[[/html]]

Rob Beezer

unread,
Jul 19, 2017, 1:19:44 PM7/19/17
to sage...@googlegroups.com
Sorry, I wasn't clear before. I meant that I thought you would only need one
call to "sagecell.makeSagecell", even with multiple cells. Which is what you
have going below.

Do you really need the "div" around the "p" ("this is some text")?
> EMAIL: juds...@sfasu.edu <mailto:juds...@sfasu.edu>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cell" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to sage-cell+...@googlegroups.com
> <mailto:sage-cell+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cell/60dfad09-9743-4497-b573-810a780670b2%40googlegroups.com
> <https://groups.google.com/d/msgid/sage-cell/60dfad09-9743-4497-b573-810a780670b2%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages