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

Add the rust-wasm-book #12

Merged
merged 1 commit into from
Jan 31, 2018
Merged

Add the rust-wasm-book #12

merged 1 commit into from
Jan 31, 2018

Conversation

mgattozzi
Copy link
Contributor

This book seeks to aggregate various documents into one place making it
easy to display the documentation online much like we do with TRPL and
to make a central area for writing those documents.

This splits up the workflows.md file into a basic hello-world chapter,
a modified setup chapter, and then an actual workflows chapter that can
be worked on with things that are more like workflows than examples per
se.

Also included is a README on how to build the book and what the book is
about for those wishing to contribute to those docs.

@mgattozzi
Copy link
Contributor Author

cc/
@aturon for whether this seems reasonable
@steveklabnik for docs purposes what can be improved here etc.

@aturon
Copy link
Contributor

aturon commented Jan 14, 2018

I'd be delighted to get this organized as a growing book of resources! This looks like a good start in that direction.

I wonder whether the whole repository should just be the book, rather than separating that as a subdirectory. In particular, I was only ever imagining having md files in the repo anyway, and just hadn't put thought into overall organization.

So for example, the README could probably also be split up into book sections etc.

We'll also want to get it hosted somewhere, etc.

@mgattozzi
Copy link
Contributor Author

@aturon that seems fairly reasonable. mdbook would still need a src subdirectory anyways, but it could be nested one less level and be a top level directory. If this is more of an official Rust push then it would make sense to get it hosted on Rust's infrastructure. If not it should be easy to get this setup to push to something like github pages.

If you want to be able to use Rust for wasm then you need an environment to be able to do that! If
you haven't already you'll need to install [rustup][rustup] the official tool in order to install
and manage different versions of the Rust compiler. Follow the instructions on the site to get it
installed on your machine. Once that's installed you'll need to get the `wasm32-uknown-unkown`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Second should be unknown not unkown

@aturon
Copy link
Contributor

aturon commented Jan 16, 2018

@mgattozzi Let's put it up on github pages for now. This will probably eventually head to the nursery, but I don't think we're there yet.

Want to make the updates to the PR?

@mgattozzi
Copy link
Contributor Author

@aturon sounds good! I'll get a TravisCI build running as well so it can push it automagically.

@aturon
Copy link
Contributor

aturon commented Jan 19, 2018

ping on this?

@mgattozzi
Copy link
Contributor Author

