Skip to content

Move to rustdoc instead of ruby's middleman #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 11, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ script:
- make
- make test
- make distcheck
- make doc
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
[ $BITS = 64 ] &&
[ $(uname -s) = Linux ] &&
(cd src/doc &&
bundle &&
bundle exec middleman build) &&
sudo pip install ghp-import &&
ghp-import -n src/doc/build &&
ghp-import -n target/doc &&
git push -f https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
env:
matrix:
Expand Down
25 changes: 25 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,31 @@ clean-all: clean
clean:
rm -rf $(TARGET_ROOT)

# === Documentation

DOCS := index faq config guide manifest native-build
DOC_DIR := target/doc
DOC_OPTS := --markdown-no-toc \
--markdown-css stylesheets/normalize.css \
--markdown-css stylesheets/all.css \
--markdown-css stylesheets/prism.css \
--html-before-content src/doc/header.html \
--html-after-content src/doc/footer.html
ASSETS := CNAME images/noise.png images/forkme.png images/Cargo-Logo-Small.png \
stylesheets/all.css stylesheets/normalize.css javascripts/prism.js \
javascripts/all.js stylesheets/prism.css

doc: $(foreach doc,$(DOCS),target/doc/$(doc).html) \
$(foreach asset,$(ASSETS),target/doc/$(asset))

$(DOC_DIR)/%.html: src/doc/%.md src/doc/header.html src/doc/footer.html
@mkdir -p $(@D)
"$(CFG_RUSTDOC)" $< -o $(@D) $(DOC_OPTS)

$(DOC_DIR)/%: src/doc/%
@mkdir -p $(@D)
cp $< $@

# === Distribution

define DO_DIST_TARGET
Expand Down
7 changes: 7 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ step_msg "looking for build programs"
probe_need CFG_CURLORWGET curl wget
probe_need CFG_PYTHON python

if [ ! -z "${CFG_LOCAL_RUST_ROOT}" ]; then
CFG_RUSTDOC="${CFG_LOCAL_RUST_ROOT}/bin/rustdoc"
else
probe_need CFG_RUSTDOC rustdoc
fi

# a little post-processing of various config values
CFG_PREFIX=${CFG_PREFIX%/}
CFG_MANDIR=${CFG_MANDIR%/}
Expand Down Expand Up @@ -372,6 +378,7 @@ putvar CFG_TARGET
putvar CFG_LIBDIR
putvar CFG_MANDIR
putvar CFG_RUSTC
putvar CFG_RUSTDOC

msg
copy_if_changed ${CFG_SRC_DIR}Makefile.in ./Makefile
Expand Down
File renamed without changes.
18 changes: 0 additions & 18 deletions src/doc/Gemfile

This file was deleted.

134 changes: 0 additions & 134 deletions src/doc/Gemfile.lock

This file was deleted.

4 changes: 1 addition & 3 deletions src/doc/source/config.md → src/doc/config.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
title: Configuration
---
% Configuration

This document will explain how cargo's configuration system works, as well as
available keys or configuration. For configuration of a project through its
Expand Down
83 changes: 0 additions & 83 deletions src/doc/config.rb

This file was deleted.

18 changes: 8 additions & 10 deletions src/doc/source/faq.md → src/doc/faq.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: Frequently Asked Questions
---
% Frequently Asked Questions

# Is the plan to use Github as a package repository? <a href="#github" id="github" class="headerlink">¶</a>
# Is the plan to use Github as a package repository?

No. The plan for Cargo is to have a central registry of packages, like
npm or Rubygems.
Expand All @@ -18,7 +16,7 @@ track the latest Rust. This makes downloading the latest `master` from
Github the best approach to getting packages at the current point in the
community's lifecycle.

# Why build a package registry rather than use Github as a registry? <a href="#why-not-github" id="why-not-github" class="headerlink">¶</a>
# Why build a package registry rather than use Github as a registry?

We think that it's very important to support multiple ways to download
packages, including downloading from Github and copying packages into
Expand Down Expand Up @@ -52,7 +50,7 @@ languages include:
down fast. Also remember that not everybody has a high-speed,
low-latency Internet connection.

# Will Cargo work with C code (or other languages)? <a href="#c" id="c" class="headerlink">¶</a>
# Will Cargo work with C code (or other languages)?

Yes!

Expand All @@ -65,7 +63,7 @@ before invoking `rustc`. We plan to add support for platform-specific
configuration, so you can use `make` on Linux and `cmake` on BSD, for
example.

# Can Cargo be used inside of `make` (or `ninja`, or ...) <a href="#make" id="make" class="headerlink">¶</a>
# Can Cargo be used inside of `make` (or `ninja`, or ...)

Indeed. While we intend Cargo to be useful as a standalone way to
compile Rust projects at the top-level, we know that some people will
Expand All @@ -77,7 +75,7 @@ have some work to do on those fronts, but using Cargo in the context of
conventional scripts is something we designed for from the beginning and
will continue to prioritize.

# Does Cargo handle multi-platform projects or cross-compilation? <a href="#multi-platform" id="multi-platform" class="headerlink">¶</a>
# Does Cargo handle multi-platform projects or cross-compilation?

Rust itself provides facilities for configuring sections of code based
on the platform. We plan to support per-platform configuration in
Expand All @@ -87,7 +85,7 @@ future.
In the longer-term, we're looking at ways to conveniently cross-compile
projects using Cargo.

# Does Cargo support environments, like `production` or `test`? <a href="#environments" id="environments" class="headerlink">¶</a>
# Does Cargo support environments, like `production` or `test`?

We are planning on support environments in the near future, that can
support:
Expand All @@ -103,7 +101,7 @@ specify flags or dependencies for a combination of multiple environments
and platforms ("use `fsevents`, but only in OSX in `development` or
`test`").

# Does Cargo work on Windows? <a href="#windows" id="windows" class="headerlink">¶</a>
# Does Cargo work on Windows?

Yes!

Expand Down
11 changes: 11 additions & 0 deletions src/doc/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<footer>
<a href='guide.html'>Guide</a> |
<a href='faq.html'>Frequently Asked Questions</a> |
<a href='manifest.html'>Manifest Format</a> |
<a href='native-build.html'>Building Non-Rust Code</a> |
<a href='config.html'>Configuration</a>
</footer>
</main>

<script type='text/javascript' src='javascripts/prism.js'></script>
<script type='text/javascript' src='javascripts/all.js'></script>
Loading