Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[for review] multi-language mdbook #200

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ebd075a
Add structs holding metadata for the books
azerupi Jun 28, 2016
e584858
Add a new Chapter struct for the new Book struct
azerupi Jun 28, 2016
c69161c
Add the new book struct
azerupi Jun 28, 2016
d664618
Derive Clone and Debug for Chapter and Book
azerupi Jun 28, 2016
3e0dca5
Include the new Book struct in a hashmap alongside the old representa…
azerupi Jun 28, 2016
7862dc0
Add structs holding metadata for the books
azerupi Jun 28, 2016
9f99ba2
Add a new Chapter struct for the new Book struct
azerupi Jun 28, 2016
42909cf
Add the new book struct
azerupi Jun 28, 2016
99e8082
Derive Clone and Debug for Chapter and Book
azerupi Jun 28, 2016
efc2644
Include the new Book struct in a hashmap alongside the old representa…
azerupi Jun 28, 2016
9189053
frontmatter, mainmatter, backmatter
Dec 20, 2016
bfdc70c
preparing structs
Dec 20, 2016
5525cd4
Merge branch 'book-struct' of github.com:gambhiro/mdBook into book-st…
Dec 20, 2016
7edee42
docs for refactoring design
Dec 22, 2016
852fc1d
plan for reorganizing structs
Dec 25, 2016
44b03bd
Merge remote-tracking branch 'origin/book-struct' into ebooks
Dec 25, 2016
2cae064
Merge remote-tracking branch 'origin/parse-toml' into ebooks
Dec 25, 2016
204a878
Merge remote-tracking branch 'origin/docs' into ebooks
Dec 25, 2016
e7ba6fa
multilang
Dec 31, 2016
c021940
translation links
Jan 10, 2017
3aa8f7d
watch and serve are back
Jan 11, 2017
0532295
remove todo comment
Jan 11, 2017
2a033de
look in different paths for page template
Jan 11, 2017
5ca380f
render markdown in make_data()
Jan 12, 2017
da9c57e
write print.html
Jan 13, 2017
0713d49
chapter.content, .src_path, .dest_path
Jan 13, 2017
a1375b1
upd structs diagram
Jan 13, 2017
ae09aab
fix highlight css selection
Jan 14, 2017
35890db
don't link for a single language
Jan 14, 2017
34ee6c9
remove proc_macro
Jan 14, 2017
9857455
upd doc string
Jan 15, 2017
6492faa
recognize main language as first given in book.toml
Jan 15, 2017
ca40e71
index links and translation links separately
Jan 16, 2017
4973c02
use chapter title + book title as page title
Jan 16, 2017
badc921
cross-link translations by translation_id and src_path
Jan 16, 2017
aa54d95
cross-link by section number if TOC are structurally the same
Jan 16, 2017
eb5a9b9
cli test command is back
Jan 18, 2017
27721c2
apply highlightjs style by class on body
Jan 18, 2017
a8021eb
upd test assets
Jan 18, 2017
cb861a7
clean output folder without removing dotfiles
Jan 18, 2017
8441bb9
more simple language declaration in book.toml
Jan 18, 2017
4fe0e8d
update docs in the source
Jan 18, 2017
ca718b3
link in custom.css if the user has it
Jan 18, 2017
c2ff0c6
catch up with changes in master
Jan 19, 2017
a7666e7
resolve conflicts
Jan 19, 2017
05ec8ae
not testing on stable channel for now
Jan 20, 2017
0bebd9e
make tests windows compatible
Jan 20, 2017
0a5efcc
update documentation in book-example
Jan 21, 2017
6213943
only whitespace before chapter toml header
Jan 21, 2017
78505ff
upd
Jan 21, 2017
b162d04
ignore failing tests
Jan 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
*.swp
.#*
Cargo.lock
target

book-test
TAGS
src/tests/book-minimal/book
src/tests/book-minimal-with-assets/book
src/tests/book-wonderland-multilang/book
book-example/book
64 changes: 34 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,9 @@ env:

matrix:
include:
# Stable channel
- os: osx
env: TARGET=i686-apple-darwin CHANNEL=stable
- os: linux
env: TARGET=i686-unknown-linux-gnu CHANNEL=stable
addons:
apt:
packages: &i686_unknown_linux_gnu
- gcc-multilib
- os: osx
env: TARGET=x86_64-apple-darwin CHANNEL=stable
- os: linux
env: TARGET=x86_64-unknown-linux-gnu CHANNEL=stable
addons:
apt:
packages:
- nodejs
- npm
- os: linux
env: TARGET=x86_64-unknown-linux-musl CHANNEL=stable
# Beta channel
- os: osx
env: TARGET=i686-apple-darwin CHANNEL=beta
- os: linux
env: TARGET=i686-unknown-linux-gnu CHANNEL=beta
addons:
apt:
packages: *i686_unknown_linux_gnu
- os: osx
env: TARGET=x86_64-apple-darwin CHANNEL=beta
- os: linux
Expand All @@ -46,18 +21,47 @@ matrix:
# Nightly channel
- os: osx
env: TARGET=i686-apple-darwin CHANNEL=nightly
- os: linux
env: TARGET=i686-unknown-linux-gnu CHANNEL=nightly
addons:
apt:
packages: *i686_unknown_linux_gnu
- os: osx
env: TARGET=x86_64-apple-darwin CHANNEL=nightly
- os: linux
env: TARGET=x86_64-unknown-linux-gnu CHANNEL=nightly
- os: linux
env: TARGET=x86_64-unknown-linux-musl CHANNEL=nightly

