From 7a1636dd746ed9c3f87585214675566e7bc1f2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Wed, 20 Jan 2016 20:25:15 +0100 Subject: [PATCH] Changed folder hirerarchy for docs/ . --- .travis.yml | 15 ++--- graph-lib/make/make.rkt | 125 ++++++++++++++++++++------------------ graph-lib/web/index.scrbl | 31 ++++++++++ 3 files changed, 106 insertions(+), 65 deletions(-) create mode 100644 graph-lib/web/index.scrbl diff --git a/.travis.yml b/.travis.yml index c790ccb..6c51f5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,11 +32,6 @@ before_install: - latex newunicodechar.ins - mkdir -p "$latex_home/tex/latex/newunicodechar" - mv newunicodechar.sty "$latex_home/tex/latex/newunicodechar" -- echo "Automatic push to gh-pages" -- if test -e ~/gh-pages; then rm -rf ~/gh-pages; fi -- git config --global user.name "Travis CI" -- git config --global user.email "travis@nobody.com" -- git init ~/gh-pages - echo "Temporary switch to my fork of cover:" - git clone https://github.com/jsmaniac/cover.git -b multiple-output-formats ~/cover-tool/cover - (cd ~/cover-tool/cover; raco pkg install --deps search-auto --update-deps --skip-installed) @@ -54,8 +49,14 @@ script: - make after_script: -- mv -i coverage docs ~/gh-pages -- mv -i make/index.html.root ~/gh-pages/index.html +- echo "Automatic push to gh-pages" +- git config --global user.name "Travis CI" +- git config --global user.email "travis@nobody.com" +- if test -e ~/gh-pages; then rm -rf ~/gh-pages; fi +#- mv -i coverage docs +- mv -i docs ~/gh-pages +- git init ~/gh-pages +#- mv -i make/index.html.root ~/gh-pages/index.html - mkdir -p ~/gh-pages/lib/doc/MathJax - echo 'document.write("");' > ~/gh-pages/lib/doc/MathJax/MathJax.js - touch ~/gh-pages/.nojekyll diff --git a/graph-lib/make/make.rkt b/graph-lib/make/make.rkt index e29b0a7..de38c07 100644 --- a/graph-lib/make/make.rkt +++ b/graph-lib/make/make.rkt @@ -53,22 +53,24 @@ (define lp2-files (exclude-dirs (find-files-by-extension ".lp2.rkt"))) (define rkt-files (exclude-dirs (find-files-by-extension ".rkt"))) (define doc-sources (append scrbl-files lp2-files)) -(define html-files (map (λ ([scrbl-or-lp2 : Path]) - (build-path "docs/" - (regexp-case (path->string scrbl-or-lp2) - [#rx"\\.scrbl" - ".html"] - [#rx"\\.lp2\\.rkt" - ".lp2.html"]))) - doc-sources)) -(define pdf-files (map (λ ([scrbl-or-lp2 : Path]) - (build-path "docs/" - (regexp-case (path->string scrbl-or-lp2) - [#rx"\\.scrbl" - ".pdf"] - [#rx"\\.lp2\\.rkt" - ".lp2.pdf"]))) - doc-sources)) +(define html-files + (map (λ ([scrbl-or-lp2 : Path]) + (build-path "docs/" + (regexp-case (regexp-case (path->string scrbl-or-lp2) + [#rx"\\.scrbl$" ".html"] + [#rx"\\.lp2\\.rkt$" ".lp2.html"]) + [#rx"^web/" ""] + [#rx"^" "docs/"]))) + doc-sources)) +(define pdf-files + (map (λ ([scrbl-or-lp2 : Path]) + (build-path "docs/" + (regexp-case (regexp-case (path->string scrbl-or-lp2) + [#rx"\\.scrbl$" ".pdf"] + [#rx"\\.lp2\\.rkt$" ".lp2.pdf"]) + [#rx"^web/" ""] + [#rx"^" "docs/"]))) + doc-sources)) (define mathjax-links (map (λ ([d : Path]) (build-path d "MathJax")) (remove-duplicates (map dirname html-files)))) @@ -77,34 +79,37 @@ ; TODO: add --html-tree and '(other . "…") to be future-proof. (U "--html" "--htmls" "--latex" "--pdf" "--dvipdf" "--latex-section" "--text" "--markdown")) -(: scribble (→ Path (Listof Path) ScribbleRenderers Any)) -(define (scribble file all-files renderer) +(: scribble (→ Path Path (Listof Path) (Listof Path) ScribbleRenderers Any)) +(define (scribble file dest-file all-files all-dest-files renderer) + (define dest-dir (dirname dest-file)) + (make-directory* dest-dir) (run `(,(find-executable-path-or-fail "scribble") ,renderer - "--dest" ,(build-path "docs/" (dirname file)) + "--dest" ,dest-dir;,(build-path "docs/" (dirname file)) "+m" "--redirect-main" "http://docs.racket-lang.org/" - "--info-out" ,(build-path "docs/" (path-append - (path-append file renderer) - ".sxref")) - ,@(append-map (λ ([f : Path-String]) : (Listof Path-String) - (let ([sxref (build-path "docs/" - (path-append - (path-append f renderer) - ".sxref"))]) + "--info-out" ,(path-append + dest-file + ".sxref") + ,@(append-map (λ ([f : Path-String] [dst : Path-String]) + : (Listof Path-String) + (let ([sxref (path-append dst ".sxref")]) (if (file-exists? sxref) (list "++info-in" sxref) (list)))) - (remove file all-files)) + (remove file all-files) + (remove dest-file all-dest-files)) ,file))) -(: scribble-all (→ (Listof Path) ScribbleRenderers Any)) -(define (scribble-all files renderer) +(: scribble-all (→ (Listof Path) (Listof Path) ScribbleRenderers Any)) +(define (scribble-all files dest-files renderer) ;; TODO: compile everything twice, so that the cross-references are correct. - (for ([f (in-list files)]) - (scribble f files renderer)) - (for ([f (in-list files)]) - (scribble f files renderer))) + (for ([f (in-list files)] + [dst (in-list dest-files)]) + (scribble f dst files dest-files renderer)) + (for ([f (in-list files)] + [dst (in-list dest-files)]) + (scribble f dst files dest-files renderer))) ;(make-collection "phc" rkt-files (argv)) ;(make-collection "phc" '("graph/all-fields.rkt") #("zo")) @@ -135,6 +140,31 @@ "-j" "8" ,@rkt-files)) +;; Dependency graph, must be done before docs. +(begin + (make-directory* "docs/") + (run! (list (find-executable-path-or-fail "racket") + "make/dependency-graph.rkt" + "graph/__DEBUG_graph__.rkt" + "docs/deps.dot")) + + (run! (list (find-executable-path-or-fail "dot") + "docs/deps.dot" + "-Tpng" + "-Nfontsize=12" + "-o" "docs/deps.png")) + + (run! (list (find-executable-path-or-fail "dot") + "docs/deps.dot" + "-Tsvg" + "-Nfontsize=12" + "-o" "docs/deps.svg")) + + (run! (list (find-executable-path-or-fail "dot") + "docs/deps.dot" + "-Tpdf" + "-o" "docs/deps.pdf"))) + (make/proc (rules (list "zo" (append html-files pdf-files @@ -144,13 +174,13 @@ (html) (scrbl-or-lp2) #;(scribble (list scrbl-or-lp2) doc-sources "--html") - (scribble-all doc-sources "--html")) + (scribble-all doc-sources html-files "--html")) (for/rules ([scrbl-or-lp2 doc-sources] [pdf pdf-files]) (pdf) (scrbl-or-lp2) #;(scribble (list scrbl-or-lp2) doc-sources "--pdf") - (scribble-all doc-sources "--pdf")) + (scribble-all doc-sources pdf-files "--pdf")) (for/rules ([mathjax-link mathjax-links]) (mathjax-link) () @@ -172,6 +202,7 @@ (run! `(,(find-executable-path-or-fail "raco") "cover" + "-d" "./docs/coverage" "-s" "doc" "-s" "test" "-f" "html" @@ -215,25 +246,3 @@ EOF )) |# - -(run! (list (find-executable-path-or-fail "racket") - "make/dependency-graph.rkt" - "graph/__DEBUG_graph__.rkt" - "docs/deps.dot")) - -(run! (list (find-executable-path-or-fail "dot") - "docs/deps.dot" - "-Tpng" - "-Nfontsize=12" - "-o" "docs/deps.png")) - -(run! (list (find-executable-path-or-fail "dot") - "docs/deps.dot" - "-Tsvg" - "-Nfontsize=12" - "-o" "docs/deps.svg")) - -(run! (list (find-executable-path-or-fail "dot") - "docs/deps.dot" - "-Tpdf" - "-o" "docs/deps.pdf")) \ No newline at end of file diff --git a/graph-lib/web/index.scrbl b/graph-lib/web/index.scrbl new file mode 100644 index 0000000..2266340 --- /dev/null +++ b/graph-lib/web/index.scrbl @@ -0,0 +1,31 @@ +#lang scribble/manual +@(require "../lib/doc.rkt") +@doc-lib-setup + +@title[#:style manual-doc-style]{Ph.C} + +@hyperlink["https://travis-ci.org/jsmaniac/phc"]{ + @remote-image["https://travis-ci.org/jsmaniac/phc.png?branch=master"]{ + Build Status}} +@hyperlink["https://coveralls.io/github/jsmaniac/phc?branch=master"]{ + @remote-image[(string-append "https://coveralls.io/repos/github/jsmaniac/phc/" + "badge.svg?branch=master")]{ + Coverage Status}} + +@;@(table-of-contents) + +@section{Introduction} + +@section{Documentation} + +@itemlist[ + @item{@hyperlink["docs/"]{Documentation}} + @item{@hyperlink["coverage/"]{Coverage info}}] + +@section{Dependency diagram} + +A @hyperlink["deps.png"]{PNG version} and a @hyperlink["deps.pdf"]{PDF version} +are available. + +@hyperlink["deps.svg"]{ + @image["docs/deps" #:suffixes '(".pdf" ".svg")]{Dependency diagram}}