diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..396291f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +sudo: false +dist: trusty +language: rust +cache: cargo +rust: + - nightly +branches: + only: + - master +before_script: + - (cargo install mdbook --vers 0.0.26 --force || true) +script: + - mdbook build +deploy: + provider: pages + local-dir: mdbook + skip-cleanup: true + github-token: $GITHUB_TOKEN + keep-history: false + on: + branch: master \ No newline at end of file diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 79c7607..2803635 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -9,7 +9,7 @@ - [猜猜看教程](ch02-00-guessing-game-tutorial.md) - [通用编程概念](ch03-00-common-programming-concepts.md) - - [变量和可变性](ch03-01-variables-and-mutability.md) + - [变量与可变性](ch03-01-variables-and-mutability.md) - [数据类型](ch03-02-data-types.md) - [函数如何工作](ch03-03-how-functions-work.md) - [注释](ch03-04-comments.md) @@ -17,25 +17,25 @@ - [认识所有权](ch04-00-understanding-ownership.md) - [什么是所有权](ch04-01-what-is-ownership.md) - - [引用 & 借用](ch04-02-references-and-borrowing.md) + - [引用与借用](ch04-02-references-and-borrowing.md) - [Slices](ch04-03-slices.md) -- [使用结构体组织相关联的数据](ch05-00-structs.md) +- [使用结构体来组织相关联的数据](ch05-00-structs.md) - [定义并实例化结构体](ch05-01-defining-structs.md) - [一个使用结构体的示例程序](ch05-02-example-structs.md) - [方法语法](ch05-03-method-syntax.md) -- [枚举和模式匹配](ch06-00-enums.md) +- [枚举与模式匹配](ch06-00-enums.md) - [定义枚举](ch06-01-defining-an-enum.md) - [`match` 控制流运算符](ch06-02-match.md) - - [`if let` 简单控制流](ch06-03-if-let.md) + - [`if let` 简洁控制流](ch06-03-if-let.md) ## 基本 Rust 技能 - [模块](ch07-00-modules.md) - - [`mod`和文件系统](ch07-01-mod-and-the-filesystem.md) - - [使用`pub`控制可见性](ch07-02-controlling-visibility-with-pub.md) - - [使用`use`导入命名](ch07-03-importing-names-with-use.md) + - [`mod` 与文件系统](ch07-01-mod-and-the-filesystem.md) + - [使用 `pub` 控制可见性](ch07-02-controlling-visibility-with-pub.md) + - [在不同的模块中引用命名](ch07-03-importing-names-with-use.md) - [通用集合类型](ch08-00-common-collections.md) - [vector](ch08-01-vectors.md) @@ -43,11 +43,11 @@ - [哈希 map](ch08-03-hash-maps.md) - [错误处理](ch09-00-error-handling.md) - - [`panic!`与不可恢复的错误](ch09-01-unrecoverable-errors-with-panic.md) - - [`Result`与可恢复的错误](ch09-02-recoverable-errors-with-result.md) - - [`panic!`还是不`panic!`](ch09-03-to-panic-or-not-to-panic.md) + - [`panic!` 与不可恢复的错误](ch09-01-unrecoverable-errors-with-panic.md) + - [`Result` 与可恢复的错误](ch09-02-recoverable-errors-with-result.md) + - [`panic!` 还是不 `panic!`](ch09-03-to-panic-or-not-to-panic.md) -- [泛型、trait 和生命周期](ch10-00-generics.md) +- [泛型、trait 与生命周期](ch10-00-generics.md) - [泛型数据类型](ch10-01-syntax.md) - [trait:定义共享的行为](ch10-02-traits.md) - [生命周期与引用有效性](ch10-03-lifetime-syntax.md) @@ -57,35 +57,35 @@ - [运行测试](ch11-02-running-tests.md) - [测试的组织结构](ch11-03-test-organization.md) -- [一个 I/O 项目](ch12-00-an-io-project.md) +- [一个 I/O 项目:构建命令行程序](ch12-00-an-io-project.md) - [接受命令行参数](ch12-01-accepting-command-line-arguments.md) - [读取文件](ch12-02-reading-a-file.md) - - [增强错误处理和模块化](ch12-03-improving-error-handling-and-modularity.md) - - [测试库的功能](ch12-04-testing-the-librarys-functionality.md) + - [重构以改进模块化与错误处理](ch12-03-improving-error-handling-and-modularity.md) + - [采用测试驱动开发完善库的功能](ch12-04-testing-the-librarys-functionality.md) - [处理环境变量](ch12-05-working-with-environment-variables.md) - - [输出到`stderr`而不是`stdout`](ch12-06-writing-to-stderr-instead-of-stdout.md) + - [将错误信息输出到标准错误而不是标准输出](ch12-06-writing-to-stderr-instead-of-stdout.md) ## Rust 编程思想 -- [Rust 中的函数式语言功能](ch13-00-functional-features.md) - - [闭包](ch13-01-closures.md) - - [迭代器](ch13-02-iterators.md) - - [改进 I/O 项目](ch13-03-improving-our-io-project.md) - - [性能](ch13-04-performance.md) +- [Rust 中的函数式语言功能:迭代器与闭包](ch13-00-functional-features.md) + - [闭包:可以捕获其环境的匿名函数](ch13-01-closures.md) + - [使用迭代器处理元素序列](ch13-02-iterators.md) + - [改进之前的 I/O 项目](ch13-03-improving-our-io-project.md) + - [性能比较:循环对迭代器](ch13-04-performance.md) -- [更多关于 Cargo 和 Crates.io](ch14-00-more-about-cargo.md) - - [发布配置](ch14-01-release-profiles.md) +- [更多关于 Cargo 和 Crates.io 的内容](ch14-00-more-about-cargo.md) + - [采用发布配置自定义构建](ch14-01-release-profiles.md) - [将 crate 发布到 Crates.io](ch14-02-publishing-to-crates-io.md) - [Cargo 工作空间](ch14-03-cargo-workspaces.md) - - [使用`cargo install`从 Crates.io 安装文件](ch14-04-installing-binaries.md) + - [使用 `cargo install` 从 Crates.io 安装二进制文件](ch14-04-installing-binaries.md) - [Cargo 自定义扩展命令](ch14-05-extending-cargo.md) - [智能指针](ch15-00-smart-pointers.md) - - [`Box`Box在堆上存储数据,并且可确定大小](ch15-01-box.md) + - [`Box` 在堆上存储数据,并且可确定大小](ch15-01-box.md) - [`Deref` Trait 允许通过引用访问数据](ch15-02-deref.md) - [`Drop` Trait 运行清理代码](ch15-03-drop.md) - [`Rc` 引用计数智能指针](ch15-04-rc.md) - - [`RefCell`和内部可变性模式](ch15-05-interior-mutability.md) + - [`RefCell` 和内部可变性模式](ch15-05-interior-mutability.md) - [引用循环和内存泄漏是安全的](ch15-06-reference-cycles.md) - [无畏并发](ch16-00-concurrency.md) @@ -94,7 +94,7 @@ - [共享状态](ch16-03-shared-state.md) - [可扩展的并发:`Sync`和`Send`](ch16-04-extensible-concurrency-sync-and-send.md) -- [面向对象](ch17-00-oop.md) +- [Rust 是面向对象语言吗?](ch17-00-oop.md) - [什么是面向对象?](ch17-01-what-is-oo.md) - [为使用不同类型的值而设计的 trait 对象](ch17-02-trait-objects.md) - [面向对象设计模式的实现](ch17-03-oo-design-patterns.md) @@ -103,7 +103,7 @@ - [模式用来匹配值的结构](ch18-00-patterns.md) - [所有可能会用到模式的位置](ch18-01-all-the-places-for-patterns.md) - - [refutable:何时模式可能会匹配失败](ch18-02-refutability.md) + - [Refutability:何时模式可能会匹配失败](ch18-02-refutability.md) - [模式的全部语法](ch18-03-pattern-syntax.md) - [高级特征](ch19-00-advanced-features.md) @@ -123,9 +123,8 @@ - [附录](appendix-00.md) - [A - 关键字](appendix-01-keywords.md) - - [B - 运算符](appendix-02-operators.md) - - [C - 可导出的 trait]() - - [D - Rust 开发版]() - - [E - 宏]() - - [F - 本书翻译]() - - [G - 最新功能](appendix-07-newest-features.md) + - [B - 运算符与符号](appendix-02-operators.md) + - [C - 可导出的 trait](appendix-03-derivable-traits.md) + - [D - 宏](appendix-04-macros.md) + - [E - 本书翻译](appendix-05-translation.md) + - [F - 最新功能](appendix-06-newest-features.md) diff --git a/src/appendix-03-derivable-traits.md b/src/appendix-03-derivable-traits.md new file mode 100644 index 0000000..39ecf9f --- /dev/null +++ b/src/appendix-03-derivable-traits.md @@ -0,0 +1 @@ +# C - 可导出的 trait diff --git a/src/appendix-04-macros.md b/src/appendix-04-macros.md new file mode 100644 index 0000000..8129451 --- /dev/null +++ b/src/appendix-04-macros.md @@ -0,0 +1 @@ +# D - 宏 diff --git a/src/appendix-05-translation.md b/src/appendix-05-translation.md new file mode 100644 index 0000000..f59f546 --- /dev/null +++ b/src/appendix-05-translation.md @@ -0,0 +1 @@ +# E - 本书翻译 diff --git a/src/appendix-06-newest-features.md b/src/appendix-06-newest-features.md new file mode 100644 index 0000000..25f6b45 --- /dev/null +++ b/src/appendix-06-newest-features.md @@ -0,0 +1 @@ +# F - 最新功能 diff --git a/theme/index.hbs b/theme/index.hbs index 2127fbe..3572417 100644 --- a/theme/index.hbs +++ b/theme/index.hbs @@ -121,18 +121,19 @@ {{#each additional_js}} {{/each}} + @@ -143,35 +144,37 @@
-
+
{{!--

You are reading a draft of the next edition of TRPL. For more, go here.

--}} +
-
{{{ content }}}
{{#previous}} - {{/previous}} {{#next}} - {{/next}} @@ -203,6 +206,18 @@ {{{livereload}}} + {{#if google_analytics}} + + {{/if}} + {{#if playpens_editable}} @@ -211,6 +226,14 @@ {{/if}} + {{#if is_print}} + + {{/if}} +