Skip to content

Commit b6a1fde

Browse files
committed
auto merge of #11106 : alan-andrade/rust/convert_tutorials_to_guides, r=cmr
* Moved every the tutorial-*.md into its own directory `/doc/guides/` * Makefile is aware
2 parents a6d3e57 + eeafee4 commit b6a1fde

12 files changed

+55
-51
lines changed

configure

+6-6
Original file line numberDiff line numberDiff line change
@@ -792,12 +792,12 @@ do
792792
make_dir $h/test/debug-info
793793
make_dir $h/test/codegen
794794
make_dir $h/test/doc-tutorial
795-
make_dir $h/test/doc-tutorial-ffi
796-
make_dir $h/test/doc-tutorial-macros
797-
make_dir $h/test/doc-tutorial-borrowed-ptr
798-
make_dir $h/test/doc-tutorial-container
799-
make_dir $h/test/doc-tutorial-tasks
800-
make_dir $h/test/doc-tutorial-conditions
795+
make_dir $h/test/doc-guide-ffi
796+
make_dir $h/test/doc-guide-macros
797+
make_dir $h/test/doc-guide-borrowed-ptr
798+
make_dir $h/test/doc-guide-container
799+
make_dir $h/test/doc-guide-tasks
800+
make_dir $h/test/doc-guide-conditions
801801
make_dir $h/test/doc-rust
802802
done
803803

doc/tutorial-borrowed-ptr.md renamed to doc/guide-borrowed-ptr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Rust Borrowed Pointers Tutorial
1+
% Rust Borrowed Pointers Guide
22

33
# Introduction
44

doc/tutorial-conditions.md renamed to doc/guide-conditions.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Rust Condition and Error-handling Tutorial
1+
% Rust Condition and Error-handling Guide
22

33
# Introduction
44

@@ -12,12 +12,12 @@ The four mechanisms are:
1212
- Failure
1313
- Conditions
1414

15-
This tutorial will lead you through use of these mechanisms
15+
This guide will lead you through use of these mechanisms
1616
in order to understand the trade-offs of each and relationships between them.
1717

1818
# Example program
1919

20-
This tutorial will be based around an example program
20+
This guide will be based around an example program
2121
that attempts to read lines from a file
2222
consisting of pairs of numbers,
2323
and then print them back out with slightly different formatting.
@@ -823,7 +823,7 @@ There are three other things to note in this variant of the example program:
823823

824824
# When to use which technique
825825

826-
This tutorial explored several techniques for handling errors.
826+
This guide explored several techniques for handling errors.
827827
Each is appropriate to different circumstances:
828828

829829
- If an error may be extremely frequent, expected, and very likely dealt with by an immediate caller,

doc/tutorial-container.md renamed to doc/guide-container.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Containers and iterators
1+
% Containers and Iterators Guide
22

33
# Containers
44

doc/tutorial-ffi.md renamed to doc/guide-ffi.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
% Rust Foreign Function Interface Tutorial
1+
% Rust Foreign Function Interface Guide
22

33
# Introduction
44

