Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Live docs problems with autoescaping #354

Merged
merged 3 commits into from
Dec 10, 2015

Conversation

migeruhito
Copy link
Contributor

As @kcrisman pointed out in #324, the new autoescape default for jinja2 templates breaks some live docs. Here is a possible solution to be tested. This solution does not break the fix for the hidden bugs found in #324 during the discussion of the problem.

@migeruhito
Copy link
Contributor Author

Uploads of html and rst worksheets were also affected by the bug. The new (optimal?) solution also fix this cases.

@migeruhito
Copy link
Contributor Author

A simple sample rst worksheet for testing upload.

=============
Test Notebook
=============

Let's do some computations::

    sage: a = '<';a
    '<'

::

    sage: ratpoly.<t> = PolynomialRing(QQ)

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

I plan to look at this soon (today?) but have a concern. This link and this link seem to suggest that we might run into trouble with utf-8 inputs. Like Éspañol in a typical Python 2 file, and presumably these inputs aren't coming all from unicode. Not sure whether that will affect our docs or not, I feel like there are at least some French names of authors that might cause trouble if in the wrong encoding. If I don't understand what this is about (which is likely) just let me know, though!

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

E.g. http://lucumr.pocoo.org/2013/7/2/the-updated-guide-to-unicode/ seems to explain Flask's take on this, anyway, though mostly from the Py3 perspective. Hopefully I'm just making much about nothing. Though you do say

+
+WARNING:
+    
+    Input strings must be unicode.

So how can we ensure this? Will doc_in = unicode_str(doc_in) work with UTF-8 as well?

@migeruhito
Copy link
Contributor Author

The class flask.Markup only works fine with unicode inputs. So it is very convenient to make sagenb.notebook.docHTMLProcessor working in unicode instead of selectively decoding all the strings to utf-8 in sagenb.notebook.docHTMLProcessor.genericHTMLProcessor.process_cell_input_outputand then return them as encoded strings. The sagenb.misc.misc.unicode_str call on input data ensures the correct codification of the input, no matter if it is a python 2 str or an unicode object. The output is directly managed by the flask template machinery, with has no problem with unicode. My concern is about the sgmllib package, but it apparently works.

In fact, if you remove all the unicode thing, the example that you propose will fail.

In my Notebook refactor/rewrite, (currently in progress), I plan to convert all the relevant parts of the notebook to unicode_literals as previous step to the python 3 migration.

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

That answers most of my questions.

Yikes, I don't get the ReST to work fine.

=============
Test Notebook
=============

Let's do some computations::

    sage: a = '&lt;';a
    '&lt;'

::

    sage: ratpoly.<t> = PolynomialRing(QQ)

Now let's do them in Éspañol.

    sage: var('é')

Gives
screen shot 2015-12-09 at 4 13 44 pm

@migeruhito
Copy link
Contributor Author

I obtain almost the correct thing when uploading this rst. It is not completely correct, because the rst is not correct.

sage-rst-test-1

@migeruhito
Copy link
Contributor Author

with the correct rst:

=============
Test Notebook
=============

Let's do some computations::

    sage: a = '&lt;';a
    '&lt;'

::

    sage: ratpoly.<t> = PolynomialRing(QQ)

Now let's do them in Éspañol.

::

    sage: var('é')

I get the correct thing

sage-rst-test-2

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

I don't even get anything correct when I do this:

=============
Test Notebook
=============

Let's do some computations::

    sage: a = 5

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

So maybe I am doing something wrong. But I do have the fix for the other stuff, so I have the right branch, I guess.

@migeruhito
Copy link
Contributor Author

Your last rst, autoescape_livedocs branch and sage 6.8:

sage-rst-test-3

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

So I don't know why mine isn't working. Everything else seems to work, I guess?

@migeruhito
Copy link
Contributor Author

It is a very disturbing problem. Your output points to a problem with the rst->html conversion.

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

I'll note that HTML seems to upload correctly.

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

Right, but you are not having the problem. I have 6.10.beta6 but the only difference relevant to this should be in sagenb, right?

@migeruhito
Copy link
Contributor Author

Your output shows crude rst. It seems that the docutils.core.publish_parts call in sagenb.notebook.notebook.Notebook._import_worksheet_rst is not working. But docutils is packed within Sage, isn't it?

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

Yes, that is exactly what is happening, it's just this when I click "Edit" after uploading.


##################
H1: document title
##################

Introduction text.


*********
Sample H2
*********

Sample content.


