rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.71k stars 1.61k forks source link

Print book version #987

Closed fabioluciano closed 5 years ago

fabioluciano commented 5 years ago

There is any way to print the version of the book?

[book]
authors = ["Fábio Luciano"]
multilingual = true
src = "src"
title = "Foo"
version = "1.0.1"

how to print version in my documentation?

ehuss commented 5 years ago

After you run mdbook build and open the book in a web browser, there is a print icon in the upper right corner you can click on to print it. Is that what you're looking for?

image
fabioluciano commented 5 years ago

Hi @ehuss, no. Isnt that. Havinf the book.toml defined before, how to print the variable version.

ehuss commented 5 years ago

Ah. mdbook doesn't really have variable substitution. You can use includes to include a file which has your version string. Or you can create a preprocessor which does whatever kind of substitutions or templating you want.