#6187: [with patch, with positive review] After making a clone, the reference
manual (and other docs) should not have to be completely rebuilt.
---------------------------+------------------------------------------------
Reporter: jhpalmieri | Owner: tba
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.1
Component: documentation | Keywords:
Reviewer: John Cremona | Author: John Palmieri
Merged: |
---------------------------+------------------------------------------------
Comment(by mpatel):
The following may help with rebuilding the reference manual after cloning:
* Start with v4.0.2, or a vanilla `sage-clone` script, at least.
* Apply
{{{
diff --git a/doc/common/builder.py b/doc/common/builder.py
--- a/doc/common/builder.py
+++ b/doc/common/builder.py
@@ -353,6 +353,16 @@ class ReferenceBuilder(DocBuilder):
if os.path.exists(_sage):
copytree(_sage, os.path.join(self.dir, 'sage'))
+ # After "sage -clone", refresh the .rst file mtimes in
+ # environment.pickle.
+ if update_mtimes:
+ import time
+ env = self.get_sphinx_environment()
+ for doc in env.all_docs:
+ env.all_docs[doc] = time.time()
+ env_pickle = os.path.join(self._doctrees_dir(),
'environment.pickle')
+ env.topickle(env_pickle)
+
getattr(DocBuilder, build_type)(self, *args, **kwds)
def cache_filename(self):
@@ -645,6 +655,8 @@ def help_message():
parser = optparse.OptionParser(usage="usage: sage -docbuild [options]
name type")
parser.add_option("--jsmath", action="store_true",
help="render math using jsMath")
+parser.add_option("--update_mtimes", action="store_true",
+ help='update .rst file mtimes (e.g., after "sage
-clone")')
parser.print_help = help_message
if __name__ == '__main__':
@@ -653,6 +665,11 @@ if __name__ == '__main__':
if options.jsmath:
os.environ['SAGE_DOC_JSMATH'] = "True"
+ if options.update_mtimes:
+ update_mtimes = True
+ else:
+ update_mtimes = False
+
#Get the name of the document we are trying to build
try:
name, type = args
}}}
* Do `sage -clone foo` or, e.g., `cd $SAGE_ROOT/devel/sage-foo; cp -pr
../sage-bar/doc .`
* Update `builder.py`, if necessary.
* Do `sage -docbuild reference html --update_mtimes --jsmath`
* Do `sage -docbuild reference html --jsmath`
Note: I haven't tested this idea with #5350, other documents, other
builders, etc.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6187#comment:10>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---