-
Notifications
You must be signed in to change notification settings - Fork 106
Tut-powered blog #119
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
Tut-powered blog #119
Conversation
Review by @tpolecat who should prepare himself with his bucket first. I have a suspicion that my code is too sloppy for him. |
Hm is there a reason why you removed the |
Did I? I have no idea what that modifier does. On 3 October 2016 20:46:38 CEST, Adelbert Chang notifications@github.com wrote:
|
Oh right because you only have the compiled file. I'll PR against your branch the original tut file I have. EDIT Here you go: https://github.com/larsrh/typelevel.github.com/pull/1 |
This looks good to me. I wonder if it should just be folded into tut. It's a distinct use-case but not uncommon, it turns out. Maybe see how it works out here first. As an optimization I think you can safely do up-to-date checks on output files since your dependencies are all binaries. |
There are two possible approaches for folding it into tut:
Sounds like a good idea.
Could you explain that? I don't understand what that means. |
// match expected type cats.Functor[F] | ||
// def callBar[F[_]: Monad: Traverse]: F[Int] = bar[F] | ||
// ^ | ||
scala> def callBar[F[_]: Monad: Traverse]: F[Int] = bar[F] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect the compiled (from tut
) code to be part of commits? For instance the tut
file changed after https://github.com/larsrh/typelevel.github.com/pull/1 but the corresponding post does not reflect that (there should be no difference between what's currently in master and what is generated from the tut
I PR'd).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the expectation in the current setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I wonder if it's possible to do this through CI. Not sure how that would work though since the file would be created as part of the CI process and then somehow added to the commit.
On a related note, this file needs to be re-generated then since it's not the same if you generate from what the tut
file is now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possibility is to:
- move all posts to the
_tut
directory - add
_posts
to.gitignore
- copy non-tut files from
_tut
to_posts
- process tut files from
_tut
to_posts
- let Travis commit the results in the
gh-pages
branch
What I mean is, if the output file exists and is newer than the source file, there's no point running tut. Might be worth it to check since running tut this way is expensive. (Normally tut can't do this because the tut documents depend on project sources that may have changed even if the tut input doc didn't.) |
Got it. |
@tpolecat I've implemented your optimization. I'm now implementing automatic deployment. |
Usage
Put a blog post into
posts
instead of_posts
.Add the following front matter:
sbt run
This will process the
posts/*.md
files into_posts
.Todo
sbt run
make Travis check that there are no dirty files