-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(book): adding help and contributing pages
- Loading branch information
Showing
8 changed files
with
172 additions
and
106 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
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,32 @@ | ||
# Contributing | ||
|
||
If you are considering to contribute to Logos, then this place it for you! | ||
|
||
First, we really appreciate people that can help this project grow, and we | ||
would like to guide you through the standard contribution process. | ||
|
||
There are many ways to help us, and here is a short list of some of them: | ||
|
||
+ fixing an [BUG](/~https://github.com/maciejhirsz/logos/labels/bug), by providing | ||
a patch (or suggesting in the comments how one could fix it); | ||
+ correcting some typos in the documentation, the book, or anywhere else; | ||
+ raising an issue about a problem (i.e., | ||
[opening an issue](/~https://github.com/maciejhirsz/logos/issues/new) on GitHub); | ||
+ proposing new features (either with | ||
[an issue](/~https://github.com/maciejhirsz/logos/issues/new) or | ||
[a pull request](/~https://github.com/maciejhirsz/logos/pulls) on GitHub); | ||
+ or improving the documentation (either in the crate or in the book). | ||
|
||
In any case, GitHub is the place-to-go for anything related to contributing. | ||
|
||
Below, we provide a few help pages (or links) to contents that can help you | ||
understand Logos' internals and how you can create submit a contribution. | ||
|
||
+ If you are new to GitHub or git, please consider reading those two guides: | ||
+ [GitHub’s Hello World](https://docs.github.com/en/get-started/quickstart/hello-world); | ||
+ and [GitHub Pull Request in 100 Seconds](https://www.youtube.com/watch?v=8lGpZkjnkt4&ab_channel=Fireship) | ||
(video). | ||
+ To setup and test your code locally, see the [Setup](./contributing/setup.md) | ||
page. | ||
+ To know a bit more how Logos works, check the | ||
[Internals](./contributing/internals.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,4 @@ | ||
# Internals | ||
|
||
TODO: explaing the utility of each crate in the repository, | ||
and also how Logos creates lookup tables... |
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,103 @@ | ||
# Setup | ||
|
||
On this page, you will find all the information needed to run and test your | ||
own version of the Logos crate, locally. | ||
|
||
We assume you have basic knowledge with git and GitHub. If that is not the | ||
case, please refer to the link mentionned in [Contributing](./contributing.md). | ||
|
||
## Prerequisites | ||
|
||
You need to have both git and Rust installed on your computer, | ||
see intallation procedures: | ||
|
||
+ for [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git); | ||
+ and [Rust](https://www.rust-lang.org/tools/install). | ||
|
||
Once it's done, clone the Logos repository on your computer: | ||
|
||
```bash | ||
git clone /~https://github.com/maciejhirsz/logos.git | ||
``` | ||
|
||
If you have a fork of this repository, make sure to clone it instead. | ||
|
||
Finally, launch a terminal (i.e., command-line) session and go to the | ||
`logos` directory. | ||
|
||
## Checking the code compiles | ||
|
||
A good way to see if you code can compile is to use the eponym command: | ||
|
||
```bash | ||
cargo check | ||
``` | ||
|
||
## Formatting and linting your code | ||
|
||
Prior to suggesting changes in a pull request, it is important to both | ||
format your code: | ||
|
||
```bash | ||
cargo fmt | ||
``` | ||
|
||
and check against Rust's linter: | ||
|
||
```bash | ||
cargo clippy | ||
``` | ||
|
||
Make sure to run those frequently, otherwise your pull request will probably | ||
fail to pass the automated tests. | ||
|
||
## Testing your code | ||
|
||
A code that compiles isn't necessarily correct, and testing it against known | ||
cases is of good practice: | ||
|
||
```bash | ||
cargo test | ||
``` | ||
|
||
## Building the documentation | ||
|
||
Logos' documentation needs to be built with Rust's nightly toolchain. | ||
|
||
You can install the latest nightly channel with: | ||
|
||
```bash | ||
rustup install nightly | ||
``` | ||
|
||
Then, use the following command to build the documentation with a similar | ||
configuration to the one used by [docs.rs](https://docs.rs/logos/latest/logos/): | ||
|
||
```bash | ||
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc \ | ||
--all-features \ | ||
-Zunstable-options \ | ||
-Zrustdoc-scrape-examples \ | ||
--no-deps \ | ||
--open \ | ||
``` | ||
|
||
|
||
## Building the book | ||
|
||
Logos' book can be built with mbBook. | ||
|
||
This tool can be installed with `cargo`: | ||
|
||
```bash | ||
cargo install mdbook | ||
``` | ||
|
||
Then, you can build the book with: | ||
|
||
```bash | ||
mbook serve book --open | ||
``` | ||
|
||
Any change in the `./book` folder will automatically trigger a new build, | ||
and the pages will be live-reloaded. |
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 @@ | ||
# Getting Help | ||
|
||
If you need help using Logos, there are three places you can go to depending | ||
on what you are looking for: | ||
|
||
+ [this book](./) for a documented walk through Logo's usage, with detailed | ||
examples, and more. A **must read** for any newcomer; | ||
+ [the API documentation](https://docs.rs/logos/latest/logos/) to obtain precise | ||
information about function signatures and what the Logos crate exposes in | ||
terms of features; | ||
+ and [GitHub issues](/~https://github.com/maciejhirsz/logos/issues) for anything | ||
else that is not covered by any of the two above. | ||
|
||
Regarding [GitHub issues](/~https://github.com/maciejhirsz/logos/issues), | ||
it's highly recommended to first check if another issue, either open or closed, | ||
already covers the topic you are looking for. If not, then consider creating a | ||
new issue with necessary information about your question, problem or else. |
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