# FIXME The command "bash ci/script.sh" exited with 101. https://travis-ci.org/azerupi/mdBook/builds/194064441
# - os: linux
# env: TARGET=i686-unknown-linux-gnu CHANNEL=nightly
# addons:
# apt:
# packages: *i686_unknown_linux_gnu
# - os: linux
# env: TARGET=i686-unknown-linux-gnu CHANNEL=beta
# addons:
# apt:
# packages: *i686_unknown_linux_gnu

# Not testing on stable channel until proc_macro lands there in the next release.
# # Stable channel
# - os: osx
# env: TARGET=i686-apple-darwin CHANNEL=stable
# - os: linux
# env: TARGET=i686-unknown-linux-gnu CHANNEL=stable
# addons:
# apt:
# packages: &i686_unknown_linux_gnu
# - gcc-multilib
# - os: osx
# env: TARGET=x86_64-apple-darwin CHANNEL=stable
# - os: linux
# env: TARGET=x86_64-unknown-linux-gnu CHANNEL=stable
# addons:
# apt:
# packages:
# - nodejs
# - npm
# - os: linux
# env: TARGET=x86_64-unknown-linux-musl CHANNEL=stable

# Musl builds fail due to a bug in Rust (https://github.com/azerupi/mdBook/issues/158)
allow_failures:
- os: linux
Expand Down
14 changes: 12 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mdbook"
version = "0.0.15"
version = "0.0.16"
authors = ["Mathieu David <[email protected]>"]
description = "create books from markdown files (like Gitbook)"
documentation = "http://azerupi.github.io/mdBook/index.html"
Expand All @@ -9,21 +9,28 @@ keywords = ["book", "gitbook", "rustbook", "markdown"]
license = "MPL-2.0"
readme = "README.md"
build = "build.rs"
include = ["data"]
exclude = [
"book-example/*",
"src/theme/stylus",
"data/assets/_html-template/_stylus",
]


[dependencies]
clap = "2.19.2"
handlebars = { version = "0.23.0", features = ["serde_type"] }
serde = "0.8"
serde_derive = "0.8"
serde_json = "0.8"
pulldown-cmark = "0.0.8"
regex = "0.1"
glob = "0.2"
log = "0.3"
env_logger = "0.3"
toml = { version = "0.2", features = ["serde"] }
open = "1.1"
phf = "0.7"
includedir = "0.2"

# Watch feature
notify = { version = "3.0", optional = true }
Expand All @@ -35,6 +42,9 @@ iron = { version = "0.4", optional = true }
staticfile = { version = "0.3", optional = true }
ws = { version = "0.5.1", optional = true}

[build-dependencies]
includedir_codegen = "0.2"

# Tests
[dev-dependencies]
tempdir = "0.3.4"
Expand Down
12 changes: 7 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ environment:
global:
PROJECT_NAME: mdBook
matrix:
# Stable channel
- TARGET: i686-pc-windows-msvc
RUST_CHANNEL: stable
- TARGET: x86_64-pc-windows-msvc
RUST_CHANNEL: stable
# Beta channel
- TARGET: i686-pc-windows-msvc
RUST_CHANNEL: beta
Expand All @@ -18,6 +13,13 @@ environment:
- TARGET: x86_64-pc-windows-msvc
RUST_CHANNEL: nightly

# Not testing on stable channel until proc_macro lands there in the next release.
# # Stable channel
# - TARGET: i686-pc-windows-msvc
# RUST_CHANNEL: stable
# - TARGET: x86_64-pc-windows-msvc
# RUST_CHANNEL: stable

# Install Rust and Cargo
install:
- ps: Start-FileDownload "https://static.rust-lang.org/dist/channel-rust-stable"
Expand Down
142 changes: 142 additions & 0 deletions book-example/assets/_plantuml/structs-v0-0-15.pum
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
@startuml

class book::MDBook {
root
dest
src
theme_path
title
author
description
content : Vec<BookItem>
books : HashMap<&'a str, Book>
renderer
livereload
}

class book::book.Book {
metadata
frontmatter
mainmatter
backmatter

new(title)
}

class book::bookconfig.BookConfig {
root
dest
src
theme_path
title
author
description
indent_spaces
multilingual

new(root)
}

class book::chapter.Chapter {
title
file
author
description
index
class
sub_chapters

new(title, file)
}

namespace book::bookitem {

enum BookItem {
Chapter "String, Chapter"
Affix "Chapter"
Spacer
}

class BookItems {
items : &'a [BookItem]
current_index
stack : Vec<"&'a [BookItem], usize">
}

class Chapter {
name
path
sub_items

new(name, path)
}

}

namespace book::metadata {

class BookMetadata {
title
subtitle
description
publisher
language
authors
translators
number_format
section_names
new(title)
}

class Author {
name
email
new(name)
}

class Language {
name
code
}

class Publisher {
name
url
logo_src
}

enum NumberFormat {
Arabic
Roman
Word
}

}

class renderer::html_handlebars::HtmlHandlebars {
new()
render(book: MDBook)
}

class theme::Theme {
index
css
favicon
js
highlight_css
tomorrow_night_css
highlight_js
jquery
new(src)
}

book::book-[hidden]->book::bookconfig
book::book-[hidden]->book::chapter
book::book-[hidden]->book::bookitem
book::book-[hidden]->book::metadata

book::bookitem.BookItems-[hidden]->book::bookitem.BookItem

renderer::html_handlebars::HtmlHandlebars-[hidden]->theme::Theme

@enduml
Loading