mirror of https://gitee.com/XmacsLabs/planet.git
Convert all doc to html for CICD (#37)
This commit is contained in:
parent
debfddd081
commit
4c47f5c278
|
@ -35,5 +35,5 @@ jobs:
|
||||||
env:
|
env:
|
||||||
REPO: self
|
REPO: self
|
||||||
BRANCH: gh-pages
|
BRANCH: gh-pages
|
||||||
FOLDER: CICD/html
|
FOLDER: CICD/html/planet
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -11,6 +11,9 @@
|
||||||
;;
|
;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(import (srfi srfi-13))
|
||||||
|
(import (srfi srfi-1))
|
||||||
|
|
||||||
(define (list-files dir)
|
(define (list-files dir)
|
||||||
(let* ((filtered-files (url->list
|
(let* ((filtered-files (url->list
|
||||||
(url-expand
|
(url-expand
|
||||||
|
@ -18,10 +21,19 @@
|
||||||
(url-append (url-descendants dir)
|
(url-append (url-descendants dir)
|
||||||
(url-or (url-wildcard "*.tm")
|
(url-or (url-wildcard "*.tm")
|
||||||
(url-wildcard "*.tmu")))
|
(url-wildcard "*.tmu")))
|
||||||
"fr")))))
|
"fr"))))
|
||||||
|
(filtered-files-no-conflict (filter (lambda (file)
|
||||||
|
(let ((file-string (url->string file)))
|
||||||
|
(and (not (string-contains? file-string "MoganSTEMTutorial"))
|
||||||
|
(not (string-contains? file-string "LaTeX"))
|
||||||
|
(not (string-contains? file-string "UIC"))
|
||||||
|
(not (string-contains? file-string "X202402预备会议"))
|
||||||
|
(not (string-contains? file-string "SICP"))
|
||||||
|
(not (string-contains? file-string "LCPU_x_USTCLUG_Salon")))))
|
||||||
|
filtered-files)))
|
||||||
; (display "Filtered files:\n")
|
; (display "Filtered files:\n")
|
||||||
; (for-each (lambda (file) (display (string-append (url->string file) "\n"))) filtered-files)
|
; (for-each (lambda (file) (display (string-append (url->string file) "\n"))) filtered-files)
|
||||||
filtered-files))
|
filtered-files-no-conflict))
|
||||||
|
|
||||||
(define (export-file-to-html file base-dir output-dir)
|
(define (export-file-to-html file base-dir output-dir)
|
||||||
(let* ((relative-path (url-delta base-dir file))
|
(let* ((relative-path (url-delta base-dir file))
|
||||||
|
@ -30,14 +42,14 @@
|
||||||
(html-file-url (url-glue output-file-url ".html"))
|
(html-file-url (url-glue output-file-url ".html"))
|
||||||
(output-dir-url (url-head html-file-url)))
|
(output-dir-url (url-head html-file-url)))
|
||||||
|
|
||||||
; Debugging information; expect information are just some example
|
; ; Debugging information; expect information are just some example
|
||||||
(display (string-append "Base directory: " (url->string base-dir) "\n")) ; Expect: file:///F:/mogan/planet/CICD/try
|
; (display (string-append "Base directory: " (url->string base-dir) "\n")) ; Expect: file:///F:/mogan/planet/CICD/try
|
||||||
(display (string-append "File: " (url->string file) "\n")) ; Expect: file:///F:/mogan/planet/CICD/try/2/24_10_tmhtml_test.tmu
|
; (display (string-append "File: " (url->string file) "\n")) ; Expect: file:///F:/mogan/planet/CICD/try/2/24_10_tmhtml_test.tmu
|
||||||
(display (string-append "Relative path: " (url->string relative-path) "\n")) ; Expect: /2/24_10_tmhtml_test.tmu
|
; (display (string-append "Relative path: " (url->string relative-path) "\n")) ; Expect: /2/24_10_tmhtml_test.tmu
|
||||||
(display (string-append "Output file URL (before unglue): " (url->string output-file-url) "\n")) ; Expect: file:///F:/mogan/planet/CICD/html/2/24_10_tmhtml_test.tmu
|
; (display (string-append "Output file URL (before unglue): " (url->string output-file-url) "\n")) ; Expect: file:///F:/mogan/planet/CICD/html/2/24_10_tmhtml_test.tmu
|
||||||
(display (string-append "Output file URL (after unglue): " (url->string (url-unglue output-file-url 3)) "\n")) ; Expect: file:///F:/mogan/planet/CICD/html/2/24_10_tmhtml_test
|
; (display (string-append "Output file URL (after unglue): " (url->string (url-unglue output-file-url 3)) "\n")) ; Expect: file:///F:/mogan/planet/CICD/html/2/24_10_tmhtml_test
|
||||||
(display (string-append "HTML file URL: " (url->string html-file-url) "\n")) ; Expect: file:///F:/mogan/planet/CICD/html/2/24_10_tmhtml_test.html
|
; (display (string-append "HTML file URL: " (url->string html-file-url) "\n")) ; Expect: file:///F:/mogan/planet/CICD/html/2/24_10_tmhtml_test.html
|
||||||
(display (string-append "Output directory URL: " (url->string output-dir-url) "\n")) ; Expect: file:///F:/mogan/planet/CICD/html/2
|
; (display (string-append "Output directory URL: " (url->string output-dir-url) "\n")) ; Expect: file:///F:/mogan/planet/CICD/html/2
|
||||||
|
|
||||||
(make-directory (url->string output-dir-url))
|
(make-directory (url->string output-dir-url))
|
||||||
(display (string-append "Exporting " (url->string file) " to " (url->string html-file-url) "\n"))
|
(display (string-append "Exporting " (url->string file) " to " (url->string html-file-url) "\n"))
|
||||||
|
@ -54,8 +66,11 @@
|
||||||
files)))
|
files)))
|
||||||
|
|
||||||
(tm-define (tm2html_CICD)
|
(tm-define (tm2html_CICD)
|
||||||
(url-exists? "/__w/planet/planet/jingkaimori")
|
; (url-exists? "/__w/planet/planet/jingkaimori")
|
||||||
(url-exists? "/__w/planet/planet/CICD")
|
; (url-exists? "/__w/planet/planet/CICD")
|
||||||
(export-directory "/__w/planet/planet/jingkaimori" "/__w/planet/planet/CICD/html")
|
; (define filtered-files (list-files "F:/mogan/planet"))
|
||||||
|
; (display filtered-files)
|
||||||
|
(export-directory "/__w/planet/planet" "/__w/planet/planet/CICD/html")
|
||||||
|
; (export-directory "F:/mogan/planet" "F:/mogan/planet/CICD/html")
|
||||||
(display "Conversion from tm/tmu to html end\n"))
|
(display "Conversion from tm/tmu to html end\n"))
|
||||||
|
|
Loading…
Reference in New Issue