5-
This tutorial will use the [snappy](https://code.google.com/p/snappy/)
5+
This guide will use the [snappy](https://code.google.com/p/snappy/)
66
compression/decompression library as an introduction to writing bindings for
77
foreign code. Rust is currently unable to call directly into a C++ library, but
88
snappy includes a C interface (documented in

doc/tutorial-macros.md renamed to doc/guide-macros.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Rust Macros Tutorial
1+
% Rust Macros Guide
22

33
# Introduction
44

doc/tutorial-rustpkg.md renamed to doc/guide-rustpkg.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
% Rust Packaging Tutorial
1+
% Rust Packaging Guide
22

33
# Introduction
44

55
Sharing is caring. Rust comes with a tool, `rustpkg`, which allows you to
6-
package up your Rust code and share it with other people. This tutorial will
6+
package up your Rust code and share it with other people. This guide will
77
get you started on all of the concepts and commands you need to give the gift
88
of Rust code to someone else.
99

@@ -92,7 +92,7 @@ There are also default file names you'll want to follow as well:
9292
Now that you've got workspaces down, let's build your own copy of `hello`. Go
9393
to wherever you keep your personal projects, and let's make all of the
9494
directories we'll need. I'll refer to this personal project directory as
95-
`~/src` for the rest of this tutorial.
95+
`~/src` for the rest of this guide.
9696

9797
## Creating our workspace
9898

doc/tutorial-tasks.md renamed to doc/guide-tasks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
% Rust Tasks and Communication Tutorial
1+
% Rust Tasks and Communication Guide
22

33
# Introduction
44

55
Rust provides safe concurrency through a combination
66
of lightweight, memory-isolated tasks and message passing.
7-
This tutorial will describe the concurrency model in Rust, how it
7+
This guide will describe the concurrency model in Rust, how it
88
relates to the Rust type system, and introduce
99
the fundamental library abstractions for constructing concurrent programs.
1010

doc/tutorial-testing.md renamed to doc/guide-testing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Rust Testing Tutorial
1+
% Rust Testing Guide
22

33
# Quick start
44

doc/tutorial.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -3106,8 +3106,6 @@ but for this tutorial it's only important to know that you can optionally annota
31063106
extern mod rust = "github.com/mozilla/rust"; // pretend Rust is a simple library
31073107
~~~
31083108

3109-
[rustpkg]: rustpkg.html
3110-
31113109
## Crate metadata and settings
31123110

31133111
For every crate you can define a number of metadata items, such as link name, version or author.
@@ -3265,7 +3263,7 @@ re-export a bunch of 'officially blessed' crates that get managed with `rustpkg`
32653263
# What next?
32663264

32673265
Now that you know the essentials, check out any of the additional
3268-
tutorials on individual topics.
3266+
guides on individual topics.
32693267

32703268
* [Borrowed pointers][borrow]
32713269
* [Tasks and communication][tasks]
@@ -3280,14 +3278,14 @@ tutorials on individual topics.
32803278
There is further documentation on the [wiki], however those tend to be even
32813279
more out of date than this document.
32823280

3283-
[borrow]: tutorial-borrowed-ptr.html
3284-
[tasks]: tutorial-tasks.html
3285-
[macros]: tutorial-macros.html
3286-
[ffi]: tutorial-ffi.html
3287-
[container]: tutorial-container.html
3288-
[conditions]: tutorial-conditions.html
3289-
[rustpkg]: tutorial-rustpkg.html
3290-
[testing]: tutorial-testing.html
3281+
[borrow]: guide-borrowed-ptr.html
3282+
[tasks]: guide-tasks.html
3283+
[macros]: guide-macros.html
3284+
[ffi]: guide-ffi.html
3285+
[container]: guide-container.html
3286+
[conditions]: guide-conditions.html
3287+
[rustpkg]: guide-rustpkg.html
3288+
[testing]: guide-testing.html
32913289
[rustdoc]: rustdoc.html
32923290

32933291
[wiki]: https://github.com/mozilla/rust/wiki/Docs

mk/docs.mk

+23-17
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ CDOCS :=
1717
DOCS_L10N :=
1818

1919
BASE_DOC_OPTS := --from=markdown --standalone --toc --number-sections
20-
HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css --include-before-body=doc/version_info.html --include-in-header=doc/favicon.inc
20+
21+
HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css \
22+
--include-before-body=doc/version_info.html \
23+
--include-in-header=doc/favicon.inc
24+
2125
TEX_OPTS = $(BASE_DOC_OPTS) --to=latex
2226
EPUB_OPTS = $(BASE_DOC_OPTS) --to=epub
2327

@@ -112,57 +116,59 @@ doc/l10n/ja/tutorial.html: doc/l10n/ja/tutorial.md doc/version_info.html doc/rus
112116
--include-before-body=doc/version_info.html \
113117
--output=$@
114118

115-
DOCS += doc/tutorial-macros.html
116-
doc/tutorial-macros.html: tutorial-macros.md doc/version_info.html doc/rust.css \
119+
# Guides
120+
121+
DOCS += doc/guide-macros.html
122+
doc/guide-macros.html: $(S)doc/guide-macros.md doc/version_info.html doc/rust.css \
117123
doc/favicon.inc
118124
@$(call E, pandoc: $@)
119125
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
120126
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
121127

122-
DOCS += doc/tutorial-container.html
123-
doc/tutorial-container.html: tutorial-container.md doc/version_info.html doc/rust.css \
128+
DOCS += doc/guide-container.html
129+
doc/guide-container.html: $(S)doc/guide-container.md doc/version_info.html doc/rust.css \
124130
doc/favicon.inc
125131
@$(call E, pandoc: $@)
126132
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
127133
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
128134

129-
DOCS += doc/tutorial-ffi.html
130-
doc/tutorial-ffi.html: tutorial-ffi.md doc/version_info.html doc/rust.css \
135+
DOCS += doc/guide-ffi.html
136+
doc/guide-ffi.html: $(S)doc/guide-ffi.md doc/version_info.html doc/rust.css \
131137
doc/favicon.inc
132138
@$(call E, pandoc: $@)
133139
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
134140
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
135141

136-
DOCS += doc/tutorial-testing.html
137-
doc/tutorial-testing.html: tutorial-testing.md doc/version_info.html doc/rust.css \
142+
DOCS += doc/guide-testing.html
143+
doc/guide-testing.html: $(S)doc/guide-testing.md doc/version_info.html doc/rust.css \
138144
doc/favicon.inc
139145
@$(call E, pandoc: $@)
140146
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
141147
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
142148

143-
DOCS += doc/tutorial-borrowed-ptr.html
144-
doc/tutorial-borrowed-ptr.html: tutorial-borrowed-ptr.md doc/version_info.html doc/rust.css \
149+
DOCS += doc/guide-borrowed-ptr.html
150+
doc/guide-borrowed-ptr.html: $(S)doc/guide-borrowed-ptr.md doc/version_info.html doc/rust.css \
145151
doc/favicon.inc
146152
@$(call E, pandoc: $@)
147153
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
148154
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
149155

150-
DOCS += doc/tutorial-tasks.html
151-
doc/tutorial-tasks.html: tutorial-tasks.md doc/version_info.html doc/rust.css \
156+
DOCS += doc/guide-tasks.html
157+
doc/guide-tasks.html: $(S)doc/guide-tasks.md doc/version_info.html doc/rust.css \
152158
doc/favicon.inc
153159
@$(call E, pandoc: $@)
154160
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
155161
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
156162

157-
DOCS += doc/tutorial-conditions.html
158-
doc/tutorial-conditions.html: tutorial-conditions.md doc/version_info.html doc/rust.css \
163+
DOCS += doc/guide-conditions.html
164+
doc/guide-conditions.html: $(S)doc/guide-conditions.md doc/version_info.html doc/rust.css \
159165
doc/favicon.inc
160166
@$(call E, pandoc: $@)
161167
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
162168
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
163169

164-
DOCS += doc/tutorial-rustpkg.html
165-
doc/tutorial-rustpkg.html: tutorial-rustpkg.md doc/version_info.html doc/rust.css \
170+
DOCS += doc/guide-rustpkg.html
171+
doc/guide-rustpkg.html: $(S)doc/guide-rustpkg.md doc/version_info.html doc/rust.css \
166172
doc/favicon.inc
167173
@$(call E, pandoc: $@)
168174
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \

mk/tests.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ TEST_HOST_CRATES = rustpkg rustc rustdoc syntax
2020
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2121

2222
# Markdown files under doc/ that should have their code extracted and run
23-
DOC_TEST_NAMES = tutorial tutorial-ffi tutorial-macros tutorial-borrowed-ptr \
24-
tutorial-tasks tutorial-conditions tutorial-container rust
23+
DOC_TEST_NAMES = tutorial guide-ffi guide-macros guide-borrowed-ptr \
24+
guide-tasks guide-conditions guide-container rust
2525

2626
######################################################################
2727
# Environment configuration

0 commit comments

Comments
 (0)