From 0007a35a274ab2d07eb937e41971ea5e2c1cb5ff Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 11 Feb 2019 21:40:53 +0100 Subject: [PATCH] change layout of books --- .gitignore | 3 +-- book/{ => en}/book.toml | 0 book/{ => en}/src/SUMMARY.md | 0 book/{ => en}/src/by-example.md | 0 book/{ => en}/src/by-example/app.md | 14 +++++++------- book/{ => en}/src/by-example/new.md | 2 +- book/{ => en}/src/by-example/resources.md | 16 ++++++++-------- book/{ => en}/src/by-example/singletons.md | 4 ++-- book/{ => en}/src/by-example/tasks.md | 12 ++++++------ book/{ => en}/src/by-example/timer-queue.md | 12 ++++++------ book/{ => en}/src/by-example/tips.md | 14 +++++++------- book/{ => en}/src/by-example/types-send-sync.md | 6 +++--- book/{ => en}/src/internals.md | 0 book/{ => en}/src/internals/ceilings.md | 0 book/{ => en}/src/internals/tasks.md | 0 book/{ => en}/src/internals/timer-queue.md | 0 book/{ => en}/src/preface.md | 6 +++--- {ru => book/ru}/book.toml | 0 {ru => book/ru}/src/README_RU.md | 0 {ru => book/ru}/src/SUMMARY.md | 0 {ru => book/ru}/src/by-example.md | 0 {ru => book/ru}/src/by-example/app.md | 14 +++++++------- {ru => book/ru}/src/by-example/new.md | 2 +- {ru => book/ru}/src/by-example/resources.md | 16 ++++++++-------- {ru => book/ru}/src/by-example/singletons.md | 4 ++-- {ru => book/ru}/src/by-example/tasks.md | 12 ++++++------ {ru => book/ru}/src/by-example/timer-queue.md | 12 ++++++------ {ru => book/ru}/src/by-example/tips.md | 12 ++++++------ .../ru}/src/by-example/types-send-sync.md | 6 +++--- {ru => book/ru}/src/internals.md | 0 {ru => book/ru}/src/internals/ceilings.md | 0 {ru => book/ru}/src/internals/tasks.md | 0 {ru => book/ru}/src/internals/timer-queue.md | 0 {ru => book/ru}/src/preface.md | 4 ++-- ci/script.sh | 14 +++++++++----- src/lib.rs | 2 +- 36 files changed, 95 insertions(+), 92 deletions(-) rename book/{ => en}/book.toml (100%) rename book/{ => en}/src/SUMMARY.md (100%) rename book/{ => en}/src/by-example.md (100%) rename book/{ => en}/src/by-example/app.md (91%) rename book/{ => en}/src/by-example/new.md (97%) rename book/{ => en}/src/by-example/resources.md (92%) rename book/{ => en}/src/by-example/singletons.md (89%) rename book/{ => en}/src/by-example/tasks.md (87%) rename book/{ => en}/src/by-example/timer-queue.md (92%) rename book/{ => en}/src/by-example/tips.md (87%) rename book/{ => en}/src/by-example/types-send-sync.md (94%) rename book/{ => en}/src/internals.md (100%) rename book/{ => en}/src/internals/ceilings.md (100%) rename book/{ => en}/src/internals/tasks.md (100%) rename book/{ => en}/src/internals/timer-queue.md (100%) rename book/{ => en}/src/preface.md (77%) rename {ru => book/ru}/book.toml (100%) rename {ru => book/ru}/src/README_RU.md (100%) rename {ru => book/ru}/src/SUMMARY.md (100%) rename {ru => book/ru}/src/by-example.md (100%) rename {ru => book/ru}/src/by-example/app.md (94%) rename {ru => book/ru}/src/by-example/new.md (98%) rename {ru => book/ru}/src/by-example/resources.md (95%) rename {ru => book/ru}/src/by-example/singletons.md (92%) rename {ru => book/ru}/src/by-example/tasks.md (92%) rename {ru => book/ru}/src/by-example/timer-queue.md (95%) rename {ru => book/ru}/src/by-example/tips.md (91%) rename {ru => book/ru}/src/by-example/types-send-sync.md (96%) rename {ru => book/ru}/src/internals.md (100%) rename {ru => book/ru}/src/internals/ceilings.md (100%) rename {ru => book/ru}/src/internals/tasks.md (100%) rename {ru => book/ru}/src/internals/timer-queue.md (100%) rename {ru => book/ru}/src/preface.md (86%) diff --git a/.gitignore b/.gitignore index 9a7ec5f13f..0c0491e538 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ **/*.rs.bk .#* .gdb_history -/book/book -/ru/book +/book/*/book /target Cargo.lock diff --git a/book/book.toml b/book/en/book.toml similarity index 100% rename from book/book.toml rename to book/en/book.toml diff --git a/book/src/SUMMARY.md b/book/en/src/SUMMARY.md similarity index 100% rename from book/src/SUMMARY.md rename to book/en/src/SUMMARY.md diff --git a/book/src/by-example.md b/book/en/src/by-example.md similarity index 100% rename from book/src/by-example.md rename to book/en/src/by-example.md diff --git a/book/src/by-example/app.md b/book/en/src/by-example/app.md similarity index 91% rename from book/src/by-example/app.md rename to book/en/src/by-example/app.md index 26aa03f617..996b8c1672 100644 --- a/book/src/by-example/app.md +++ b/book/en/src/by-example/app.md @@ -3,7 +3,7 @@ This is the smallest possible RTFM application: ``` rust -{{#include ../../../examples/smallest.rs}} +{{#include ../../../../examples/smallest.rs}} ``` All RTFM applications use the [`app`] attribute (`#[app(..)]`). This attribute @@ -47,7 +47,7 @@ The example below shows the types of the `core` and `device` variables and showcases safe access to a `static mut` variable. ``` rust -{{#include ../../../examples/init.rs}} +{{#include ../../../../examples/init.rs}} ``` Running the example will print `init` to the console and then exit the QEMU @@ -55,7 +55,7 @@ process. ``` console $ cargo run --example init -{{#include ../../../ci/expected/init.run}}``` +{{#include ../../../../ci/expected/init.run}}``` ## `idle` @@ -78,12 +78,12 @@ references that are safe to access. The example below shows that `idle` runs after `init`. ``` rust -{{#include ../../../examples/idle.rs}} +{{#include ../../../../examples/idle.rs}} ``` ``` console $ cargo run --example idle -{{#include ../../../ci/expected/idle.run}}``` +{{#include ../../../../ci/expected/idle.run}}``` ## `interrupt` / `exception` @@ -93,12 +93,12 @@ and exception handlers. In RTFM, we refer to interrupt and exception handlers as *hardware* tasks. ``` rust -{{#include ../../../examples/interrupt.rs}} +{{#include ../../../../examples/interrupt.rs}} ``` ``` console $ cargo run --example interrupt -{{#include ../../../ci/expected/interrupt.run}}``` +{{#include ../../../../ci/expected/interrupt.run}}``` So far all the RTFM applications we have seen look no different that the applications one can write using only the `cortex-m-rt` crate. In the next diff --git a/book/src/by-example/new.md b/book/en/src/by-example/new.md similarity index 97% rename from book/src/by-example/new.md rename to book/en/src/by-example/new.md index b7d18a77bc..ae49ef21af 100644 --- a/book/src/by-example/new.md +++ b/book/en/src/by-example/new.md @@ -64,4 +64,4 @@ $ cargo add panic-semihosting ``` console $ # NOTE: I have uncommented the `runner` option in `.cargo/config` $ cargo run -{{#include ../../../ci/expected/init.run}}``` +{{#include ../../../../ci/expected/init.run}}``` diff --git a/book/src/by-example/resources.md b/book/en/src/by-example/resources.md similarity index 92% rename from book/src/by-example/resources.md rename to book/en/src/by-example/resources.md index 93332f02aa..efdeaa2d9f 100644 --- a/book/src/by-example/resources.md +++ b/book/en/src/by-example/resources.md @@ -19,12 +19,12 @@ no preemption is possible. The `SHARED` resource can only be accessed by these two handlers. ``` rust -{{#include ../../../examples/resource.rs}} +{{#include ../../../../examples/resource.rs}} ``` ``` console $ cargo run --example resource -{{#include ../../../ci/expected/resource.run}}``` +{{#include ../../../../ci/expected/resource.run}}``` ## Priorities @@ -62,12 +62,12 @@ the critical section created by the lowest priority handler. [`lock`]: ../../api/rtfm/trait.Mutex.html#method.lock ``` rust -{{#include ../../../examples/lock.rs}} +{{#include ../../../../examples/lock.rs}} ``` ``` console $ cargo run --example lock -{{#include ../../../ci/expected/lock.run}}``` +{{#include ../../../../ci/expected/lock.run}}``` ## Late resources @@ -91,12 +91,12 @@ the consumer resource. [`Queue`]: ../../api/heapless/spsc/struct.Queue.html ``` rust -{{#include ../../../examples/late.rs}} +{{#include ../../../../examples/late.rs}} ``` ``` console $ cargo run --example late -{{#include ../../../ci/expected/late.run}}``` +{{#include ../../../../ci/expected/late.run}}``` ## `static` resources @@ -111,9 +111,9 @@ In the example below a key is loaded (or created) at runtime and then used from two tasks that run at different priorities. ``` rust -{{#include ../../../examples/static.rs}} +{{#include ../../../../examples/static.rs}} ``` ``` console $ cargo run --example static -{{#include ../../../ci/expected/static.run}}``` +{{#include ../../../../ci/expected/static.run}}``` diff --git a/book/src/by-example/singletons.md b/book/en/src/by-example/singletons.md similarity index 89% rename from book/src/by-example/singletons.md rename to book/en/src/by-example/singletons.md index d83cf1c203..0823f057f5 100644 --- a/book/src/by-example/singletons.md +++ b/book/en/src/by-example/singletons.md @@ -18,9 +18,9 @@ the [`alloc-singleton`] abstractions. [`alloc-singleton`]: https://crates.io/crates/alloc-singleton ``` rust -{{#include ../../../examples/singleton.rs}} +{{#include ../../../../examples/singleton.rs}} ``` ``` console $ cargo run --example singleton -{{#include ../../../ci/expected/singleton.run}}``` +{{#include ../../../../ci/expected/singleton.run}}``` diff --git a/book/src/by-example/tasks.md b/book/en/src/by-example/tasks.md similarity index 87% rename from book/src/by-example/tasks.md rename to book/en/src/by-example/tasks.md index b950f703af..edcdbed0c5 100644 --- a/book/src/by-example/tasks.md +++ b/book/en/src/by-example/tasks.md @@ -19,12 +19,12 @@ The example below showcases three software tasks that run at 2 different priorities. The three tasks map to 2 interrupts handlers. ``` rust -{{#include ../../../examples/task.rs}} +{{#include ../../../../examples/task.rs}} ``` ``` console $ cargo run --example task -{{#include ../../../ci/expected/task.run}}``` +{{#include ../../../../ci/expected/task.run}}``` ## Message passing @@ -35,12 +35,12 @@ the signature of the task handler. The example below showcases three tasks, two of them expect a message. ``` rust -{{#include ../../../examples/message.rs}} +{{#include ../../../../examples/message.rs}} ``` ``` console $ cargo run --example message -{{#include ../../../ci/expected/message.run}}``` +{{#include ../../../../ci/expected/message.run}}``` ## Capacity @@ -55,9 +55,9 @@ capacity is not specified then the second `spawn.foo` call in `UART0` would fail. ``` rust -{{#include ../../../examples/capacity.rs}} +{{#include ../../../../examples/capacity.rs}} ``` ``` console $ cargo run --example capacity -{{#include ../../../ci/expected/capacity.run}}``` +{{#include ../../../../ci/expected/capacity.run}}``` diff --git a/book/src/by-example/timer-queue.md b/book/en/src/by-example/timer-queue.md similarity index 92% rename from book/src/by-example/timer-queue.md rename to book/en/src/by-example/timer-queue.md index 2e3decddc8..167939cecf 100644 --- a/book/src/by-example/timer-queue.md +++ b/book/en/src/by-example/timer-queue.md @@ -38,13 +38,13 @@ was scheduled to run first. > counter functionality has not been implemented in `qemu-system-arm`. ``` rust -{{#include ../../../examples/schedule.rs}} +{{#include ../../../../examples/schedule.rs}} ``` Running the program on real hardware produces the following output in the console: ``` text -{{#include ../../../ci/expected/schedule.run}} +{{#include ../../../../ci/expected/schedule.run}} ``` ## Periodic tasks @@ -54,7 +54,7 @@ through the `scheduled` variable. This information and the `schedule` API can be used to implement periodic tasks as shown in the example below. ``` rust -{{#include ../../../examples/periodic.rs}} +{{#include ../../../../examples/periodic.rs}} ``` This is the output produced by the example. Note that there is zero drift / @@ -62,7 +62,7 @@ jitter even though `schedule.foo` was invoked at the *end* of `foo`. Using `Instant::now` instead of `scheduled` would have resulted in drift / jitter. ``` text -{{#include ../../../ci/expected/periodic.run}} +{{#include ../../../../ci/expected/periodic.run}} ``` ## Baseline @@ -87,11 +87,11 @@ spawned from it will use `Instant::now()` as their baseline time. The example below showcases the different meanings of the *baseline*. ``` rust -{{#include ../../../examples/baseline.rs}} +{{#include ../../../../examples/baseline.rs}} ``` Running the program on real hardware produces the following output in the console: ``` text -{{#include ../../../ci/expected/baseline.run}} +{{#include ../../../../ci/expected/baseline.run}} ``` diff --git a/book/src/by-example/tips.md b/book/en/src/by-example/tips.md similarity index 87% rename from book/src/by-example/tips.md rename to book/en/src/by-example/tips.md index 5057c80af4..8f71599a06 100644 --- a/book/src/by-example/tips.md +++ b/book/en/src/by-example/tips.md @@ -8,12 +8,12 @@ data. This lets you easily write generic code that operates on resources and can be called from different tasks. Here's one such example: ``` rust -{{#include ../../../examples/generics.rs}} +{{#include ../../../../examples/generics.rs}} ``` ``` console $ cargo run --example generics -{{#include ../../../ci/expected/generics.run}}``` +{{#include ../../../../ci/expected/generics.run}}``` This also lets you change the static priorities of tasks without having to rewrite code. If you consistently use `lock`s to access the data behind shared @@ -31,7 +31,7 @@ The example below logs a message whenever the `foo` task is spawned, but only if the program has been compiled using the `dev` profile. ``` rust -{{#include ../../../examples/cfg.rs}} +{{#include ../../../../examples/cfg.rs}} ``` ## Running tasks from RAM @@ -56,22 +56,22 @@ improve performance in some cases. The example below shows how to place the higher priority task, `bar`, in RAM. ``` rust -{{#include ../../../examples/ramfunc.rs}} +{{#include ../../../../examples/ramfunc.rs}} ``` Running this program produces the expected output. ``` console $ cargo run --example ramfunc -{{#include ../../../ci/expected/ramfunc.run}}``` +{{#include ../../../../ci/expected/ramfunc.run}}``` One can look at the output of `cargo-nm` to confirm that `bar` ended in RAM (`0x2000_0000`), whereas `foo` ended in Flash (`0x0000_0000`). ``` console $ cargo nm --example ramfunc --release | grep ' foo::' -{{#include ../../../ci/expected/ramfunc.grep.foo}}``` +{{#include ../../../../ci/expected/ramfunc.grep.foo}}``` ``` console $ cargo nm --example ramfunc --release | grep ' bar::' -{{#include ../../../ci/expected/ramfunc.grep.bar}}``` +{{#include ../../../../ci/expected/ramfunc.grep.bar}}``` diff --git a/book/src/by-example/types-send-sync.md b/book/en/src/by-example/types-send-sync.md similarity index 94% rename from book/src/by-example/types-send-sync.md rename to book/en/src/by-example/types-send-sync.md index 6433060a0a..da53cf963f 100644 --- a/book/src/by-example/types-send-sync.md +++ b/book/en/src/by-example/types-send-sync.md @@ -13,7 +13,7 @@ function. The example below shows the different types generates by the `app` attribute. ``` rust -{{#include ../../../examples/types.rs}} +{{#include ../../../../examples/types.rs}} ``` ## `Send` @@ -36,7 +36,7 @@ shared `static mut` resources. The example below shows where a type that doesn't implement `Send` can be used. ``` rust -{{#include ../../../examples/not-send.rs}} +{{#include ../../../../examples/not-send.rs}} ``` ## `Sync` @@ -56,5 +56,5 @@ resources shared between tasks that run at the *same* priority. The example below shows where a type that doesn't implement `Sync` can be used. ``` rust -{{#include ../../../examples/not-sync.rs}} +{{#include ../../../../examples/not-sync.rs}} ``` diff --git a/book/src/internals.md b/book/en/src/internals.md similarity index 100% rename from book/src/internals.md rename to book/en/src/internals.md diff --git a/book/src/internals/ceilings.md b/book/en/src/internals/ceilings.md similarity index 100% rename from book/src/internals/ceilings.md rename to book/en/src/internals/ceilings.md diff --git a/book/src/internals/tasks.md b/book/en/src/internals/tasks.md similarity index 100% rename from book/src/internals/tasks.md rename to book/en/src/internals/tasks.md diff --git a/book/src/internals/timer-queue.md b/book/en/src/internals/timer-queue.md similarity index 100% rename from book/src/internals/timer-queue.md rename to book/en/src/internals/timer-queue.md diff --git a/book/src/preface.md b/book/en/src/preface.md similarity index 77% rename from book/src/preface.md rename to book/en/src/preface.md index 9bc0401fea..d8f64fd473 100644 --- a/book/src/preface.md +++ b/book/en/src/preface.md @@ -9,8 +9,8 @@ This book contains user level documentation for the Real Time For the Masses There is a translation of this book in [Russian]. -[Russian]: ru/index.html +[Russian]: ../ru/index.html -{{#include ../../README.md:5:46}} +{{#include ../../../README.md:5:46}} -{{#include ../../README.md:52:}} +{{#include ../../../README.md:52:}} diff --git a/ru/book.toml b/book/ru/book.toml similarity index 100% rename from ru/book.toml rename to book/ru/book.toml diff --git a/ru/src/README_RU.md b/book/ru/src/README_RU.md similarity index 100% rename from ru/src/README_RU.md rename to book/ru/src/README_RU.md diff --git a/ru/src/SUMMARY.md b/book/ru/src/SUMMARY.md similarity index 100% rename from ru/src/SUMMARY.md rename to book/ru/src/SUMMARY.md diff --git a/ru/src/by-example.md b/book/ru/src/by-example.md similarity index 100% rename from ru/src/by-example.md rename to book/ru/src/by-example.md diff --git a/ru/src/by-example/app.md b/book/ru/src/by-example/app.md similarity index 94% rename from ru/src/by-example/app.md rename to book/ru/src/by-example/app.md index bcd778da2e..18147dc3f8 100644 --- a/ru/src/by-example/app.md +++ b/book/ru/src/by-example/app.md @@ -3,7 +3,7 @@ Это наименьшая возможная программа на RTFM: ``` rust -{{#include ../../../examples/smallest.rs}} +{{#include ../../../../examples/smallest.rs}} ``` Все программы на RTFM используют атрибут [`app`] (`#[app(..)]`). Этот атрибут @@ -44,14 +44,14 @@ демонстрирует безопасный доступ к переменной `static mut`. ``` rust -{{#include ../../../examples/init.rs}} +{{#include ../../../../examples/init.rs}} ``` Запуск примера напечатает `init` в консоли и завершит процесс QEMU. ``` console $ cargo run --example init -{{#include ../../../ci/expected/init.run}}``` +{{#include ../../../../ci/expected/init.run}}``` ## `idle` @@ -74,12 +74,12 @@ $ cargo run --example init В примере ниже показан запуск `idle` после `init`. ``` rust -{{#include ../../../examples/idle.rs}} +{{#include ../../../../examples/idle.rs}} ``` ``` console $ cargo run --example idle -{{#include ../../../ci/expected/idle.run}}``` +{{#include ../../../../ci/expected/idle.run}}``` ## `interrupt` / `exception` @@ -89,12 +89,12 @@ $ cargo run --example idle *аппаратными* задачами. ``` rust -{{#include ../../../examples/interrupt.rs}} +{{#include ../../../../examples/interrupt.rs}} ``` ``` console $ cargo run --example interrupt -{{#include ../../../ci/expected/interrupt.run}}``` +{{#include ../../../../ci/expected/interrupt.run}}``` До сих пор программы RTFM, которые мы видели не отличались от программ, которые можно написать, используя только библиотеку `cortex-m-rt`. В следующем разделе diff --git a/ru/src/by-example/new.md b/book/ru/src/by-example/new.md similarity index 98% rename from ru/src/by-example/new.md rename to book/ru/src/by-example/new.md index f3aa455135..688935e57a 100644 --- a/ru/src/by-example/new.md +++ b/book/ru/src/by-example/new.md @@ -64,4 +64,4 @@ $ cargo add panic-semihosting ``` console $ # ПРИМЕЧАНИЕ: Я раскомментировал опцию `runner` в `.cargo/config` $ cargo run -{{#include ../../../ci/expected/init.run}}``` +{{#include ../../../../ci/expected/init.run}}``` diff --git a/ru/src/by-example/resources.md b/book/ru/src/by-example/resources.md similarity index 95% rename from ru/src/by-example/resources.md rename to book/ru/src/by-example/resources.md index 096c803b1b..3e8a606621 100644 --- a/ru/src/by-example/resources.md +++ b/book/ru/src/by-example/resources.md @@ -19,12 +19,12 @@ К ресурсу `SHARED` можно получить доступ только из этих двух прерываний. ``` rust -{{#include ../../../examples/resource.rs}} +{{#include ../../../../examples/resource.rs}} ``` ``` console $ cargo run --example resource -{{#include ../../../ci/expected/resource.run}} +{{#include ../../../../ci/expected/resource.run}} ``` ## Приоритеты @@ -64,12 +64,12 @@ API критической секции, предоставляемое фрей [`lock`]: ../../api/rtfm/trait.Mutex.html#method.lock ``` rust -{{#include ../../../examples/lock.rs}} +{{#include ../../../../examples/lock.rs}} ``` ``` console $ cargo run --example lock -{{#include ../../../ci/expected/lock.run}}``` +{{#include ../../../../ci/expected/lock.run}}``` ## Поздние ресурсы @@ -93,12 +93,12 @@ $ cargo run --example lock [`Queue`]: ../../api/heapless/spsc/struct.Queue.html ``` rust -{{#include ../../../examples/late.rs}} +{{#include ../../../../examples/late.rs}} ``` ``` console $ cargo run --example late -{{#include ../../../ci/expected/late.run}}``` +{{#include ../../../../ci/expected/late.run}}``` ## `static`-ресурсы @@ -114,9 +114,9 @@ $ cargo run --example late задачах, запущенных на разных приоритетах. ``` rust -{{#include ../../../examples/static.rs}} +{{#include ../../../../examples/static.rs}} ``` ``` console $ cargo run --example static -{{#include ../../../ci/expected/static.run}}``` +{{#include ../../../../ci/expected/static.run}}``` diff --git a/ru/src/by-example/singletons.md b/book/ru/src/by-example/singletons.md similarity index 92% rename from ru/src/by-example/singletons.md rename to book/ru/src/by-example/singletons.md index 23ed167831..d6d60ef8c3 100644 --- a/ru/src/by-example/singletons.md +++ b/book/ru/src/by-example/singletons.md @@ -18,9 +18,9 @@ [`alloc-singleton`]: https://crates.io/crates/alloc-singleton ``` rust -{{#include ../../../examples/singleton.rs}} +{{#include ../../../../examples/singleton.rs}} ``` ``` console $ cargo run --example singleton -{{#include ../../../ci/expected/singleton.run}}``` +{{#include ../../../../ci/expected/singleton.run}}``` diff --git a/ru/src/by-example/tasks.md b/book/ru/src/by-example/tasks.md similarity index 92% rename from ru/src/by-example/tasks.md rename to book/ru/src/by-example/tasks.md index f0596d3751..355bd4eef3 100644 --- a/ru/src/by-example/tasks.md +++ b/book/ru/src/by-example/tasks.md @@ -19,12 +19,12 @@ RTFM также поддерживает *программные* задачи, разных приоритетах. Трем задачам назначены 2 обработчика прерываний. ``` rust -{{#include ../../../examples/task.rs}} +{{#include ../../../../examples/task.rs}} ``` ``` console $ cargo run --example task -{{#include ../../../ci/expected/task.run}}``` +{{#include ../../../../ci/expected/task.run}}``` ## Передача сообщений @@ -35,12 +35,12 @@ $ cargo run --example task Пример ниже демонстрирует три задачи, две из которых ожидают сообщения. ``` rust -{{#include ../../../examples/message.rs}} +{{#include ../../../../examples/message.rs}} ``` ``` console $ cargo run --example message -{{#include ../../../ci/expected/message.run}}``` +{{#include ../../../../ci/expected/message.run}}``` ## Ёмкость @@ -55,9 +55,9 @@ $ cargo run --example message не определена, тогда второй вызов `spawn.foo` в `UART0` вызовет ошибку. ``` rust -{{#include ../../../examples/capacity.rs}} +{{#include ../../../../examples/capacity.rs}} ``` ``` console $ cargo run --example capacity -{{#include ../../../ci/expected/capacity.run}}``` +{{#include ../../../../ci/expected/capacity.run}}``` diff --git a/ru/src/by-example/timer-queue.md b/book/ru/src/by-example/timer-queue.md similarity index 95% rename from ru/src/by-example/timer-queue.md rename to book/ru/src/by-example/timer-queue.md index 939192fa9a..8995bd056c 100644 --- a/ru/src/by-example/timer-queue.md +++ b/book/ru/src/by-example/timer-queue.md @@ -30,13 +30,13 @@ > тактов Cortex-M не реализована в `qemu-system-arm`. ``` rust -{{#include ../../../examples/schedule.rs}} +{{#include ../../../../examples/schedule.rs}} ``` Запуск программы на реальном оборудовании производит следующий вывод в консоли: ``` text -{{#include ../../../ci/expected/schedule.run}} +{{#include ../../../../ci/expected/schedule.run}} ``` ## Периодические задачи @@ -46,7 +46,7 @@ быть использованы для реализации периодических задач, как показано в примере ниже. ``` rust -{{#include ../../../examples/periodic.rs}} +{{#include ../../../../examples/periodic.rs}} ``` Это вывод, произведенный примером. Заметьте, что есть смещение / колебание нуля @@ -54,7 +54,7 @@ `Instant::now` вместо `scheduled` имело бы влияние на смещение / колебание. ``` text -{{#include ../../../ci/expected/periodic.run}} +{{#include ../../../../ci/expected/periodic.run}} ``` ## Базовое время @@ -80,11 +80,11 @@ Пример ниже демонстрирует разное значение *базового времени*. ``` rust -{{#include ../../../examples/baseline.rs}} +{{#include ../../../../examples/baseline.rs}} ``` Запуск программы на реальном оборудовании произведет следующий вывод в консоли: ``` text -{{#include ../../../ci/expected/baseline.run}} +{{#include ../../../../ci/expected/baseline.run}} ``` diff --git a/ru/src/by-example/tips.md b/book/ru/src/by-example/tips.md similarity index 91% rename from ru/src/by-example/tips.md rename to book/ru/src/by-example/tips.md index ab0f1b570f..029451280a 100644 --- a/ru/src/by-example/tips.md +++ b/book/ru/src/by-example/tips.md @@ -8,12 +8,12 @@ ресурсами, который можно вызывать из различных задач. Вот такой пример: ``` rust -{{#include ../../../examples/generics.rs}} +{{#include ../../../../examples/generics.rs}} ``` ``` console $ cargo run --example generics -{{#include ../../../ci/expected/generics.run}}``` +{{#include ../../../../ci/expected/generics.run}}``` Это также позволяет Вам изменять статические приоритеты задач без переписывания кода. Если Вы единообразно используете `lock`-и для доступа @@ -42,22 +42,22 @@ RTFM v0.4.x была возможность взаимодействия с др В примере ниже показано как разместить высокоприоритетную задачу `bar` в ОЗУ. ``` rust -{{#include ../../../examples/ramfunc.rs}} +{{#include ../../../../examples/ramfunc.rs}} ``` Запуск этой программы произведет ожидаемый вывод. ``` console $ cargo run --example ramfunc -{{#include ../../../ci/expected/ramfunc.run}}``` +{{#include ../../../../ci/expected/ramfunc.run}}``` Можно посмотреть на вывод `cargo-nm`, чтобы убедиться, что `bar` расположен в ОЗУ (`0x2000_0000`), тогда как `foo` расположен во Flash (`0x0000_0000`). ``` console $ cargo nm --example ramfunc --release | grep ' foo::' -{{#include ../../../ci/expected/ramfunc.grep.foo}}``` +{{#include ../../../../ci/expected/ramfunc.grep.foo}}``` ``` console $ cargo nm --example ramfunc --release | grep ' bar::' -{{#include ../../../ci/expected/ramfunc.grep.bar}}``` +{{#include ../../../../ci/expected/ramfunc.grep.bar}}``` diff --git a/ru/src/by-example/types-send-sync.md b/book/ru/src/by-example/types-send-sync.md similarity index 96% rename from ru/src/by-example/types-send-sync.md rename to book/ru/src/by-example/types-send-sync.md index e470adf7b2..77c9af01ca 100644 --- a/ru/src/by-example/types-send-sync.md +++ b/book/ru/src/by-example/types-send-sync.md @@ -13,7 +13,7 @@ В примере ниже сгенерированы разные типы с помощью атрибута `app`. ``` rust -{{#include ../../../examples/types.rs}} +{{#include ../../../../examples/types.rs}} ``` ## `Send` @@ -35,7 +35,7 @@ В примере ниже показано, где можно использовать типы, не реализующие `Send`. ``` rust -{{#include ../../../examples/not-send.rs}} +{{#include ../../../../examples/not-send.rs}} ``` ## `Sync` @@ -55,5 +55,5 @@ В примере ниже показано, где можно использовать типы, не реализующие `Sync`. ``` rust -{{#include ../../../examples/not-sync.rs}} +{{#include ../../../../examples/not-sync.rs}} ``` diff --git a/ru/src/internals.md b/book/ru/src/internals.md similarity index 100% rename from ru/src/internals.md rename to book/ru/src/internals.md diff --git a/ru/src/internals/ceilings.md b/book/ru/src/internals/ceilings.md similarity index 100% rename from ru/src/internals/ceilings.md rename to book/ru/src/internals/ceilings.md diff --git a/ru/src/internals/tasks.md b/book/ru/src/internals/tasks.md similarity index 100% rename from ru/src/internals/tasks.md rename to book/ru/src/internals/tasks.md diff --git a/ru/src/internals/timer-queue.md b/book/ru/src/internals/timer-queue.md similarity index 100% rename from ru/src/internals/timer-queue.md rename to book/ru/src/internals/timer-queue.md diff --git a/ru/src/preface.md b/book/ru/src/preface.md similarity index 86% rename from ru/src/preface.md rename to book/ru/src/preface.md index 8aa53ad75f..ee01d10134 100644 --- a/ru/src/preface.md +++ b/book/ru/src/preface.md @@ -7,6 +7,6 @@ Эта книга содержит документацию уровня пользователя фреймворком Real Time For the Masses (RTFM). Описание API можно найти [здесь](../api/rtfm/index.html). -{{#include README_RU.md:5:54}} +{{#include ../..ADME_RU.md:5:54}} -{{#include README_RU.md:60:}} +{{#include ../..ADME_RU.md:60:}} diff --git a/ci/script.sh b/ci/script.sh index 8878d92350..645db3aacd 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -23,15 +23,19 @@ main() { else cargo doc fi - ( cd book && mdbook build ) - ( cd ru && mdbook build ) + ( cd book/en && mdbook build ) + ( cd book/ru && mdbook build ) local td=$(mktemp -d) cp -r target/doc $td/api - cp -r book/book $td/ - cp LICENSE-* $td/book/ + mkdir $td/book + cp -r book/en/book $td/book/en + cp -r book/ru/book $td/book/ru + cp LICENSE-* $td/book/en + cp LICENSE-* $td/book/ru - linkchecker $td/book/ + linkchecker $td/book/en/ + linkchecker $td/book/ru/ linkchecker $td/api/rtfm/ linkchecker $td/api/cortex_m_rtfm_macros/ fi diff --git a/src/lib.rs b/src/lib.rs index 4756702e6e..9dc5175685 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ //! //! The user level documentation can be found [here]. //! -//! [here]: https://japaric.github.io/cortex-m-rtfm/book/ +//! [here]: https://japaric.github.io/cortex-m-rtfm/book/en/ //! //! Don't forget to check the documentation of the [`#[app]`] attribute, which is the main component //! of the framework.