-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23daf8c
commit b18add3
Showing
16 changed files
with
242 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
data_out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[book] | ||
authors = ["Jonathan Pallant"] | ||
language = "en" | ||
multilingual = false | ||
src = "src" | ||
title = "Sample Book" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>$TITLE</title> | ||
</head> | ||
<body class="article"> | ||
<h1>$TITLE</h1> | ||
<div> | ||
$INDEX | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Summary | ||
|
||
- [Chapter 1](./chapter_1.md) | ||
- [Chapter 2](./chapter_2.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Page 1 | ||
|
||
## Page 2 | ||
|
||
--- | ||
|
||
Page 3 | ||
|
||
## Page 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Page 1 | ||
|
||
```dot process | ||
digraph { | ||
node [shape=record]; | ||
"X"; | ||
} | ||
``` | ||
|
||
## Page 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>$TITLE</title> | ||
</head> | ||
<body> | ||
<section data-markdown> | ||
<textarea data-template> | ||
$CONTENT | ||
</textarea> | ||
</section> | ||
</body> | ||
</html> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//! Builds a reference book into a set of slides, and checks they match what we expect. | ||
use std::path::Path; | ||
|
||
#[test] | ||
fn build_slides() { | ||
let slide_template_string = include_str!("./data_in/template.html"); | ||
let index_template_string = include_str!("./data_in/index_template.html"); | ||
println!("We are in: {}", std::env::current_dir().unwrap().display()); | ||
mdslides::run( | ||
Some(Path::new("tests/data_in")), | ||
Path::new("tests/data_out"), | ||
slide_template_string, | ||
Some(index_template_string), | ||
) | ||
.expect("mdslides failed"); | ||
|
||
let comparison = folder_compare::FolderCompare::new( | ||
Path::new("tests/reference_out"), | ||
Path::new("tests/data_out"), | ||
&vec![], | ||
) | ||
.expect("failed to compare"); | ||
if !comparison.changed_files.is_empty() { | ||
for filename in comparison.changed_files { | ||
let contents = std::fs::read_to_string(&filename).unwrap(); | ||
eprintln!( | ||
"Changed File {filename}:\n{contents}", | ||
filename = filename.display() | ||
); | ||
} | ||
panic!("Some files differ"); | ||
} | ||
if !comparison.new_files.is_empty() { | ||
for filename in comparison.new_files { | ||
let contents = std::fs::read_to_string(&filename).unwrap(); | ||
eprintln!( | ||
"New File {filename}:\n{contents}", | ||
filename = filename.display() | ||
); | ||
} | ||
panic!("Some new files found"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Chapter 1</title> | ||
</head> | ||
<body> | ||
<section data-markdown> | ||
<textarea data-template> | ||
# Page 1 | ||
|
||
--- | ||
## Page 2 | ||
|
||
--- | ||
|
||
Page 3 | ||
|
||
--- | ||
## Page 4 | ||
|
||
</textarea> | ||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Chapter 2</title> | ||
</head> | ||
<body> | ||
<section data-markdown> | ||
<textarea data-template> | ||
# Page 1 | ||
|
||
<figure> | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" | ||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | ||
<!-- Generated by graphviz version 12.2.0 (20241103.1931) | ||
--> | ||
<!-- Pages: 1 --> | ||
<svg width="62pt" height="45pt" | ||
viewBox="0.00 0.00 62.00 45.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 41)"> | ||
<polygon fill="white" stroke="none" points="-4,4 -4,-41 58,-41 58,4 -4,4"/> | ||
<!-- X --> | ||
<g id="node1" class="node"> | ||
<title>X</title> | ||
<polygon fill="none" stroke="black" points="0,-0.5 0,-36.5 54,-36.5 54,-0.5 0,-0.5"/> | ||
<text text-anchor="middle" x="26.88" y="-13.45" font-family="Times,serif" font-size="14.00">X</text> | ||
</g> | ||
</g> | ||
</svg> | ||
</figure> | ||
|
||
--- | ||
## Page 2 | ||
|
||
</textarea> | ||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Sample Book</title> | ||
</head> | ||
<body class="article"> | ||
<h1>Sample Book</h1> | ||
<div> | ||
<h1>Summary</h1> | ||
<ul> | ||
<li><a href="./chapter_1.html">Chapter 1</a></li> | ||
<li><a href="./chapter_2.html">Chapter 2</a></li> | ||
</ul> | ||
|
||
</div> | ||
</body> | ||
</html> |