Skip to content

Commit

Permalink
adds reference
Browse files Browse the repository at this point in the history
  • Loading branch information
damirka committed Mar 26, 2024
1 parent 65f9db1 commit dfc8922
Show file tree
Hide file tree
Showing 37 changed files with 6,739 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# The Move Book

This is the repository for [the Move Book](https://move-book.com).
This is the repository for [the Move Book](https://move-book.com) and [Move Language Reference](https://move-book.com/reference).

## Structure

- Two books are placed in the `book` and `reference` directories. The `book` directory contains the main book, and the `reference` directory contains the reference book.

- The `theme` directory is linked to both books and contains the theme files, fonts and styles.

- The `packages` directory contains the code samples used in both books.

## Archive

Expand Down
2 changes: 2 additions & 0 deletions reference/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/book
/build
38 changes: 38 additions & 0 deletions reference/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
id: move-book
title: Move Book
custom_edit_url: https://github.com/move-language/move/edit/main/language/documentation/book/README.md
---

In order to update the Move book and preview changes to it you'll need to
install
[`mdbook`](https://rust-lang.github.io/mdBook/guide/installation.html). You
can do this via `cargo install mdbook`.

After installing mdbook, you can preview changes via either `mdbook serve`,
or if you want the output to change as you make changes to the book you can
use `mdbook watch`. More information on options can be found at the [mdbook
website](https://rust-lang.github.io/mdBook/).

Once you are happy with your changes to the Move book, you can create a PR to
update the Move book website. This is the process that has been used in
the past and is known to work, but there may be a better way:

1. Run `mdbook build` in this directory. This will create a directory
called `book`. Copy this to some location `L` outside of the Move git tree.

2. Make sure your upstream is up-to-date and checkout to `upstream/gh-pages`.

3. Once you have checked out to `upstream/gh-pages`, make sure you are at the
root of the repo. You should see a number of `.html` files. You can now
move all contents in `L` to this location: `mv L/* .`

4. Once this is done inspect things to make sure the book looks the way you
want. If everything looks good submit a PR to the **`gh-pages`** branch of the
main Move repo.

After this the normal PR process is followed. Once the PR has been accepted and
lands the updated Move book should be visible immediately.

**NB:** When adding a new (sub)section to the book you _must_ include the new
file in the `SUMMARY.md` file otherwise it will not appear in the updated book.
10 changes: 10 additions & 0 deletions reference/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TODO

## Long term

- Grammar examples aren't readable
- We don't describe the associativity of conditionals or other control flow constructions and {}
- We don't describe identifier rules in a single place
- We don't describe rules for namespaces and uses
- attributes/annotations in general
- describe paths/places more like the compiler thinks about them in 2024
17 changes: 17 additions & 0 deletions reference/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[book]
title = "The Move Book"
description = "Move book maintained by the Move core team."
authors = ["The Move Contributors"]
language = "en"
multilingual = false
src = "src"

[build]
build-dir = "build"
extra-watch-dirs = ["../packages"] # rebuild on Move Source changes

[output.html]
additional-css = ["theme/css/custom.css"]
git-repository-url = "https://github.com/MystenLabs/move-book"
git-repository-icon = "fa-github"
edit-url-template = "https://github.com/move-language/move/edit/main/language/documentation/book/{path}"
48 changes: 48 additions & 0 deletions reference/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# The Move Programming Language

[Introduction](introduction.md)

# Getting Started

- [Modules](modules.md)

# Basic Concepts

- [Primitive Types](primitive-types.md)
- [Integers](primitive-types/integers.md)
- [Bool](primitive-types/bool.md)
- [Address](primitive-types/address.md)
- [Vector](primitive-types/vector.md)
- [References](primitive-types/references.md)
- [Tuples and Unit](primitive-types/tuples.md)
- [Local Variables and Scopes](variables.md)
- [Equality](equality.md)
- [Abort and Assert](abort-and-assert.md)
- [Control Flow](control-flow.md)
- [Conditional Expressions](control-flow/conditionals.md)
- [Loops](control-flow/loops.md)
- [Labeled Control FLow](control-flow/labeled-control-flow.md)
- [Functions](functions.md)
- [Structs](structs.md)
- [Constants](constants.md)
- [Generics](generics.md)
- [Type Abilities](abilities.md)
- [Uses and Aliases](uses.md)

# Advanced Concepts

- [Method Syntax](method-syntax.md)
- [Index Syntax Methods](index-syntax.md)

# Tooling

- [Packages](packages.md)
- [Unit Tests](unit-testing.md)

# Reference

- [Coding Conventions](coding-conventions.md)

# Deprecated

- [Friends](friends.md)
Loading

0 comments on commit dfc8922

Please sign in to comment.