@aturon was busy this week with some other things (related to Rust that I can't talk about)/in the process of building a new desktop so I can work at home on this kind of stuff. I'll take a look at it tonight. Shouldn't be too hard to get this working.

To clarify we wanted this on the top level right rather than a subdirectory?

@aturon
Copy link
Contributor

aturon commented Jan 19, 2018

To clarify we wanted this on the top level right rather than a subdirectory?

Yep! Let's basically turn the whole repo into a loose "book" that we'll organize organically over time.

@mgattozzi
Copy link
Contributor Author

@aturon I've rebased and pushed a newer version. We'll still need to set up travis with the GH Token as well but I think this should do it!

@mgattozzi
Copy link
Contributor Author

Ping @aturon I don't think I have the permissions level to set this up fully (like getting a GH Token for the repo). I'll probably need your help for the last bit.

@aturon
Copy link
Contributor

aturon commented Jan 27, 2018

@mgattozzi I went a step further and transferred this to the nursery, and made you (and others) full admins.

We should get it hooked into the hosting for the nursery. Not sure what's needed for that. @alexcrichton?

@aturon
Copy link
Contributor

aturon commented Jan 27, 2018

@mgattozzi Looks like you should be able to follow the pattern in the API Guidelines and Cookbook:

@mgattozzi
Copy link
Contributor Author

Hey @aturon good to know. I'll copy it over and then we can do a final check then push it!

@alexcrichton
Copy link
Contributor

I've enabled Travis for this repo and kicked it as well, I think that should do it when you're ready!

@mgattozzi
Copy link
Contributor Author

@aturon and @alexcrichton I updated the scripts but I had no idea what email to use so I just put wasm@rust-lang.org in the deploy script. Let me know if anything needs to get changed. I'll keep a check on the CI and fix any issues that come up in the meantime

@aturon
Copy link
Contributor

aturon commented Jan 31, 2018

@mgattozzi Thanks! I added that email alias to send to you, me and @alexcrichton for now.

Looks like the build is failing though.

@mgattozzi
Copy link
Contributor Author

Hey @aturon looks like I removed language: rust from the script. I readded it so we should be good. I think we can do a squash and merge once this is good to go.

@aturon
Copy link
Contributor

aturon commented Jan 31, 2018

Still failing.

@mgattozzi
Copy link
Contributor Author

TDD: Travis Driven Development

But on a serious note I think this should work now. The problem was there was a cache for cargo. This included installs. I removed it but added the force flag as a "just in case" failsafe for mdbook.

@mgattozzi
Copy link
Contributor Author

lol now it's trying to build a rust project hold on. Again. -_-

@mgattozzi
Copy link
Contributor Author

Ah I need to make the token for this repo I think.

@mgattozzi
Copy link
Contributor Author

Okay this is getting annoying. Apparently whatever I'm doing is not setting the token correctly. Going to try a few more things.

@mgattozzi
Copy link
Contributor Author

Okay that build is going to fail. Need to figure out why. The token I'm using works when tested locally.

@mgattozzi
Copy link
Contributor Author

Ugh that's not right either even though it'll be green.

@mgattozzi
Copy link
Contributor Author

I encrypted the variable as GH_PAGES not GH_TOKEN. This should do it.

@mgattozzi
Copy link
Contributor Author

mgattozzi commented Jan 31, 2018

Alright I'm at a loss as to why the token isn't set properly

Using the travis ruby gem I ran:

travis encrypt -a env.global -r rust-lang-nursery/rust-wasm GH_TOKEN="actual token here"

Which added it to the file but travis can't find it for whatever reason when building.

.travis.yml Outdated
- stable
os:
- linux
- osx
Copy link
Contributor

Choose a reason for hiding this comment

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

You can probably delete this as I don't think this'll need to be run on both OSX and Linux, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. this was copied over from the rust cook book. They're doing some compilation of actual rust code and probably needed this

@mgattozzi
Copy link
Contributor Author

Eyyyy a new error message. Okay looks like I need to put in the token correctly.

@mgattozzi
Copy link
Contributor Author

I've directly set the token in the dashboard and used Travis' deploy to gh-pages service. Let's see if this is the one that works.

This book seeks to aggregate various documents into one place making it
easy to display the documentation online much like we do with TRPL and
to make a central area for writing those documents.

This splits up the `workflows.md` file into a basic hello-world chapter,
a modified setup chapter, and then an actual workflows chapter that can
be worked on with things that are more like workflows than examples per
se.

The README has been update on how to build the book and what the book is
about for those wishing to contribute to those docs.
@mgattozzi
Copy link
Contributor Author

@aturon and @alexcrichton I added the token used in the travis.yml file to the settings here. This is based off the following docs. I think this should be sufficient to get this merged although the deploy isn't shown as this is not the master branch. If this doesn't work we can open up a new PR to fix it up. I've also rebased and squashed the commits for the branch.

@alexcrichton alexcrichton merged commit e27eef5 into rustwasm:master Jan 31, 2018
@alexcrichton
Copy link
Contributor

Ok!

@aturon
Copy link
Contributor

aturon commented Jan 31, 2018

Are there additional steps we need for the actual publication? I'm not seeing it at https://rust-lang-nursery.github.io/rust-wasm/

@steveklabnik
Copy link
Contributor

I didn't dig into it, but there's no gh-pages branch, and so the site isn't gonna appear.

@mgattozzi
Copy link
Contributor Author

Hmmm. Alright I can create and manually deploy it for now.

@alexcrichton
Copy link
Contributor

Er wait hang on, I think I may have found something

@mgattozzi
Copy link
Contributor Author

Nice

@alexcrichton
Copy link
Contributor

https://rust-lang-nursery.github.io/rust-wasm/

Indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants