Skip to content

Commit

Permalink
Merge pull request #1662 from YJDoc2/test-book
Browse files Browse the repository at this point in the history
Add a Test Book to verify style changes against
  • Loading branch information
ehuss authored Oct 24, 2021
2 parents ffa8284 + b8ef89d commit 9e47498
Show file tree
Hide file tree
Showing 24 changed files with 1,402 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ guide/book

.vscode
tests/dummy_book/book/
test_book/book/

# Ignore Jetbrains specific files.
.idea/
Expand Down
27 changes: 27 additions & 0 deletions test_book/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[book]
title = "mdBook test book"
description = "A demo book to test and validate changes"
authors = ["YJDoc2"]
language = "en"

[rust]
edition = "2018"

[output.html]
mathjax-support = true

[output.html.playground]
editable = true
line-numbers = true

[output.html.search]
limit-results = 20
use-boolean-and = true
boost-title = 2
boost-hierarchy = 2
boost-paragraph = 1
expand = true
heading-split-level = 2

[output.html.redirect]
"/format/config.html" = "configuration/index.html"
12 changes: 12 additions & 0 deletions test_book/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Demo Book

This is a simple demo book, which is intended to be used for verifying and validating style changes in mdBook.
This contains dummy examples of various markdown elements and code languages, so that one can check changes made in mdBook styles.

This rough outline is :

- individual : contains basic markdown elements such as headings, paragraphs, links etc.
- languages : contains a `hello world` in each of supported language to see changes in syntax highlighting
- rust : contains language examples specific to rust, such as play pen, runnable examples etc.

This is more for checking and fixing style, rather than verifying that correct code is generated for given markdown, that is better handled in tests.
33 changes: 33 additions & 0 deletions test_book/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Summary

[Prefix Chapter](prefix.md)

---

- [Introduction](README.md)
- [Draft Chapter]()

# Actual Markdown Tag Examples

- [Markdown Individual tags](individual/README.md)
- [Heading](individual/heading.md)
- [Paragraphs](individual/paragraph.md)
- [Line Break](individual/linebreak.md)
- [Emphasis](individual/emphasis.md)
- [Blockquote](individual/blockquote.md)
- [List](individual/list.md)
- [Code](individual/code.md)
- [Image](individual/image.md)
- [Links and Horizontal Rule](individual/link_hr.md)
- [Tables](individual/table.md)
- [Tasks](individual/task.md)
- [Strikethrough](individual/strikethrough.md)
- [Mixed](individual/mixed.md)
- [Languages](languages/README.md)
- [Syntax Highlight](languages/highlight.md)
- [Rust Specific](rust/README.md)
- [Rust Codeblocks](rust/rust_codeblock.md)

---

[Suffix Chapter](suffix.md)
17 changes: 17 additions & 0 deletions test_book/src/individual/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Individual Common mark tags

This contains following tags:

- Headings
- Paragraphs
- Line breaks
- Emphasis
- Blockquotes
- Lists
- Code blocks
- Images
- Links and Horizontal rules
- Github tables
- Github Task Lists
- Strikethrough
- Mixed
30 changes: 30 additions & 0 deletions test_book/src/individual/blockquote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Blockquote

> This is a quoted sentence.
> This is a quoted paragraph
>
> separated lines
> here
> Nested
>
> > Quoted
> > Paragraph
> ### And now,
>
> **Let us _introduce_**
> All kinds of
>
> - tags
> - etc
> - stuff
>
> 1. In
> 2. The
> 3. blockquote
>
> > cause we can
> >
> > > Cause we can
31 changes: 31 additions & 0 deletions test_book/src/individual/code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Code

This section only does simple code blocks and inline code, detailed syntax highlight and stuff is in the languages section

---

```
This is a codeblock
```

---

This line contains `inline code`

---

````
escaping ``` in ```, fun, isn't is?
````

---

```bash,editable
This is an editable codeblock
```

---

```rust
// This links to a playpen
```
13 changes: 13 additions & 0 deletions test_book/src/individual/emphasis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Emphasis

This has **bold text** in between normal.

This has _italic text_ in between normal.

A **line** having _both_, bold and italic text.

**A bold line _having_ italic text**

_An Italic line having **bold** text_

Now this is going **_out of hands_**.
15 changes: 15 additions & 0 deletions test_book/src/individual/heading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Chapter Heading

---

# Really Big Heading

## Big Heading

### Normal-ish Heading

#### Small Heading...?

##### Really Small Heading

###### Is it even a heading anymore - heading
27 changes: 27 additions & 0 deletions test_book/src/individual/image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Images

For copyright and trademark information on these images, please check [rust-artwork repository](https://github.com/rust-lang/rust-artworkhttps://github.com/rust-lang/rust-artwork)

## A 16x16 image

![16x16 rust-lang logo](http://rust-lang.org/logos/rust-logo-16x16.png)

## A 32x32 image

![32x32 rust-lang logo](http://rust-lang.org/logos/rust-logo-32x32-blk.png)

## A 256x256 image

![256x256 rust-lang logo](http://rust-lang.org/logos/rust-logo-256x256.png)

## A 512x512 image

![512x512 rust-lang logo](http://rust-lang.org/logos/rust-logo-512x512-blk.png)

## A large image

![2018 rust-conf art](https://raw.githubusercontent.com/rust-lang/rust-artwork/master/2018-RustConf/lucy-mountain-climber.png)

## A SVG image

![2018 rust-conf art svg](https://raw.githubusercontent.com/rust-lang/rust-artwork/461afe27d8e02451cf9f46e507f2c2a71d2b276b/2018-RustConf/lucy-mountain-climber.svg)
8 changes: 8 additions & 0 deletions test_book/src/individual/linebreak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Line breaks

This is a long
line with a couple of
line breaks in <br/>
between : both with two
spaces and return, <br/>
and with HTML tags.
15 changes: 15 additions & 0 deletions test_book/src/individual/link_hr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Links and Horizontal Rule

This is followed by a Horizontal rule

---

And this is preceded by a horizontal rule.

[This](www.rust-lang.org) should link to rust-lang website
[So should this][rl].
**[This][rl]** is a strong link.
_[This][rl]_ is italic.
**_[This][rl]_** is both.

[rl]: www.rust-lang.org
35 changes: 35 additions & 0 deletions test_book/src/individual/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Lists

1. A
2. Normal
3. Ordered
4. List

---

1. A
1. Nested
2. List
2. But
3. Still
4. Normal

---

- An
- Unordered
- Normal
- List

---

- Nested
- Unordered
- List

---

- This
1. Is
2. Normal
- ?!
61 changes: 61 additions & 0 deletions test_book/src/individual/mixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Mixed

This contains all tags randomly mixed together, to make sure style changes in one does not affect others.

### A heading

**Quite a Strong statement , to make**

~~No, cross that~~

> Whose **quote** is this
>
> > And ~~this~~
> >
> > > - and
> > > - this
> > > - also
```
You encountered a wild codepen
```

```rust,editable
// The codepen is editable and runnable
fn main(){
println!("Hello world!");
}
```

A random image sprinkled in between

![16x16 rust-lang logo](http://rust-lang.org/logos/rust-logo-16x16.png)

---

- ~~An unordered list~~
- **Hello**
- _World_
- What
1. Should
2. be
3. `put`
4. here?

| col1 | col2 | col 3 | col 4 | col 5 | col 6 |
| ---- | ---- | ----- | ----- | ----- | ----- |
| val1 | val2 | val3 | val5 | val4 | val6 |

| col1 | col2 | col 3 | An Questionable table header | col 5 | col 6 |
| ---- | ---- | ----- | ---------------------------- | ----- | ---------------------------------------- |
| val1 | val2 | val3 | val5 | val4 | An equally Questionable long table value |

### Things to do

- [x] Add individual tags
- [ ] Add language examples
- [ ] Add rust specific examples

And another image

![2018 rust-conf art svg](https://raw.githubusercontent.com/rust-lang/rust-artwork/461afe27d8e02451cf9f46e507f2c2a71d2b276b/2018-RustConf/lucy-mountain-climber.svg)
25 changes: 25 additions & 0 deletions test_book/src/individual/paragraph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Just a simple paragraph.

Let's stress test this.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer elit lorem, eleifend eu leo sit amet, suscipit feugiat libero. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Proin congue lectus sit amet lacus venenatis, ac sollicitudin purus condimentum. Suspendisse pretium volutpat sapien at gravida. In tincidunt, sem non accumsan consectetur, leo libero porttitor dolor, at imperdiet erat nibh quis leo. Cras dictum erat augue, quis pharetra justo porttitor posuere. Aenean sed lacinia justo, vel suscipit nisl. Etiam eleifend id mauris at gravida. Aliquam molestie cursus lorem pulvinar sollicitudin. Nam et ex dignissim, posuere sem non, pellentesque lacus. Morbi vulputate sed lorem et convallis. Duis non turpis eget elit posuere volutpat. Donec accumsan euismod enim, id consequat ex rhoncus ac. Pellentesque ac felis nisl. Duis imperdiet vel tellus ac iaculis.

Vivamus nec tempus enim. Integer in ligula eget elit ornare vulputate id et est. Proin mi elit, sagittis nec urna et, iaculis imperdiet neque. Vestibulum placerat cursus dolor. Donec eu sodales nulla. Praesent ac tellus eros. Donec venenatis ligula id ex porttitor malesuada. Aliquam maximus, nisi in fringilla finibus, ante elit rhoncus dui, placerat semper nisl tellus quis odio. Cras luctus magna ultrices dolor pharetra volutpat. Maecenas non enim vitae ligula efficitur aliquet id quis quam. In sagittis mollis magna eu porta. Morbi at nulla et ante elementum pharetra in sed est. Nam commodo purus enim.

Ut non elit sit amet urna luctus facilisis vel et sapien. Morbi nec metus at libero imperdiet sollicitudin eget quis lacus. Donec in ipsum at enim accumsan tempor vel sed magna. Aliquam non imperdiet neque. Etiam pharetra neque sed pretium interdum. Suspendisse potenti. Phasellus varius, lectus quis dapibus faucibus, purus mauris accumsan nibh, vel tempor quam metus nec sem. Nunc sagittis suscipit lorem eu finibus. Nullam augue leo, imperdiet vel diam et, vulputate scelerisque turpis. Nullam ut volutpat diam. Praesent cursus accumsan dui a commodo. Vivamus sed libero sed turpis facilisis rutrum id sed ligula. Ut id sollicitudin dui. Nulla pulvinar commodo lectus. Cras ut quam congue, consectetur dolor ac, consequat ante.

Curabitur scelerisque sed leo eu facilisis. Nam faucibus neque eget dictum hendrerit. Duis efficitur ex sed vulputate volutpat. Praesent condimentum nisl ac sapien efficitur laoreet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut nibh elit. Nunc a neque lobortis, tempus diam vitae, interdum magna. Aenean eget nisl sed justo volutpat interdum. Mauris malesuada ex nisl, a dignissim dui elementum eget. Suspendisse potenti.

Praesent congue fringilla sem sed faucibus. Vivamus malesuada eget mauris at molestie. In sed faucibus nulla. Vivamus elementum accumsan metus quis suscipit. Maecenas interdum est nulla. Cras volutpat cursus nibh quis sollicitudin. Morbi vitae massa laoreet, aliquet tellus quis, consectetur ipsum. Mauris euismod congue purus non condimentum. Etiam laoreet mi vel sem consectetur gravida. Vestibulum volutpat magna nunc, vitae ultrices risus commodo eu.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer elit lorem, eleifend eu leo sit amet, suscipit feugiat libero. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Proin congue lectus sit amet lacus venenatis, ac sollicitudin purus condimentum. Suspendisse pretium volutpat sapien at gravida. In tincidunt, sem non accumsan consectetur, leo libero porttitor dolor, at imperdiet erat nibh quis leo. Cras dictum erat augue, quis pharetra justo porttitor posuere. Aenean sed lacinia justo, vel suscipit nisl. Etiam eleifend id mauris at gravida. Aliquam molestie cursus lorem pulvinar sollicitudin. Nam et ex dignissim, posuere sem non, pellentesque lacus. Morbi vulputate sed lorem et convallis. Duis non turpis eget elit posuere volutpat. Donec accumsan euismod enim, id consequat ex rhoncus ac. Pellentesque ac felis nisl. Duis imperdiet vel tellus ac iaculis.

Vivamus nec tempus enim. Integer in ligula eget elit ornare vulputate id et est. Proin mi elit, sagittis nec urna et, iaculis imperdiet neque. Vestibulum placerat cursus dolor. Donec eu sodales nulla. Praesent ac tellus eros. Donec venenatis ligula id ex porttitor malesuada. Aliquam maximus, nisi in fringilla finibus, ante elit rhoncus dui, placerat semper nisl tellus quis odio. Cras luctus magna ultrices dolor pharetra volutpat. Maecenas non enim vitae ligula efficitur aliquet id quis quam. In sagittis mollis magna eu porta. Morbi at nulla et ante elementum pharetra in sed est. Nam commodo purus enim.

Ut non elit sit amet urna luctus facilisis vel et sapien. Morbi nec metus at libero imperdiet sollicitudin eget quis lacus. Donec in ipsum at enim accumsan tempor vel sed magna. Aliquam non imperdiet neque. Etiam pharetra neque sed pretium interdum. Suspendisse potenti. Phasellus varius, lectus quis dapibus faucibus, purus mauris accumsan nibh, vel tempor quam metus nec sem. Nunc sagittis suscipit lorem eu finibus. Nullam augue leo, imperdiet vel diam et, vulputate scelerisque turpis. Nullam ut volutpat diam. Praesent cursus accumsan dui a commodo. Vivamus sed libero sed turpis facilisis rutrum id sed ligula. Ut id sollicitudin dui. Nulla pulvinar commodo lectus. Cras ut quam congue, consectetur dolor ac, consequat ante.

Curabitur scelerisque sed leo eu facilisis. Nam faucibus neque eget dictum hendrerit. Duis efficitur ex sed vulputate volutpat. Praesent condimentum nisl ac sapien efficitur laoreet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut nibh elit. Nunc a neque lobortis, tempus diam vitae, interdum magna. Aenean eget nisl sed justo volutpat interdum. Mauris malesuada ex nisl, a dignissim dui elementum eget. Suspendisse potenti.

Praesent congue fringilla sem sed faucibus. Vivamus malesuada eget mauris at molestie. In sed faucibus nulla. Vivamus elementum accumsan metus quis suscipit. Maecenas interdum est nulla. Cras volutpat cursus nibh quis sollicitudin. Morbi vitae massa laoreet, aliquet tellus quis, consectetur ipsum. Mauris euismod congue purus non condimentum. Etiam laoreet mi vel sem consectetur gravida. Vestibulum volutpat magna nunc, vitae ultrices risus commodo eu.

Hopefully everything above was rendered nicely, on both desktop and mobile.
5 changes: 5 additions & 0 deletions test_book/src/individual/strikethrough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Strikethrough

~~This is Striked~~

~~This is **strong**, _italic_ , **_both_** and striked~~
Loading

0 comments on commit 9e47498

Please sign in to comment.