~ubuntu-branches/ubuntu/wily/acl2/wily

« back to all changes in this revision

Viewing changes to books/xdoc/save-fancy.lisp

  • Committer: Package Import Robot
  • Author(s): Camm Maguire
  • Date: 2015-01-16 10:35:45 UTC
  • mfrom: (3.3.26 sid)
  • Revision ID: package-import@ubuntu.com-20150116103545-prehe9thgo79o8w8
Tags: 7.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
(include-book "importance")
38
38
(include-book "linkcheck")
39
39
(include-book "centaur/bridge/to-json" :dir :system)
 
40
(include-book "oslib/copy" :dir :system)
40
41
(set-state-ok t)
41
42
(program)
42
43
 
395
396
                  (clean-topics topics)))))
396
397
 
397
398
       (- (cw "; Saving JSON files for ~x0 topics.~%" (len topics)))
398
 
       ((mv topics xtopics sitemap state)
 
399
       ((mv topics xtopics ?sitemap state)
399
400
        (time$ (order-topics-by-importance topics state)
400
401
               :msg "; Importance sorting topics: ~st sec, ~sa bytes.~%"
401
402
               :mintime 1/2))
402
403
 
403
 
       (smfile (oslib::catpath dir "sitemap.xml"))
404
 
       ((mv channel state) (open-output-channel smfile :character state))
405
 
       (state (princ$ sitemap channel state))
406
 
       (state (close-output-channel channel state))
 
404
       ;; (smfile (oslib::catpath dir "sitemap.xml"))
 
405
       ;; ((mv channel state) (open-output-channel smfile :character state))
 
406
       ;; (state (princ$ sitemap channel state))
 
407
       ;; (state (close-output-channel channel state))
407
408
 
408
409
       (lcfile (oslib::catpath dir "linkcheck.html"))
409
410
       ((mv channel state) (open-output-channel lcfile :character state))
449
450
    state))
450
451
 
451
452
 
 
453
(defun copy-resource-dirs (resdir              ;; path to new-manual/res
 
454
                           resource-dirs-alist ;; alist created by add-resource-directory
 
455
                           state)
 
456
  (b* (((when (atom resource-dirs-alist))
 
457
        state)
 
458
       ((cons dirname source-path) (car resource-dirs-alist))
 
459
       (target-path (oslib::catpath resdir dirname))
 
460
       (- (cw ";; Copying ~s0 --> ~s1.~%" source-path target-path))
 
461
       (state       (oslib::copy! source-path target-path :recursive t)))
 
462
    (copy-resource-dirs resdir (cdr resource-dirs-alist) state)))
 
463
 
452
464
(defun prepare-fancy-dir (dir state)
453
465
  (b* (((unless (stringp dir))
454
466
        (prog2$ (er hard? 'prepare-fancy-dir
455
467
                    "Dir must be a string, but is: ~x0.~%" dir)
456
468
                state))
457
 
       (- (cw "; Preparing directory ~s0.~%" dir))
458
 
 
459
 
       (dir/lib        (oslib::catpath dir "lib"))
460
 
       (dir/images     (oslib::catpath dir "images"))
461
 
       (state          (oslib::mkdir! dir))
462
 
       (state          (oslib::mkdir! dir/lib))
463
 
       (state          (oslib::mkdir! dir/images))
464
469
 
465
470
       (dir-system     (acl2::f-get-global 'acl2::system-books-dir state))
466
471
       (xdoc-dir       (oslib::catpath dir-system "xdoc"))
467
 
       (xdoc/classic   (oslib::catpath xdoc-dir "classic"))
468
472
       (xdoc/fancy     (oslib::catpath xdoc-dir "fancy"))
469
 
       (xdoc/fancy/lib (oslib::catpath xdoc/fancy "lib"))
470
 
 
471
 
       (- (cw "Copying fancy viewer main files...~%"))
472
 
       (state          (stupid-copy-files xdoc/fancy
473
 
                                          (list "collapse_subtopics.png"
474
 
                                                "download.png"
475
 
                                                "expand_subtopics.png"
476
 
                                                "favicon.png"
477
 
                                                "Icon_External_Link.png"
478
 
                                                "index.html"
479
 
                                                "xdoc-home.png"
480
 
                                                "xdoc-logo.png"
481
 
                                                "leaf.png"
482
 
                                                "LICENSE"
483
 
                                                "minus.png"
484
 
                                                "plus.png"
485
 
                                                "print.css"
486
 
                                                "print.html"
487
 
                                                "printer.png"
488
 
                                                "render.js"
489
 
                                                "render-html.xsl"
490
 
                                                "style.css"
491
 
                                                "view_flat.png"
492
 
                                                "view_tree.png"
493
 
                                                "config.js"
494
 
                                                "xdoc.js"
495
 
                                                "xslt.js"
496
 
                                                "xdoc_index.js"
497
 
                                                "xdataget.pl"
498
 
                                                "xdata2html.pl"
499
 
                                                "xdata2sql.pl"
500
 
                                                "zip.sh"
501
 
                                                ".htaccess"
502
 
                                                )
503
 
                                          dir state))
504
 
 
505
 
       (- (cw "Copying fancy viewer library files...~%"))
506
 
       (state          (stupid-copy-files xdoc/fancy/lib
507
 
                                          (list "jquery-2.0.3.js"
508
 
                                                "jquery-2.0.3.min.js"
509
 
                                                "jquery.base64.js"
510
 
                                                "jquery.powertip.css"
511
 
                                                "jquery.powertip.js"
512
 
                                                "jquery.powertip.min.js"
513
 
                                                "lazyload.js"
514
 
                                                "typeahead.js"
515
 
                                                "typeahead.min.js")
516
 
                                          dir/lib state))
517
 
 
518
 
       (- (cw "Copying ACL2 tour graphics...~%"))
519
 
       (state          (stupid-copy-files xdoc/classic
520
 
                                          *acl2-graphics*
521
 
                                          dir/images state)))
 
473
 
 
474
       (- (cw "; Preparing directory ~s0.~%" dir))
 
475
       (state          (oslib::rmtree! dir))
 
476
 
 
477
       (- (cw "; Copying fancy viewer files.~%"))
 
478
       (state          (oslib::copy! xdoc/fancy dir :recursive t))
 
479
 
 
480
       (- (cw "; Copying resource directories.~%"))
 
481
       (resdir              (oslib::catpath dir "res"))
 
482
       (resource-dirs-alist (cdr (assoc 'resource-dirs (table-alist 'xdoc (w state)))))
 
483
       (state               (copy-resource-dirs resdir resource-dirs-alist state)))
 
484
 
522
485
    state))
523
486
 
524
487
(defttag :xdoc) ; for sys-call+ call below
549
512
                  (run-fancy-zip dir state)
550
513
                state)))
551
514
    state))
552