Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
03af81f
Initialize repository
gitbook-bot Nov 27, 2019
1b375da
GitBook: [master] 17 pages and one asset modified
jstarry Nov 27, 2019
854f5f5
GitBook: [master] one page modified
jstarry Nov 28, 2019
fb8901f
GitBook: [master] one page modified
jstarry Nov 28, 2019
9112234
GitBook: [master] 2 pages modified
jstarry Nov 28, 2019
c3efe1a
GitBook: [master] 7 pages modified
jstarry Nov 28, 2019
3bb9565
GitBook: [master] one page modified
jstarry Nov 28, 2019
e78089f
GitBook: [master] 2 pages modified
jstarry Nov 28, 2019
929d4e9
GitBook: [master] one page modified
jstarry Nov 28, 2019
1eaf0c8
GitBook: [master] 2 pages modified
jstarry Nov 28, 2019
686f4df
GitBook: [master] one page modified
jstarry Nov 28, 2019
a802a79
GitBook: [master] one page modified
jstarry Nov 28, 2019
c79d895
GitBook: [master] one page modified
jstarry Nov 29, 2019
067d281
Create LICENSE
jstarry Dec 1, 2019
ce9a4bf
Changed 'Model' to 'App' (#1)
danbugs Dec 1, 2019
87d231a
Gitbook: [master] one page modified (#2)
jakequade Dec 1, 2019
590b547
GitBook: [master] 2 pages modified
Ticsmtc Dec 1, 2019
f751f81
GitBook: [master] 2 pages modified
jstarry Dec 2, 2019
bd84cc4
GitBook: [master] one page modified
jstarry Dec 2, 2019
5dad9d4
GitBook: [master] one page modified
jstarry Dec 2, 2019
5ef2502
GitBook: [master] one page modified
jstarry Dec 2, 2019
ee9364b
GitBook: [master] one page modified
jstarry Dec 2, 2019
b9c3e3f
GitBook: [master] one page modified
jstarry Dec 2, 2019
7d91013
GitBook: [master] one page modified
jstarry Dec 2, 2019
d3d9b1e
GitBook: [master] one page modified
jstarry Dec 2, 2019
0b45ba4
GitBook: [master] one page modified
jstarry Dec 2, 2019
8e8ba82
GitBook: [master] 39 pages modified
jstarry Dec 2, 2019
a946404
GitBook: [master] one page modified
jstarry Dec 2, 2019
f45bf32
GitBook: [master] 4 pages modified
jstarry Dec 2, 2019
ffc9fce
GitBook: [master] 31 pages modified
jstarry Dec 2, 2019
6e28235
building instructions
jstarry Dec 7, 2019
ac701a2
GitBook: [master] one page and one asset modified
jstarry Dec 7, 2019
a5fdbf0
GitBook: [master] one page modified
jstarry Dec 7, 2019
0c2c863
Add a link to the Yew Router docs. (#11)
thedodd Dec 17, 2019
d2b33f0
Update docs to yew v0.11
jstarry Jan 6, 2020
5b9b050
Fix router page
jstarry Jan 6, 2020
c5f75c3
GitBook: [master] 2 pages modified
jstarry Jan 6, 2020
6a62cca
GitBook: [master] one page modified
jstarry Jan 6, 2020
d156979
GitBook: [master] 2 pages modified
jstarry Jan 6, 2020
83c50c8
GitBook: [master] 3 pages modified
jstarry Jan 6, 2020
075aa49
GitBook: [master] one page modified
jstarry Jan 6, 2020
a585bff
GitBook: [master] 2 pages modified
jstarry Jan 6, 2020
74b8c1f
GitBook: [master] 6 pages modified
jstarry Jan 6, 2020
2162252
GitBook: [master] one page modified
jstarry Jan 9, 2020
5eea83c
Fix typo in port number (#17)
RAOF Jan 11, 2020
bc040e4
Change 'Model' to 'App' in sample app description. (#18)
samuelvanderwaal Jan 15, 2020
5182c33
Typo: s/you/your/ (#19)
oylenshpeegul Jan 18, 2020
4a43e22
GitBook: [master] one page modified
jstarry Jan 25, 2020
ffba8b6
Rust Most Loved Language Four Years in a Row (#20)
samuelvanderwaal Jan 31, 2020
786b4e7
GitBook: [master] one page modified
jstarry Feb 9, 2020
2822472
GitBook: [master] 2 pages modified
jstarry Feb 9, 2020
c07adb1
GitBook: [master] 2 pages modified
jstarry Feb 9, 2020
1f465cf
GitBook: [master] 18 pages modified
jstarry Feb 9, 2020
a70817c
Fix broken crates.io link (#28)
elertan Feb 26, 2020
e48421a
Remove redundant gitbook asset
jstarry Feb 27, 2020
d1f4f04
docs: fixed typos (#29)
twchn Feb 27, 2020
37c24db
docs: delete unused documents (#31)
twchn Feb 28, 2020
46dc48e
GitBook: [master] 3 pages modified
jstarry Mar 2, 2020
ec48b42
GitBook: [master] 12 pages modified
jstarry Mar 2, 2020
01f0098
Fix formatting
jstarry Mar 2, 2020
310294a
GitBook: [master] one page modified
jstarry Mar 2, 2020
a9b2243
GitBook: [master] one page modified
jstarry Mar 2, 2020
ab46d1b
GitBook: [master] one page modified
jstarry Mar 2, 2020
edba34f
Fix sample app toml
jstarry Mar 3, 2020
1d1eb7f
Update links for `todomvc` and `multi_thread` (#37)
Type1J Mar 4, 2020
dcccea4
docs: fixed typos (#38)
jstarry Mar 5, 2020
d492982
GitBook: [master] 2 pages modified
jstarry Mar 6, 2020
01cc404
GitBook: [master] one page modified
jstarry Mar 7, 2020
6b34dae
style: fixed some formats (#44)
twchn Mar 8, 2020
31e52d4
Update the Properties Documentation for 0.13 (#45)
mrh0057 Mar 10, 2020
83eeb18
style: fixed some formats (#48)
twchn Mar 12, 2020
f84749b
GitBook: [master] 4 pages modified
jstarry Mar 14, 2020
f8e183c
GitBook: [master] one page modified
jstarry Mar 14, 2020
2069cd1
GitBook: [master] 2 pages modified
t7yang Apr 13, 2020
d2e8042
Added additional references for docs on agents. (#52)
teymour-aldridge Apr 14, 2020
4eb7413
Revert "GitBook: [master] 2 pages modified"
jstarry Apr 14, 2020
760072e
Add agent lifecycle diagram. (#54)
teymour-aldridge Apr 14, 2020
fd694e3
Add doctests. (#55)
teymour-aldridge Apr 19, 2020
f9ed6f7
GitBook: [master] one page modified
lili668668 Apr 19, 2020
69a2c3d
Update getting started example to 0.14.3 (#58)
jgpaiva Apr 20, 2020
7f796db
Update examples.md (#59)
jakeols Apr 22, 2020
aeb5eaa
link bincode project in agents docs (#62)
Felk Apr 29, 2020
6d41663
Update examples to 0.15.0 (#61)
marcelbuesing Apr 29, 2020
840e14b
Added note on clone trait bound. (#69)
teymour-aldridge May 2, 2020
89b07fa
Add reference to wasm_bindgen_test (#73)
teymour-aldridge May 2, 2020
3893e1d
Size optimization info (#64)
fbucek May 2, 2020
7aee295
GitBook: [master] 7 pages modified
jstarry May 3, 2020
6d5e9fc
Fix tests (#78)
jstarry May 3, 2020
c83e837
Made explanations clearer. (#68)
teymour-aldridge May 3, 2020
d11c4fc
Rename 'parcel' to 'further reading' (#77)
teymour-aldridge May 3, 2020
d429698
GitBook: [master] 2 pages modified
jstarry May 3, 2020
befa17e
Added code examples for the router docs. (#67)
teymour-aldridge May 5, 2020
1a7d5b8
GitBook: [master] 3 pages modified
jstarry May 5, 2020
00712bf
GitBook: [master] one page modified
jstarry May 6, 2020
a839251
Update the sample doc app to use wasm-pack (#75)
D4nte May 7, 2020
dbb40d9
Fixed bad link to build script for wasm-bindgen/cargo-web (#81)
ETCaton May 7, 2020
8fcd3ae
Update miniserve cargo install command (#88)
drpoggi May 10, 2020
dcc66a4
Added missing "d" in "bindgen" (#91)
AntBlo May 13, 2020
16eb56c
create as lib right away (#93)
May 14, 2020
bc8a896
updated (#92)
May 14, 2020
2a111b9
GitBook: [master] 29 pages modified
lili668668 May 17, 2020
a874379
GitBook: [master] 29 pages modified
lili668668 May 17, 2020
fce3040
GitBook: [master] 29 pages modified
lili668668 May 17, 2020
a57370b
GitBook: [master] one page modified
jstarry May 26, 2020
44c7fd4
update the docs to specify that local agents do not incur serializati…
mkawalec May 26, 2020
5d2e035
Add a note telling how to bypass the recursion limit of the html! mac…
codec-abc May 26, 2020
9594b47
Add latest Stack Overflow survey results (#95)
amorriscode May 28, 2020
f9b776c
Mention prop_or macro (#97)
zoechi Jun 8, 2020
d1e36f8
Fix a typo. (#102)
teymour-aldridge Jun 20, 2020
0ed66e3
Point to master branch for examples (#98)
darrenmeehan Jun 20, 2020
3208a4b
Add code of conduct to documentation as well. (#104)
teymour-aldridge Jun 22, 2020
b183dc1
Added "" for the version at line 25 (#107)
nougator Jun 24, 2020
201bb03
Removed periods and fixed spelling mistakes (#103)
dirkpuge Jun 26, 2020
b888b89
Shorten line lengths. (#106)
teymour-aldridge Jun 26, 2020
044ed79
bumping up the yew version in Cargo.toml (#107) (#109)
hituzi-no-sippo Jun 26, 2020
a30f56a
Add #[derive(Clone)] in examples (#111)
Mingun Jun 28, 2020
2bdbafc
Fix typo (#112)
FIGBERT Jul 2, 2020
563216a
GitBook: [master] 29 pages modified
jstarry Jul 5, 2020
b7b5ab9
Merge remote-tracking branch 'docs/master' into merge-documentation
teymour-aldridge Jul 8, 2020
6feef86
Update the doctest Github action.
teymour-aldridge Jul 8, 2020
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
1 change: 1 addition & 0 deletions .gitbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root: ./docs/src
27 changes: 27 additions & 0 deletions .github/workflows/doctests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Documentation tests
on:
push:
paths:
- "docs/**/*"
pull_request:
paths:
- "docs/**/*"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Run tests
run: cd docs && cargo test
check-spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check spelling
run: bash ci/spellcheck.sh list
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ orig.*
/.idea
/.vscode
/cmake-build-debug
/docs/target
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ members = [
"examples/two_apps",
"examples/webgl",
]
exclude=["docs"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ Support this project with your organization. Your logo will show up here with a
<a href="https://opencollective.com/yew/organization/6/website"><img src="https://opencollective.com/yew/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/yew/organization/7/website"><img src="https://opencollective.com/yew/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/yew/organization/8/website"><img src="https://opencollective.com/yew/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/yew/organization/9/website"><img src="https://opencollective.com/yew/organization/9/avatar.svg"></a>
<a href="https://opencollective.com/yew/organization/9/website"><img src="https://opencollective.com/yew/organization/9/avatar.svg"></a>
17 changes: 17 additions & 0 deletions ci/dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
personal_ws-1.1 en 0 utf-8
APIs
bindgen
interoperable
interoperability
libs
Libs
minimising
Optimisations
roadmap
README
stdweb
html
Roadmap
wasm
Wasm
WebAssembly
101 changes: 101 additions & 0 deletions ci/spellcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash

aspell --version

# Taken from the Rust Book (https://github.com/rust-lang/book/)

# Checks project Markdown files for spelling mistakes.

# Notes:

# This script needs dictionary file ($dict_filename) with project-specific
# valid words. If this file is missing, first invocation of a script generates
# a file of words considered typos at the moment. User should remove real typos
# from this file and leave only valid words. When script generates false
# positive after source modification, new valid word should be added
# to dictionary file.

# Default mode of this script is interactive. Each source file is scanned for
# typos. aspell opens window, suggesting fixes for each found typo. Original
# files with errors will be backed up to files with format "filename.md.bak".

# When running in CI, this script should be run in "list" mode (pass "list"
# as first argument). In this mode script scans all files and reports found
# errors. Exit code in this case depends on scan result:
# 1 if any errors found,
# 0 if all is clear.

# Script skips words with length less than or equal to 3. This helps to avoid
# some false positives.

# We can consider skipping source code in markdown files (```code```) to reduce
# rate of false positives, but then we lose ability to detect typos in code
# comments/strings etc.

shopt -s nullglob

dict_filename=./ci/dictionary.txt
markdown_sources=(./docs/**/*.md)
mode="check"

# aspell repeatedly modifies the personal dictionary for some reason,
# so we should use a copy of our dictionary.
dict_path="/tmp/dictionary.txt"

if [[ "$1" == "list" ]]; then
mode="list"
fi

# Error if running in list (CI) mode and there isn't a dictionary file;
# creating one in CI won't do any good :(
if [[ "$mode" == "list" && ! -f "$dict_filename" ]]; then
echo "No dictionary file found! A dictionary file is required in CI!"
exit 1
fi

if [[ ! -f "$dict_filename" ]]; then
# Pre-check mode: generates dictionary of words aspell consider typos.
# After user validates that this file contains only valid words, we can
# look for typos using this dictionary and some default aspell dictionary.
echo "Scanning files to generate dictionary file '$dict_filename'."
echo "Please check that it doesn't contain any misspellings."

echo "personal_ws-1.1 en 0 utf-8" > "$dict_filename"
cat "${markdown_sources[@]}" | aspell --ignore 3 list | sort -u >> "$dict_filename"
elif [[ "$mode" == "list" ]]; then
# List (default) mode: scan all files, report errors.
declare -i retval=0

cp "$dict_filename" "$dict_path"

if [ ! -f $dict_path ]; then
retval=1
exit "$retval"
fi

for fname in "${markdown_sources[@]}"; do
command=$(aspell --ignore 3 --personal="$dict_path" "$mode" < "$fname")
if [[ -n "$command" ]]; then
for error in $command; do
# FIXME: find more correct way to get line number
# (ideally from aspell). Now it can make some false positives,
# because it is just a grep.
grep --with-filename --line-number --color=always "$error" "$fname"
done
retval=1
fi
done
exit "$retval"
elif [[ "$mode" == "check" ]]; then
# Interactive mode: fix typos.
cp "$dict_filename" "$dict_path"

if [ ! -f $dict_path ]; then
retval=1
exit "$retval"
fi

for fname in "${markdown_sources[@]}"; do
aspell --ignore 3 --dont-backup --personal="$dict_path" "$mode" "$fname"
done
fi
12 changes: 12 additions & 0 deletions docs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "docs"
version = "0.1.0"
authors = ["Yew Maintainers <maintainers@yew.rs>"]
edition = "2018"

[dependencies]
doc-comment = "0.3.3"
wasm-bindgen = "0.2"
wasm-bindgen-test = "0.3.0"
wee_alloc = "0.4"
yew = { version = "0.16.0", features = ["wasm_test"] }
121 changes: 121 additions & 0 deletions docs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
Creative Commons Legal Code

CC0 1.0 Universal

CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.

For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:

i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.

2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.

3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.

4. Limitations and Disclaimers.

a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
54 changes: 54 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributing to the documentation
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jstarry Just a note that I've added some contributing guidelines here.


Firstly, thanks for considering contributing to Yew. We're a friendly community of humans who
collaborate to build (hopefully) awesome software. We try to write software which is easy to use so
we ask that you follow a few guidelines when contributing – these are laid out in this document.

Note that this document is about *contributing documentation* not contributing code and only
applies to the contents of the `docs` folder – not any other parts of the project.

## Can I just submit a PR or do I need to create an issue first?

PRs not attached to previously created issues are welcome *if* they're a small change. This could
be something like fixing a small grammar mistake or a typo.

If your PR is something bigger create an issue beforehand. This will save everyone time and effort:

1. Multiple people don't end up submitting duplicate PRs doing the same thing.
2. People have a chance to submit feedback on an idea *before* someone does a lot of work on it.
3. It's easy to track progress on the development of the documentation.

## Spelling and grammar

We recognise that not everyone who contributes to Yew will have "perfect" grammar or be a native
English speaker. We're all human; everyone makes mistakes and nobody will look down on you if you
make typos or grammar mistakes (we'll just fix them, merge PRs and move on with life).

To help catch spelling mistakes, we use a spellchecking script which originally came from the Rust
Book. If it picks up a spelling "mistake" which isn't actually a mistake, then please add it to the
list in `ci/dictionary.txt` (in alphabetically sorted order).

If in doubt about spelling, grammar or style you might find it useful to consult the
[Microsoft Style Guide](https://docs.microsoft.com/style-guide/) which we sometimes use as a handy
reference.

## Line wrap
Having really long lines makes it hard to review code and see differences between versions. To
solve this problem all lines should be wrapped at 100 characters.

## Building the book locally

Note that Yew uses Gitbook which renders differently from mdbook. However the latest Gitbook is
not compatible with gitbook-cli :(

### Install mdbook:

```bash
$ cargo install mdbook
```

### Render and view the book:

```bash
$ mdbook serve
```
21 changes: 21 additions & 0 deletions docs/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use std::env;
use std::error::Error;
use std::fs;
use std::path::Path;

fn main() -> Result<(), Box<dyn Error>> {
let out_dir = env::var_os("OUT_DIR").unwrap();
let src_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("src");
let out_path = Path::new(&out_dir);

let original_path = src_path.join("getting-started/build-a-sample-app.md");
let original_str = fs::read_to_string(original_path)?.replace("fn main", "fn _main");
let sanitized_path = out_path.join("getting-started/build-a-sample-app.md");
let _ignore = fs::create_dir(&out_path.join("getting-started"));
fs::write(sanitized_path, original_str)?;

println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=src/getting-started-build-a-simple-app.md");

Ok(())
}
7 changes: 7 additions & 0 deletions docs/src/.gitbook/assets/yew.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading