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

The book should use the inclusion syntax for its examples #714

Open
torkleyy opened this Issue May 14, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@torkleyy
Member

torkleyy commented May 14, 2018

We can use

{{#include file.rs:2:10}}

to include the code from our examples in the book, so we don't need to duplicate everything.

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh May 14, 2018

Member

Ah, cool. Sounds excellent, then we get testing on it aswell.

Member

Rhuagh commented May 14, 2018

Ah, cool. Sounds excellent, then we get testing on it aswell.

@torkleyy torkleyy added the diff: easy label May 14, 2018

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe May 17, 2018

Member

I'm not sure including arbitrary line numbers is a good idea. It's really easy to have these offset by simple PR changes such as formatting or otherwise. It could become so difficult to maintain correctly that duplication might be preferable.

Member

Xaeroxe commented May 17, 2018

I'm not sure including arbitrary line numbers is a good idea. It's really easy to have these offset by simple PR changes such as formatting or otherwise. It could become so difficult to maintain correctly that duplication might be preferable.

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy May 17, 2018

Member

@Xaeroxe Yeah, I realized that, too.

Member

torkleyy commented May 17, 2018

@Xaeroxe Yeah, I realized that, too.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe May 17, 2018

Member

So, after having realized that do you still feel this is a good solution?

Member

Xaeroxe commented May 17, 2018

So, after having realized that do you still feel this is a good solution?

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy May 17, 2018

Member

At least for the complete examples where we don't need lines, this does makes sense.

Member

torkleyy commented May 17, 2018

At least for the complete examples where we don't need lines, this does makes sense.

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy May 17, 2018

Member

Like I think every pong chapter has them at the end, so we can do it for those.

Member

torkleyy commented May 17, 2018

Like I think every pong chapter has them at the end, so we can do it for those.

@Moxinilian

This comment has been minimized.

Show comment
Hide comment
@Moxinilian

Moxinilian Jun 26, 2018

Contributor

I'm not sure this is a good idea either. The representation in the repo always contains additional details to make it work in the context of the repo, most notably the assets path. Those details don't belong in the book.

Contributor

Moxinilian commented Jun 26, 2018

I'm not sure this is a good idea either. The representation in the repo always contains additional details to make it work in the context of the repo, most notably the assets path. Those details don't belong in the book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment