зеркало из https://github.com/microsoft/same-ish.git
Remove custom docs code in favour of cljdoc
This commit is contained in:
Родитель
bd9f5b4e23
Коммит
5130cb1543
|
@ -1,40 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Unofficial Bash Strict Mode:
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
die() {
|
||||
echo $1 >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
LUMO=./node_modules/.bin/lumo
|
||||
|
||||
DOCDIR=$1
|
||||
[[ -d $DOCDIR ]] || die "Not a directory: $DOCDIR"
|
||||
|
||||
DOCROOT=$(dirname $DOCDIR)
|
||||
DOCVER=$(basename $DOCDIR)
|
||||
|
||||
echo "Updating latest link"
|
||||
rm $DOCROOT/latest
|
||||
ln -s $DOCVER $DOCROOT/latest
|
||||
|
||||
PREAMBLE="(require '[same :refer [set-comparator!]] '[same.ish :refer [default-comparator]]) (set-comparator! default-comparator)"
|
||||
|
||||
echo "Inserting data-preambles"
|
||||
sed -i '' -e 's/\(code class="klipse"\)/\1 data-preamble="'"$PREAMBLE"'"/' $DOCDIR/*.html
|
||||
|
||||
echo "Copying images"
|
||||
cp doc/*.png $DOCDIR/
|
||||
|
||||
echo "Generating clojurescript cache"
|
||||
mkdir $DOCDIR/cache-cljs
|
||||
$LUMO -k $DOCDIR/cache-cljs -c $(lein classpath) -e "$($LUMO dev-resources/klipse-require.cljs)"
|
||||
|
||||
echo "Updating version list landing page"
|
||||
VERSIONS=$(git tag --list --format='%(refname:short) %(creatordate:short)' --sort=-creatordate)
|
||||
VERLIST=$(sed -E 's|([^ ]+) ([^ ]+)|<tr><td><a href="\1">\1</a></td><td>\2</td></tr>|' <<< "$VERSIONS" | awk -v RS="" '{gsub (/\n/,"\\n")}1')
|
||||
awk -v verlist="$VERLIST" '/%%VERSION_LIST_START%%/{p=1;print;print verlist}/%%VERSION_LIST_END%%/{p=0}!p' $DOCROOT/index.html > $DOCROOT/index_new.html
|
||||
mv $DOCROOT/index_new.html $DOCROOT/index.html
|
|
@ -1,24 +0,0 @@
|
|||
(require '[lumo.io :refer [slurp]]
|
||||
'[cljs.tools.reader :refer [read-string]])
|
||||
|
||||
#_(require '[planck.core :refer [eval slurp]]
|
||||
'[cljs.tools.reader :refer [read-string]])
|
||||
|
||||
(defn quote-ns
|
||||
[[n & _]]
|
||||
`(quote ~(symbol n)))
|
||||
|
||||
(doseq [form (->> "project.clj"
|
||||
slurp
|
||||
read-string
|
||||
(drop 3)
|
||||
(apply hash-map)
|
||||
:codox
|
||||
:themes
|
||||
second
|
||||
second
|
||||
:klipse/require-statement
|
||||
read-string
|
||||
(drop 2))]
|
||||
(println (cons (-> form first name symbol)
|
||||
(map quote-ns (rest form)))))
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Unofficial Bash Strict Mode:
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
die() {
|
||||
echo $1 >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
DOCROOT=$1
|
||||
[[ -z $DOCROOT ]] && die "usage: $0 docroot"
|
||||
|
||||
echo "Cleaning up any old docs"
|
||||
rm -rf $DOCROOT
|
||||
|
||||
echo "Cloning gh-pages branch into docs dir"
|
||||
git clone --branch gh-pages https://github.com/Microsoft/same-ish.git $DOCROOT
|
47
project.clj
47
project.clj
|
@ -17,7 +17,6 @@
|
|||
{:dev
|
||||
{:dependencies [[org.clojure/clojure "1.11.1"]
|
||||
[org.clojure/clojurescript "1.11.60"]
|
||||
[viebel/codox-klipse-theme "0.0.5"]
|
||||
[org.clojure/core.rrb-vector "0.1.2"]]}
|
||||
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
|
||||
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
|
||||
|
@ -55,12 +54,6 @@
|
|||
;; Code coverage
|
||||
[lein-cloverage "1.1.2"]
|
||||
|
||||
;; Documentation
|
||||
[lein-codox "0.10.8"]
|
||||
|
||||
;; Run shell commands for doc generation
|
||||
[lein-shell "0.5.0"]
|
||||
|
||||
;; Code/style checks
|
||||
[jonase/eastwood "1.2.4"]
|
||||
[lein-cljfmt "0.8.2"]]
|
||||
|
@ -69,22 +62,12 @@
|
|||
|
||||
:aliases {"checks" ["do" "check" ["cljfmt" "check"] "clj-kondo" "eastwood"]
|
||||
"clj-kondo" ["with-profile" "+clj-kondo" "run" "-m" "clj-kondo.main" "--lint" "src" "test"]
|
||||
"tests" ["do" "with-profile" "+1.11:+1.10:+1.9:+1.8:+1.7" "test," "test" ":slow"]
|
||||
"docs" ["do"
|
||||
["shell" "dev-resources/prepare-docs.sh" "target/docs"]
|
||||
"codox"
|
||||
["shell" "dev-resources/finalise-docs.sh" "target/docs/${:version}"]]
|
||||
"deploy-docs" ["do"
|
||||
["shell" "git" "-C" "target/docs" "add" "."]
|
||||
["shell" "git" "-C" "target/docs" "commit" "-m" "Documentation for ${:version}"]
|
||||
["shell" "git" "-C" "target/docs" "push"]]}
|
||||
"tests" ["do" "with-profile" "+1.11:+1.10:+1.9:+1.8:+1.7" "test," "test" ":slow"]}
|
||||
|
||||
:release-tasks [["vcs" "assert-committed"]
|
||||
["change" "version" "leiningen.release/bump-version" "release"]
|
||||
["vcs" "commit"]
|
||||
["vcs" "tag"]
|
||||
["docs"]
|
||||
["deploy-docs"]
|
||||
["deploy"]
|
||||
["change" "version" "leiningen.release/bump-version"]
|
||||
["vcs" "commit"]
|
||||
|
@ -107,31 +90,3 @@
|
|||
:eastwood {:linters [:all]
|
||||
:exclude-linters [:keyword-typos
|
||||
:non-clojure-file]}
|
||||
|
||||
:codox {:project {:name "same/ish"}
|
||||
:metadata {:doc/format :markdown
|
||||
:doc "**FIXME:** write docs"}
|
||||
:source-uri "https://github.com/Microsoft/same-ish/blob/{version}/{filepath}#L{line}"
|
||||
:output-path "target/docs/{VERSION}"
|
||||
:html {:namespace-list :flat}
|
||||
:themes
|
||||
[:default
|
||||
[:klipse
|
||||
{:klipse/external-libs
|
||||
"https://raw.githubusercontent.com/Microsoft/same-ish/{VERSION}/src"
|
||||
:klipse/cached-macro-ns-regexp #"/same|same\..*/"
|
||||
:klipse/cached-ns-regexp #"/same|same\..*/"
|
||||
:klipse/bundled-ns-ignore-regexp #"/same|same\..*/"
|
||||
:klipse/cached-ns-root "./cache-cljs"
|
||||
:klipse/require-statement
|
||||
"(ns same.klipse
|
||||
(:require-macros [same :refer [with-comparator]])
|
||||
(:require [same :refer [ish? zeroish? not-zeroish? set-comparator!]]
|
||||
[same.compare :refer [compare-ulp]]
|
||||
[same.ish :refer [default-comparator]]))"}]]})
|
||||
|
||||
(def project (-> project
|
||||
(update-in [:codox :output-path]
|
||||
clojure.string/replace "{VERSION}" (project :version))
|
||||
(update-in [:codox :themes 1 1 :klipse/external-libs]
|
||||
clojure.string/replace "{VERSION}" (project :version))))
|
||||
|
|
Загрузка…
Ссылка в новой задаче