**********
Another H2
**********

Sample H3
=========

Sample H4
---------

Sample H5
^^^^^^^^^

Sample H6
"""""""""

And some text.

{{{id=1|

///
}}}

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

And yes, docutils is there.

sage: from docutils import core
sage: core.publish_parts
<function publish_parts at 0x10ebfade8>

@migeruhito
Copy link
Contributor Author

I've directly tested docutils.core.publish_parts on a sage -python session on my installation, and it works. Could you test this?

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

I can confirm I have this problem whether or not I use your branch.

@migeruhito
Copy link
Contributor Author

Probably, the problem is not related with the notebook, but with the sage packages.

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

In [5]: core.publish_parts('####\n1234\n####\n \nDo this::\n\n    sage: factorial(8)')
Out[5]: 
{'encoding': 'utf-8',
 'version': '0.12',
 'whole': u'<document ids="id1" names="1234" source="<string>" title="1234">\n    <title>\n        1234\n    <paragraph>\n        Do this:\n    <literal_block xml:space="preserve">\n        sage: factorial(8)\n'}

Yes, most likely. This output seems okay, I guess?

@migeruhito
Copy link
Contributor Author

I obtain the same ouput as you, but try

publish_parts('####\n1234\n####\n \nDo this::\n\n sage: factorial(8)' , writer_name='html')

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

This is long...

In [2]: core.publish_parts('####\n1234\n####\n \nDo this::\n\n sage: factorial(8)' , writer_name='html')
Out[2]: 
{'body': u'<p>Do this:</p>\n<pre class="literal-block">\nsage: factorial(8)\n</pre>\n',
 'body_pre_docinfo': u'<h1 class="title">1234</h1>\n',
 'body_prefix': u'</head>\n<body>\n<div class="document" id="id1">\n',
 'body_suffix': '</div>\n</body>\n</html>\n',
 'docinfo': '',
 'encoding': 'utf-8',
 'footer': '',
 'fragment': u'<p>Do this:</p>\n<pre class="literal-block">\nsage: factorial(8)\n</pre>\n',
 'head': u'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />\n<title>1234</title>\n',
 'head_prefix': '<?xml version="1.0" encoding="utf-8" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n<head>\n',
 'header': '',
 'html_body': u'<div class="document" id="id1">\n<h1 class="title">1234</h1>\n<p>Do this:</p>\n<pre class="literal-block">\nsage: factorial(8)\n</pre>\n</div>\n',
 'html_head': u'<meta http-equiv="Content-Type" content="text/html; charset=%s" />\n<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />\n<title>1234</title>\n',
 'html_prolog': '<?xml version="1.0" encoding="%s" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n',
 'html_subtitle': '',
 'html_title': u'<h1 class="title">1234</h1>\n',
 'meta': '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />\n',
 'stylesheet': u'<style type="text/css">\n\n/*\n:Author: David Goodger (goodger@python.org)\n:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $\n:Copyright: This stylesheet has been placed in the public domain.\n\nDefault cascading style sheet for the HTML output of Docutils.\n\nSee http://docutils.sf.net/docs/howto/html-stylesheets.html for how to\ncustomize this style sheet.\n*/\n\n/* used to remove borders from tables and images */\n.borderless, table.borderless td, table.borderless th {\n  border: 0 }\n\ntable.borderless td, table.borderless th {\n  /* Override padding for "table.docutils td" with "! important".\n     The right padding separates the table cells. */\n  padding: 0 0.5em 0 0 ! important }\n\n.first {\n  /* Override more specific margin styles with "! important". */\n  margin-top: 0 ! important }\n\n.last, .with-subtitle {\n  margin-bottom: 0 ! important }\n\n.hidden {\n  display: none }\n\na.toc-backref {\n  text-decoration: none ;\n  color: black }\n\nblockquote.epigraph {\n  margin: 2em 5em ; }\n\ndl.docutils dd {\n  margin-bottom: 0.5em }\n\nobject[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {\n  overflow: hidden;\n}\n\n/* Uncomment (and remove this text!) to get bold-faced definition list terms\ndl.docutils dt {\n  font-weight: bold }\n*/\n\ndiv.abstract {\n  margin: 2em 5em }\n\ndiv.abstract p.topic-title {\n  font-weight: bold ;\n  text-align: center }\n\ndiv.admonition, div.attention, div.caution, div.danger, div.error,\ndiv.hint, div.important, div.note, div.tip, div.warning {\n  margin: 2em ;\n  border: medium outset ;\n  padding: 1em }\n\ndiv.admonition p.admonition-title, div.hint p.admonition-title,\ndiv.important p.admonition-title, div.note p.admonition-title,\ndiv.tip p.admonition-title {\n  font-weight: bold ;\n  font-family: sans-serif }\n\ndiv.attention p.admonition-title, div.caution p.admonition-title,\ndiv.danger p.admonition-title, div.error p.admonition-title,\ndiv.warning p.admonition-title, .code .error {\n  color: red ;\n  font-weight: bold ;\n  font-family: sans-serif }\n\n/* Uncomment (and remove this text!) to get reduced vertical space in\n   compound paragraphs.\ndiv.compound .compound-first, div.compound .compound-middle {\n  margin-bottom: 0.5em }\n\ndiv.compound .compound-last, div.compound .compound-middle {\n  margin-top: 0.5em }\n*/\n\ndiv.dedication {\n  margin: 2em 5em ;\n  text-align: center ;\n  font-style: italic }\n\ndiv.dedication p.topic-title {\n  font-weight: bold ;\n  font-style: normal }\n\ndiv.figure {\n  margin-left: 2em ;\n  margin-right: 2em }\n\ndiv.footer, div.header {\n  clear: both;\n  font-size: smaller }\n\ndiv.line-block {\n  display: block ;\n  margin-top: 1em ;\n  margin-bottom: 1em }\n\ndiv.line-block div.line-block {\n  margin-top: 0 ;\n  margin-bottom: 0 ;\n  margin-left: 1.5em }\n\ndiv.sidebar {\n  margin: 0 0 0.5em 1em ;\n  border: medium outset ;\n  padding: 1em ;\n  background-color: #ffffee ;\n  width: 40% ;\n  float: right ;\n  clear: right }\n\ndiv.sidebar p.rubric {\n  font-family: sans-serif ;\n  font-size: medium }\n\ndiv.system-messages {\n  margin: 5em }\n\ndiv.system-messages h1 {\n  color: red }\n\ndiv.system-message {\n  border: medium outset ;\n  padding: 1em }\n\ndiv.system-message p.system-message-title {\n  color: red ;\n  font-weight: bold }\n\ndiv.topic {\n  margin: 2em }\n\nh1.section-subtitle, h2.section-subtitle, h3.section-subtitle,\nh4.section-subtitle, h5.section-subtitle, h6.section-subtitle {\n  margin-top: 0.4em }\n\nh1.title {\n  text-align: center }\n\nh2.subtitle {\n  text-align: center }\n\nhr.docutils {\n  width: 75% }\n\nimg.align-left, .figure.align-left, object.align-left {\n  clear: left ;\n  float: left ;\n  margin-right: 1em }\n\nimg.align-right, .figure.align-right, object.align-right {\n  clear: right ;\n  float: right ;\n  margin-left: 1em }\n\nimg.align-center, .figure.align-center, object.align-center {\n  display: block;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n.align-left {\n  text-align: left }\n\n.align-center {\n  clear: both ;\n  text-align: center }\n\n.align-right {\n  text-align: right }\n\n/* reset inner alignment in figures */\ndiv.align-right {\n  text-align: inherit }\n\n/* div.align-center * { */\n/*   text-align: left } */\n\nol.simple, ul.simple {\n  margin-bottom: 1em }\n\nol.arabic {\n  list-style: decimal }\n\nol.loweralpha {\n  list-style: lower-alpha }\n\nol.upperalpha {\n  list-style: upper-alpha }\n\nol.lowerroman {\n  list-style: lower-roman }\n\nol.upperroman {\n  list-style: upper-roman }\n\np.attribution {\n  text-align: right ;\n  margin-left: 50% }\n\np.caption {\n  font-style: italic }\n\np.credits {\n  font-style: italic ;\n  font-size: smaller }\n\np.label {\n  white-space: nowrap }\n\np.rubric {\n  font-weight: bold ;\n  font-size: larger ;\n  color: maroon ;\n  text-align: center }\n\np.sidebar-title {\n  font-family: sans-serif ;\n  font-weight: bold ;\n  font-size: larger }\n\np.sidebar-subtitle {\n  font-family: sans-serif ;\n  font-weight: bold }\n\np.topic-title {\n  font-weight: bold }\n\npre.address {\n  margin-bottom: 0 ;\n  margin-top: 0 ;\n  font: inherit }\n\npre.literal-block, pre.doctest-block, pre.math, pre.code {\n  margin-left: 2em ;\n  margin-right: 2em }\n\npre.code .ln { color: grey; } /* line numbers */\npre.code, code { background-color: #eeeeee }\npre.code .comment, code .comment { color: #5C6576 }\npre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }\npre.code .literal.string, code .literal.string { color: #0C5404 }\npre.code .name.builtin, code .name.builtin { color: #352B84 }\npre.code .deleted, code .deleted { background-color: #DEB0A1}\npre.code .inserted, code .inserted { background-color: #A3D289}\n\nspan.classifier {\n  font-family: sans-serif ;\n  font-style: oblique }\n\nspan.classifier-delimiter {\n  font-family: sans-serif ;\n  font-weight: bold }\n\nspan.interpreted {\n  font-family: sans-serif }\n\nspan.option {\n  white-space: nowrap }\n\nspan.pre {\n  white-space: pre }\n\nspan.problematic {\n  color: red }\n\nspan.section-subtitle {\n  /* font-size relative to parent (h1..h6 element) */\n  font-size: 80% }\n\ntable.citation {\n  border-left: solid 1px gray;\n  margin-left: 1px }\n\ntable.docinfo {\n  margin: 2em 4em }\n\ntable.docutils {\n  margin-top: 0.5em ;\n  margin-bottom: 0.5em }\n\ntable.footnote {\n  border-left: solid 1px black;\n  margin-left: 1px }\n\ntable.docutils td, table.docutils th,\ntable.docinfo td, table.docinfo th {\n  padding-left: 0.5em ;\n  padding-right: 0.5em ;\n  vertical-align: top }\n\ntable.docutils th.field-name, table.docinfo th.docinfo-name {\n  font-weight: bold ;\n  text-align: left ;\n  white-space: nowrap ;\n  padding-left: 0 }\n\n/* "booktabs" style (no vertical lines) */\ntable.docutils.booktabs {\n  border: 0px;\n  border-top: 2px solid;\n  border-bottom: 2px solid;\n  border-collapse: collapse;\n}\ntable.docutils.booktabs * {\n  border: 0px;\n}\ntable.docutils.booktabs th {\n  border-bottom: thin solid;\n  text-align: left;\n}\n\nh1 tt.docutils, h2 tt.docutils, h3 tt.docutils,\nh4 tt.docutils, h5 tt.docutils, h6 tt.docutils {\n  font-size: 100% }\n\nul.auto-toc {\n  list-style-type: none }\n\n</style>\n',
 'subtitle': '',
 'title': u'1234',
 'version': '0.12',
 'whole': u'<?xml version="1.0" encoding="utf-8" ?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />\n<title>1234</title>\n<style type="text/css">\n\n/*\n:Author: David Goodger (goodger@python.org)\n:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $\n:Copyright: This stylesheet has been placed in the public domain.\n\nDefault cascading style sheet for the HTML output of Docutils.\n\nSee http://docutils.sf.net/docs/howto/html-stylesheets.html for how to\ncustomize this style sheet.\n*/\n\n/* used to remove borders from tables and images */\n.borderless, table.borderless td, table.borderless th {\n  border: 0 }\n\ntable.borderless td, table.borderless th {\n  /* Override padding for "table.docutils td" with "! important".\n     The right padding separates the table cells. */\n  padding: 0 0.5em 0 0 ! important }\n\n.first {\n  /* Override more specific margin styles with "! important". */\n  margin-top: 0 ! important }\n\n.last, .with-subtitle {\n  margin-bottom: 0 ! important }\n\n.hidden {\n  display: none }\n\na.toc-backref {\n  text-decoration: none ;\n  color: black }\n\nblockquote.epigraph {\n  margin: 2em 5em ; }\n\ndl.docutils dd {\n  margin-bottom: 0.5em }\n\nobject[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {\n  overflow: hidden;\n}\n\n/* Uncomment (and remove this text!) to get bold-faced definition list terms\ndl.docutils dt {\n  font-weight: bold }\n*/\n\ndiv.abstract {\n  margin: 2em 5em }\n\ndiv.abstract p.topic-title {\n  font-weight: bold ;\n  text-align: center }\n\ndiv.admonition, div.attention, div.caution, div.danger, div.error,\ndiv.hint, div.important, div.note, div.tip, div.warning {\n  margin: 2em ;\n  border: medium outset ;\n  padding: 1em }\n\ndiv.admonition p.admonition-title, div.hint p.admonition-title,\ndiv.important p.admonition-title, div.note p.admonition-title,\ndiv.tip p.admonition-title {\n  font-weight: bold ;\n  font-family: sans-serif }\n\ndiv.attention p.admonition-title, div.caution p.admonition-title,\ndiv.danger p.admonition-title, div.error p.admonition-title,\ndiv.warning p.admonition-title, .code .error {\n  color: red ;\n  font-weight: bold ;\n  font-family: sans-serif }\n\n/* Uncomment (and remove this text!) to get reduced vertical space in\n   compound paragraphs.\ndiv.compound .compound-first, div.compound .compound-middle {\n  margin-bottom: 0.5em }\n\ndiv.compound .compound-last, div.compound .compound-middle {\n  margin-top: 0.5em }\n*/\n\ndiv.dedication {\n  margin: 2em 5em ;\n  text-align: center ;\n  font-style: italic }\n\ndiv.dedication p.topic-title {\n  font-weight: bold ;\n  font-style: normal }\n\ndiv.figure {\n  margin-left: 2em ;\n  margin-right: 2em }\n\ndiv.footer, div.header {\n  clear: both;\n  font-size: smaller }\n\ndiv.line-block {\n  display: block ;\n  margin-top: 1em ;\n  margin-bottom: 1em }\n\ndiv.line-block div.line-block {\n  margin-top: 0 ;\n  margin-bottom: 0 ;\n  margin-left: 1.5em }\n\ndiv.sidebar {\n  margin: 0 0 0.5em 1em ;\n  border: medium outset ;\n  padding: 1em ;\n  background-color: #ffffee ;\n  width: 40% ;\n  float: right ;\n  clear: right }\n\ndiv.sidebar p.rubric {\n  font-family: sans-serif ;\n  font-size: medium }\n\ndiv.system-messages {\n  margin: 5em }\n\ndiv.system-messages h1 {\n  color: red }\n\ndiv.system-message {\n  border: medium outset ;\n  padding: 1em }\n\ndiv.system-message p.system-message-title {\n  color: red ;\n  font-weight: bold }\n\ndiv.topic {\n  margin: 2em }\n\nh1.section-subtitle, h2.section-subtitle, h3.section-subtitle,\nh4.section-subtitle, h5.section-subtitle, h6.section-subtitle {\n  margin-top: 0.4em }\n\nh1.title {\n  text-align: center }\n\nh2.subtitle {\n  text-align: center }\n\nhr.docutils {\n  width: 75% }\n\nimg.align-left, .figure.align-left, object.align-left {\n  clear: left ;\n  float: left ;\n  margin-right: 1em }\n\nimg.align-right, .figure.align-right, object.align-right {\n  clear: right ;\n  float: right ;\n  margin-left: 1em }\n\nimg.align-center, .figure.align-center, object.align-center {\n  display: block;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n.align-left {\n  text-align: left }\n\n.align-center {\n  clear: both ;\n  text-align: center }\n\n.align-right {\n  text-align: right }\n\n/* reset inner alignment in figures */\ndiv.align-right {\n  text-align: inherit }\n\n/* div.align-center * { */\n/*   text-align: left } */\n\nol.simple, ul.simple {\n  margin-bottom: 1em }\n\nol.arabic {\n  list-style: decimal }\n\nol.loweralpha {\n  list-style: lower-alpha }\n\nol.upperalpha {\n  list-style: upper-alpha }\n\nol.lowerroman {\n  list-style: lower-roman }\n\nol.upperroman {\n  list-style: upper-roman }\n\np.attribution {\n  text-align: right ;\n  margin-left: 50% }\n\np.caption {\n  font-style: italic }\n\np.credits {\n  font-style: italic ;\n  font-size: smaller }\n\np.label {\n  white-space: nowrap }\n\np.rubric {\n  font-weight: bold ;\n  font-size: larger ;\n  color: maroon ;\n  text-align: center }\n\np.sidebar-title {\n  font-family: sans-serif ;\n  font-weight: bold ;\n  font-size: larger }\n\np.sidebar-subtitle {\n  font-family: sans-serif ;\n  font-weight: bold }\n\np.topic-title {\n  font-weight: bold }\n\npre.address {\n  margin-bottom: 0 ;\n  margin-top: 0 ;\n  font: inherit }\n\npre.literal-block, pre.doctest-block, pre.math, pre.code {\n  margin-left: 2em ;\n  margin-right: 2em }\n\npre.code .ln { color: grey; } /* line numbers */\npre.code, code { background-color: #eeeeee }\npre.code .comment, code .comment { color: #5C6576 }\npre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }\npre.code .literal.string, code .literal.string { color: #0C5404 }\npre.code .name.builtin, code .name.builtin { color: #352B84 }\npre.code .deleted, code .deleted { background-color: #DEB0A1}\npre.code .inserted, code .inserted { background-color: #A3D289}\n\nspan.classifier {\n  font-family: sans-serif ;\n  font-style: oblique }\n\nspan.classifier-delimiter {\n  font-family: sans-serif ;\n  font-weight: bold }\n\nspan.interpreted {\n  font-family: sans-serif }\n\nspan.option {\n  white-space: nowrap }\n\nspan.pre {\n  white-space: pre }\n\nspan.problematic {\n  color: red }\n\nspan.section-subtitle {\n  /* font-size relative to parent (h1..h6 element) */\n  font-size: 80% }\n\ntable.citation {\n  border-left: solid 1px gray;\n  margin-left: 1px }\n\ntable.docinfo {\n  margin: 2em 4em }\n\ntable.docutils {\n  margin-top: 0.5em ;\n  margin-bottom: 0.5em }\n\ntable.footnote {\n  border-left: solid 1px black;\n  margin-left: 1px }\n\ntable.docutils td, table.docutils th,\ntable.docinfo td, table.docinfo th {\n  padding-left: 0.5em ;\n  padding-right: 0.5em ;\n  vertical-align: top }\n\ntable.docutils th.field-name, table.docinfo th.docinfo-name {\n  font-weight: bold ;\n  text-align: left ;\n  white-space: nowrap ;\n  padding-left: 0 }\n\n/* "booktabs" style (no vertical lines) */\ntable.docutils.booktabs {\n  border: 0px;\n  border-top: 2px solid;\n  border-bottom: 2px solid;\n  border-collapse: collapse;\n}\ntable.docutils.booktabs * {\n  border: 0px;\n}\ntable.docutils.booktabs th {\n  border-bottom: thin solid;\n  text-align: left;\n}\n\nh1 tt.docutils, h2 tt.docutils, h3 tt.docutils,\nh4 tt.docutils, h5 tt.docutils, h6 tt.docutils {\n  font-size: 100% }\n\nul.auto-toc {\n  list-style-type: none }\n\n</style>\n</head>\n<body>\n<div class="document" id="id1">\n<h1 class="title">1234</h1>\n\n<p>Do this:</p>\n<pre class="literal-block">\nsage: factorial(8)\n</pre>\n</div>\n</body>\n</html>\n'}

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

By the way, I did sage -f docutils just before this...

@migeruhito
Copy link
Contributor Author

It seems to be fine.

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

Huh. I have to go soon but may try to track this down with a separate Sage install, maybe on SMC or something. Not sure why this isn't working.

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2015

Doing this with Sage 6.9 yields the same result for me. Not sure what the problem is.

@migeruhito
Copy link
Contributor Author

No idea. I can't reproduce the problem.

@kcrisman
Copy link
Member

No idea. I can't reproduce the problem.

I'm just going to rebuild 6.9 from scratch and then do this all again. So annoying. I'm sure it's fine, I've been having other weird troubles as well.

@kcrisman
Copy link
Member

Okay, I see what happened - indeed something local. I'm embarrassed to even say what it was - wrong file extension! I specifically made my Mac change it to .rst but somehow it switched it back (it does this automatically and is quite annoying, I have to say, another reason to use command line more, I guess).

@kcrisman
Copy link
Member

So I will merge this.

By the way, are you having any trouble evaluating cells in the live documentation e.g. http://localhost:8080/doc/live/tutorial/tour_rings.html ? I tried removing my cache and who knows what else but nothing seems to work in any browser. @jdemeyer says here that it works so I'm hoping that I'm just imagining things.

kcrisman added a commit that referenced this pull request Dec 10, 2015
Live docs problems with autoescaping
@kcrisman kcrisman merged commit fc57a8e into sagemath:master Dec 10, 2015
@migeruhito
Copy link
Contributor Author

By the way, are you having any trouble evaluating cells in the live documentation e.g. http://localhost:8080/doc/live/tutorial/tour_rings.html ?

It works in my system (with the current master branch after merging).

@migeruhito migeruhito deleted the autoescape_livedocs branch December 10, 2015 09:22
@kcrisman kcrisman mentioned this pull request Dec 14, 2015
@kcrisman
Copy link
Member

See #357 for followup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants