Skip to content

Commit

Permalink
docs: use official mdbook + fix introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Jun 2, 2024
1 parent f49ae3f commit c35f960
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 41 deletions.
6 changes: 3 additions & 3 deletions docs/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ To work with Rustemo a usual sequence of steps is as follows (after installing
1. Write a grammar in a textual file with `.rustemo` extension. For example, a
JSON grammar might look like this (see the examples directory):

```
{{#include ../../examples/json/src/json.rustemo}}
```
```
{{#include ../../examples/json/src/json.rustemo}}
```

2. Run `rcomp` compiler (a binary installed from `rustemo-compiler` crate) with
the given grammar to produce the parser code and optional builder actions
Expand Down
18 changes: 0 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 4 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@
url = "github:zjp-CN/mdbook-theme";
flake = false;
};
# mdbook with fixes.
# Current fixes:
# - https://github.com/rust-lang/mdBook/pull/1718
mdbook = {
url = "github:igordejanovic/mdbook?ref=merged-prs";
flake = false;
};
};

outputs = { self, nixpkgs, flake-utils, rust-overlay, mdbook-theme, mdbook }:
outputs = { self, nixpkgs, flake-utils, rust-overlay, mdbook-theme}:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
Expand All @@ -33,20 +26,13 @@
src = mdbook-theme;
};

mdbook-pkg = pkgs.rustPlatform.buildRustPackage {
pname = "mdbook";
version = "0.4.26.fix";
cargoLock.lockFile = mdbook.outPath + "/Cargo.lock";
src = mdbook;
};

tex = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-small standalone qtree pict2e preview;
};

buildInputsDocs = with pkgs; [
wget git bash
mdbook-pkg mdbook-admonish mdbook-plantuml
mdbook mdbook-admonish mdbook-plantuml
mdbook-graphviz mdbook-theme-pkg mdbook-linkcheck
plantuml graphviz tex poppler_utils];

Expand All @@ -62,12 +48,10 @@
buildInputs = buildInputsDocs;

buildPhase = ''
cd docs
./build-latex-images.sh
mdbook build
mdbook build docs
'';
installPhase = ''
mv book $out
mv docs/book $out
'';
};
}
Expand Down

0 comments on commit c35f960

Please sign in to comment.