395
396
(clean-topics topics)))))
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.~%"
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))
408
409
(lcfile (oslib::catpath dir "linkcheck.html"))
409
410
((mv channel state) (open-output-channel lcfile :character state))
453
(defun copy-resource-dirs (resdir ;; path to new-manual/res
454
resource-dirs-alist ;; alist created by add-resource-directory
456
(b* (((when (atom resource-dirs-alist))
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)))
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)
457
(- (cw "; Preparing directory ~s0.~%" dir))
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))
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"))
471
(- (cw "Copying fancy viewer main files...~%"))
472
(state (stupid-copy-files xdoc/fancy
473
(list "collapse_subtopics.png"
475
"expand_subtopics.png"
477
"Icon_External_Link.png"
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"
510
"jquery.powertip.css"
512
"jquery.powertip.min.js"
518
(- (cw "Copying ACL2 tour graphics...~%"))
519
(state (stupid-copy-files xdoc/classic
474
(- (cw "; Preparing directory ~s0.~%" dir))
475
(state (oslib::rmtree! dir))
477
(- (cw "; Copying fancy viewer files.~%"))
478
(state (oslib::copy! xdoc/fancy dir :recursive t))
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)))
524
487
(defttag :xdoc) ; for sys-call+ call below