#4714 closed defect (fixed)
use easy/load.js when loading jsmath in the notebook
Reported by: | jason | Owned by: | boothby |
---|---|---|---|
Priority: | minor | Milestone: | sage-4.3 |
Component: | notebook | Keywords: | |
Cc: | jhpalmieri, timdumol, was | Merged in: | sagenb-0.4.6 |
Authors: | Mitesh Patel | Reviewers: | William Stein |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
The patch
consolidates jsMath setup in /javascript/jsmath.js
. It depends on #6673.
Attachments (5)
Change History (30)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
- Cc jhpalmieri added
comment:3 Changed 13 years ago by
A few *estions:
- Should we patch the spkg's
jsmath/easy/load.js
? - Add
jsmath/local/sage.js
to itsloadFiles
array? - Re-generate this
sage.js
from the list insage/misc/latex_macros.py
duringsage -docbuild
, indoc/common/conf.py
?sage -b
?- notebook startup?
comment:4 Changed 13 years ago by
- Component changed from notebook to documentation
- Owner changed from boothby to tba
This is misfiled (should be under "documentation").
comment:5 follow-up: ↓ 6 Changed 13 years ago by
After #5799, we have two copies of the jsmath
tree, one in doc/common/static
and another in javascript_local
. That is, one from sage-4.1.spkg
and another from jsmath-3.6b.p1.spkg
. Can we avoid this? Or should we maintain separate load.js
files for the notebook and documentation?
comment:6 in reply to: ↑ 5 Changed 13 years ago by
Replying to mpatel:
After #5799, we have two copies of the
jsmath
tree, one indoc/common/static
and another injavascript_local
. That is, one fromsage-4.1.spkg
and another fromjsmath-3.6b.p1.spkg
. Can we avoid this? Or should we maintain separateload.js
files for the notebook and documentation?
See #6614 for a potential resolution.
comment:7 Changed 13 years ago by
The latest patch at #6614 tells Sphinx to copy jsMath directly from javascript_local
to doc/output/html/en/*/_static
. In particular, it does this before it copies the files in doc/common/static
. How about putting a custom easy/load.js
there?
If we're not adding new doc macros frequently, we could just paste them from latex_macros.py
. Or we might add an option to sage -docbuild
to regenerate load.js
on demand (cf. #6187). If we overwrite the file during every build, we may need to synchronize access from multiple Sphinx processes (cf. #6255).
(Note: Sphinx 0.6.2 supports HTML themes, including static templates. It's tempting to create a template static/easy/load.js_t
. However, Sphinx does not process user templates in static
's subdirectories.)
On the notebook: I believe we can move nearly all jsMath directives from notebook.py
to a custom javascript_local/jsmath/easy/load.js
that's overwritten on notebook start-up. Perhaps in twist.py
?
I'd really like to get moving on this, provided there's agreement. Of course, we can split this into two tickets, [at least] one each for the docs and notebook. Thoughts?
comment:8 Changed 13 years ago by
This p(r)oof of concept, which depends on a patch at #6614,
- Adds
doc/common/static/jsmath_sage.js
. - Sets
jsmath_path=jsmath_sage.js
indoc/common/conf.py
.
The new static file is jsMath's "stock" easy/load.js
plus all Sage-related customizations I could find, including extensions, macros, and a few other bits from notebook.py
. I've also made changes below DO NOT MAKE CHANGES BELOW THIS
(gasp!) to help the loader find jsMath from its new [relative] location.
I think this means we don't need to patch the spkg. Later, we may be able to use Sphinx 0.6.2's static templates to insert an updated macro list at build time (cf. #6586).
Perhaps we can do something similar for the notebook, e.g., in sage/server/notebook/templates
.
comment:9 Changed 13 years ago by
- Component changed from documentation to notebook
- Owner changed from tba to boothby
- Summary changed from use easy/load.js when loading jsmath to use easy/load.js when loading jsmath in the notebook
comment:10 Changed 13 years ago by
See this comment (and the next one) at #6673 for a suggested path to "unification."
comment:11 Changed 13 years ago by
Changed 13 years ago by
Consolidate jsMath setup. Apply to sagenb repository. Apply only this patch.
comment:12 Changed 13 years ago by
- Status changed from new to needs_review
The patch trac_4714-sagenb_jsmath_init.patch consolidates jsMath setup in /javascript/jsmath.js
. It depends on #6673.
The patch still hard-codes the sage.misc.latex_macros
's macros. Still to do: Generate the macros from server/user settings and latex_macros
's helper functions.
comment:13 Changed 13 years ago by
I've reattached trac_4714-sagenb_hard_code_macros.patch, since my first try didn't work (server problems?).
comment:14 Changed 13 years ago by
- Description modified (diff)
comment:15 Changed 13 years ago by
This works: trac_4714-sagenb_hard_code_macros.patc
comment:16 Changed 13 years ago by
- Milestone changed from sage-4.2.1 to sage-4.2
Reminder: Rebase vs. #7269.
comment:17 Changed 13 years ago by
- Milestone changed from sage-4.2 to sage-4.3
comment:18 Changed 12 years ago by
- Report Upstream set to N/A
- Status changed from needs_review to needs_work
- Work issues set to rebase
comment:19 Changed 12 years ago by
- Status changed from needs_work to needs_review
Rebased against this sequence:
trac_7390-sagenb_test_report_A.patch trac_7390-sagenb_test_report_B_v2.patch trac_7390-sagenb_test_report_referee.patch trac_7402-pkg_resources.patch trac_7428-publish_last_edited_v2.patch trac_7444-search_after_publish.patch trac_7376-search_by_username_v2.patch trac_1321-sagenb_graphed.patch sagenb_7483.patch sagenb_7482.patch sagenb-7495.patch sagenb_3849.patch trac_4714-sagenb_jsmath_init_v2.patch
comment:20 Changed 12 years ago by
- Work issues rebase deleted
comment:21 Changed 12 years ago by
- Cc timdumol was added
- Priority changed from major to minor
comment:22 Changed 12 years ago by
- Description modified (diff)
Version 3:
- Disables jsMath's autoload plug-in. Otherwise, jsMath does not load itself and run in worksheets that initially do not contain expressions to typeset.
comment:23 Changed 12 years ago by
- Status changed from needs_review to positive_review
Looks good to me.
comment:24 Changed 12 years ago by
- Resolution set to fixed
- Status changed from positive_review to closed
I merged this patch into sagenb-0.4.6.
comment:25 Changed 12 years ago by
- Merged in set to sagenb-0.4.6
- Reviewers set to William Stein
Copied from jason: