提交 d61d7b59 编写于 作者: P Paul Stansifer

Add a badge to the tutorial and reference docs indicating which Rust version they pertain to.

上级 f4ef0dc3
......@@ -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
......
......@@ -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;
......
<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>
......@@ -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)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册