File tree Expand file tree Collapse file tree 1 file changed +29
-8
lines changed Expand file tree Collapse file tree 1 file changed +29
-8
lines changed Original file line number Diff line number Diff line change
1
+ DOCCRATES = itertools
1
2
2
- docs : VERSION
3
- cargo doc --no-deps
3
+ # deps to delete the generated docs
4
+ RMDOCS =
5
+
6
+ FEATURES =
7
+
8
+ VERSIONS = $(patsubst % ,target/VERS/% ,$(DOCCRATES ) )
9
+
10
+ docs : mkdocs subst $(RMDOCS )
11
+
12
+ # https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html
13
+ $(VERSIONS ) : Cargo.toml
14
+ mkdir -p $(@D )
15
+ cargo pkgid $(@F ) | sed -e " s/.*#\(\|.*:\)//" > " $@ "
16
+
17
+ $(DOCCRATES ) : % : target/VERS/%
18
+ # Put in the crate version into the docs
19
+ find ./doc/$@ -name " *.html" -exec sed -i -e " s/<title>\(.*\) - Rust/<title>$@ $( shell cat $< ) - \1 - Rust/g" {} \;
20
+
21
+ subst : $(DOCCRATES )
22
+
23
+ mkdocs : Cargo.toml
24
+ cargo doc --features=$(FEATURES )
4
25
rm -rf ./doc
5
26
cp -r ./target/doc ./doc
6
- # Put in the crate version into the docs
7
- find ./doc -name " *.html" -exec sed -i -e " s/<title>\(.*\) - Rust/<title>itertools $( shell cat VERSION) - \1 - Rust/g" {} \;
8
- -cat ./custom.css >> doc/main.css
27
+ - cat ./custom.css >> doc/main.css
28
+
29
+ $(RMDOCS ) : mkdocs
30
+ rm -r ./doc/$@
31
+ sed -i " /searchIndex\['$@ '\]/d" doc/search-index.js
9
32
10
- VERSION : Cargo.toml
11
- cargo pkgid | sed -e " s/.*#//" > VERSION
12
33
13
- .PHONY : docs
34
+ .PHONY : docs mkdocs subst $( DOCCRATES ) $( RMDOCS )
You can’t perform that action at this time.
0 commit comments