Skip to content

Commit

Permalink
Replace homebrew include_md with mdbook feature
Browse files Browse the repository at this point in the history
mdbook now supports anchors to include partial files, which means we
don't need custom include_md support to include only a portion of the
readme in chapters.
  • Loading branch information
rinon committed Apr 15, 2022
1 parent 1f53baf commit 7e2b0d9
Show file tree
Hide file tree
Showing 8 changed files with 438 additions and 2,797 deletions.
2,841 changes: 428 additions & 2,413 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ members = [
"c2rust-ast-builder",
"c2rust-ast-exporter",
"c2rust-ast-printer",
"manual/preprocessors",
"c2rust-bitfields",
"c2rust-macros",
"c2rust-asm-casts",
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ To learn more, check out our [RustConf'18](https://www.youtube.com/watch?v=WEsR0

To learn more about using and developing C2Rust, check out the [manual](https://c2rust.com/manual/). The manual is still a work-in-progress, so if you can't find something please let us know.

<!-- ANCHOR: installation -->

## Installation

### Prerequisites
Expand Down Expand Up @@ -83,6 +85,9 @@ Please note that the master branch is under constant development and you may exp

You should also set `LLVM_CONFIG_PATH` accordingly if required as described above.

<!-- ANCHOR_END: installation -->
<!-- ANCHOR: translating-c-to-rust -->

## Translating C to Rust

To translate C files specified in `compile_commands.json` (see below), run the `c2rust` tool with the `transpile` subcommand:
Expand Down Expand Up @@ -155,6 +160,8 @@ If you have [bear](https://github.com/rizsotto/Bear) installed, it can be used s

bear <build command>

<!-- ANCHOR_END: translating-c-to-rust -->

## Contact
To report issues with translation or refactoring, please use our [Issue Tracker](https://github.com/immunant/c2rust/issues).

Expand Down
5 changes: 1 addition & 4 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ src = "manual/"

[build]
create-missing = false
preprocess = ["links", "index", "include_md", "generator_dispatch"]

[preprocessor.include_md]
command = "cargo run --bin mdbook-include_md --quiet --"
preprocess = ["links", "index"]

[preprocessor.generator_dispatch]
command = "python3 manual/preprocessors/generator_dispatch.py"
Expand Down
2 changes: 1 addition & 1 deletion manual/installation.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{#include_md README.md#installation}}
{{#include README.md:installation}}
20 changes: 0 additions & 20 deletions manual/preprocessors/Cargo.toml

This file was deleted.

Loading

0 comments on commit 7e2b0d9

Please sign in to comment.