Add a badge to the tutorial and reference docs indicating which Rust version they pertain to.
This commit is contained in:
parent
f4ef0dc3d3
commit
d61d7b5979
4 changed files with 40 additions and 2 deletions
|
@ -136,6 +136,8 @@ ifneq ($(wildcard $(CFG_GIT)),)
|
|||
ifneq ($(wildcard $(CFG_GIT_DIR)),)
|
||||
CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
|
||||
--pretty=format:'(%h %ci)')
|
||||
CFG_VER_HASH = $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
|
||||
--pretty=format:'%H')
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
18
doc/rust.css
18
doc/rust.css
|
@ -2,6 +2,8 @@ body {
|
|||
padding: 1em;
|
||||
margin: 0;
|
||||
font-family: "Helvetica Neue", Helvetica, sans-serif;
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
body {
|
||||
|
@ -58,6 +60,22 @@ h1.title {
|
|||
background-position: right;
|
||||
}
|
||||
|
||||
#versioninfo {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
|
||||
background-color: white;
|
||||
border-left: solid 1px black;
|
||||
border-top: solid 1px black;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
a.lessimportant {
|
||||
color: gray;
|
||||
font-size: 60%;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
color: black;
|
||||
border-left: solid 1px silver;
|
||||
|
|
10
doc/version_info_template.html
Normal file
10
doc/version_info_template.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<div id='versioninfo'>
|
||||
<center>
|
||||
<img src="http://www.rust-lang.org/logos/rust-logo-32x32-blk.png"> <br>
|
||||
<a href="http://rust-lang.org">Rust</a> VERSION <br>
|
||||
<a href="http://github.com/mozilla/rust/commit/STAMP"
|
||||
class='lessimportant'>SHORT_HASH</a>
|
||||
</center>
|
||||
|
||||
</div>
|
||||
|
12
mk/docs.mk
12
mk/docs.mk
|
@ -21,7 +21,7 @@ doc/rust.css: rust.css
|
|||
$(Q)cp -a $< $@ 2> /dev/null
|
||||
|
||||
DOCS += doc/rust.html
|
||||
doc/rust.html: rust.md doc/version.md doc/rust.css
|
||||
doc/rust.html: rust.md doc/version_info.html doc/rust.css
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
"$(CFG_PANDOC)" \
|
||||
|
@ -30,6 +30,7 @@ doc/rust.html: rust.md doc/version.md doc/rust.css
|
|||
--number-sections \
|
||||
--from=markdown --to=html \
|
||||
--css=rust.css \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
endif
|
||||
|
||||
|
@ -72,12 +73,13 @@ doc/rust.pdf: doc/rust.tex
|
|||
else
|
||||
|
||||
DOCS += doc/tutorial.html
|
||||
doc/tutorial.html: tutorial.md doc/rust.css
|
||||
doc/tutorial.html: tutorial.md doc/version_info.html doc/rust.css
|
||||
@$(call E, pandoc: $@)
|
||||
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
|
||||
$(CFG_PANDOC) --standalone --toc \
|
||||
--section-divs --number-sections \
|
||||
--from=markdown --to=html --css=rust.css \
|
||||
--include-before-body=doc/version_info.html \
|
||||
--output=$@
|
||||
|
||||
endif
|
||||
|
@ -145,6 +147,12 @@ doc/version.md: $(MKFILE_DEPS) rust.md
|
|||
@$(call E, version-stamp: $@)
|
||||
$(Q)echo "$(CFG_VERSION)" >$@
|
||||
|
||||
doc/version_info.html: version_info_template.html
|
||||
@$(call E, version-info: $@)
|
||||
sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
|
||||
$(CFG_VER_HASH) | head --bytes=8)/;\
|
||||
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
|
||||
|
||||
GENERATED += doc/version.md
|
||||
|
||||
docs: $(DOCS)
|
||||
|
|
Loading…
Reference in a new issue