Giter VIP home page Giter VIP logo

website's Introduction

scala-sbt.org

This project is the source for scala-sbt.org. It generates the contents of the site in sbt/sbt.github.com for delivery via GitHub Pages.

See contributors for the list of documentation contributors.

scala-sbt.org is powered by:

  • Pamflet, a Scala-based documentation engine written by @n8han (and some contributions from @eed3si9n) generates the sbt 0.13/1.x documentation.

  • Pandoc 2.3.1, to generate pdf files.

The site generation is driven by sbt-site and sbt-ghpages.

Attention plugin authors

The source for Community plugins page is at src/reference/01-General-Info/02-Community-Plugins.md. Add your plugin to this page and send us a pull request if your plugin is not already on it.

Setup

Full setup

The PDF generation is optional, and requires the following additional steps to install TeX Live and Pandoc.

On Ubuntu

$ sudo apt-get install pandoc latex-cjk-all texlive-full

On Mac

These steps are derived from Haruhiko Okumura's instructions at [TeX Live/Mac](https://texwiki.texjp.org/?TeX%20Live%2FMac#bcb0d462 (in Japanese).

Docusaurus

This website is built using Docusaurus, a modern static website generator.

Local Development

$ yarn start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

$ yarn run build

This command generates static content into the build directory and can be served using any static contents hosting service.

Usage

To make the site locally, from sbt shell:

> makeSite

Then open target/site/index.html.

To push site, from sbt shell:

> ghpagesPushSite

Beware that sbt-ghpages interacts badly if your home directory is a git repository: sbt/sbt-ghpages#25

Releasing new sbt

  • Make sure you enable pdf generation: sbt -Dsbt.website.generate_pdf
  • Update sbt.version in project/build.properties
  • Update targetSbtFullVersion in project/Docs.scala
  • Update sbtVersion, windowsBuild and sbtVersionForScalaDoc in src/reference/template.properties

Dollar sign

Pamflet uses dollar sign ($) as the template variable character. So if you use it in the document, use need to escape it with backslash: \$.

Here's how to check for unescaped dollar signs.

$ brew install ripgrep
$ rg '^([^\$]*)[^\\]\$([^\$]*)$' -g '*.md' src

src/reference/02-DetailTopics/03-Dependency-Management/04-Proxy-Repositories.md
79:  export SBT_CREDENTIALS="$HOME/.ivy2/.credentials"

Including code examples

To include a validated code examples, create a scripted test under src/sbt-test, and in the markdown include as:

// This includes the entire file as Scala code snippet
@@snip [build.sbt]($root$/src/sbt-test/ref/basic/build.sbt) {}

or

// This includes snippet between a line containing #example another line with #example
@@snip [build.sbt]($root$/src/sbt-test/ref/basic/build.sbt) { #example }

or

// This specifies syntax highlight
@@snip [build.sbt]($root$/src/sbt-test/ref/basic/build.sbt) { #example type=text }

License

sbt Copyright 2023 - current, Scala Center at EPFL Copyright 2011 - 2023, Lightbend, Inc. Copyright 2008 - 2010, Mark Harrah Licensed under Apache v2 license (see LICENSE)

website's People

Contributors

ashawley avatar atry avatar ckipp01 avatar dependabot[bot] avatar duhemm avatar dwijnand avatar earldouglas avatar eatkins avatar eed3si9n avatar gkossakowski avatar harrah avatar jaceklaskowski avatar jasonqu avatar jsoref avatar jsuereth avatar krrrr38 avatar kunkun-tang avatar pengisgood avatar raboof avatar rbonvall avatar saint1991 avatar sethtisue avatar sksamuel avatar stringbean avatar superruzafa avatar sv3ndk avatar tkawachi avatar xerial avatar xuwei-k avatar yoshinorin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

website's Issues

Missing docs for ProjectRef & RootProject

I don't see ProjectRef or RootProject mentioned anywhere in the documentation. A good place to include these docs might be in the section for multi-project builds.

I have a lot of questions about how to setup multi-project builds as our codebase grows larger. Should we put our entire codebase in a single SBT build split amongst standard SBT sub-projects? Or should we make each library it's own SBT project and wire them all together with ProjectRef external references?

Linux downloads not shown

I was just told that there exists an architecture switch on the download page. This doesn't seem to work on Linux (Debian 8, Iceweasel/Firefox 38). Inspecting the page, all platforms are greyed out instead of showing the Linux bit.

screenshot from 2016-03-09 00 01 30

Info from http://mybrowserinfo.com:

Your Browser User Agent String is Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.6.1
Operating System:
    Linux
Platform:
    UNIX
Internet Browser:
    Firefox 38.0

Extend Tags docs to include the tags SettingsKey

In our project we have a bunch of tests that can run in parallel and a whole bunch that cannot. To split these out we've created a custom scope and ran them with parallelExecution := false.

This worked great as long as we had a simple project, but the moment we went to a multi-module troubles kicked in because we couldn't assure that test tasks from the different projects were not running in parallel.

After a lot of digging through the sbt source in combination with the ParallelExecution page I found out that I could create a custom tag and tie it to my custom scope with the tag SettingsKey.

Let's say it wasn't a pleasant experience and it would be very useful if this awesome feature could be documented on the website. I'm sure many ppl are running into this in large projects that contain integration tests.

Dependency document should be enhanced

Dependency document should be enhanced.
What does it means (groupId, artifactId, and revision)

How's different between sbt dependency and the MVN repository.

ps .
I would like to add some more introduction to explain this.

Expand on how sbt shell parses input

After some trial and error I understood a part of how the sbt shell parses scoped keys, which I didn't understand from the docs and, therefore, I think should be expanded upon.

Given (this was using sbt 0.13.7)

lazy val root = project aggregate core
lazy val core = project

here I'm getting the wrong answer because I'm asking the question wrong:

> test::publishArtifact
[info] core/*:test::publishArtifact
[info]     true
[info] root/*:test::publishArtifact
[info]     true

when I should be asking

> test:publishArtifact
[info] core/test:publishArtifact
[info]     false
[info] root/test:publishArtifact
[info]     false

Note, I was only able to understand because I was using a multi-module setup, which showed core/*:test::publishArtifact, which isn't what I was after. In a single module setup this would have just shown true.

Opinion: TOC on the side rather than bottom

I found having the TOC on the right side in the old docs format much easier to navigate than having to scroll to the bottom of each page. It was also easier to keep track of where one was when jumping between sections. Not sure if Pamflet supports it, but having a more "Sphinx-style" TOC would improve usability in my opinion.

Credentials best practice

https://github.com/sbt/website/blame/master/src/reference/02-DetailTopics/03-Dependency-Management/05-Publishing.md#L72 states that ~/.ivy2/.credentials is the preferred way to specify credentials. I disagree, at least as long as it doesn't clarify how to specify different credentials for multiple hosts.

IMHO the recommendation should be to put credentials in ~/.sbt/0.13/per-user-per-organization-credentials.sbt files like so:

credentials += Credentials("My realm", "some.host", "user", "password")

The recommendation to put credential settings (e.g. credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")) into projects should also be discouraged. The reason being different projects being published to different artifact repositories an the Ivy credentials file being not flexible enough.

Does it make sense or am I missing something?

nav is slightly irritating

In a reasonably-sized browser window the "go left" and "go right" regions take up about 25% of the width of the window and it's really easy to click over to the next or previous page as you're mousing around. At least for me; I do it every single time I look at the doc. What would you think about maybe just making the buttons hot instead of the entire margin?

confusing documentation about sbt axises

here http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Scopes.html some descriptions are very confusing.

In particular it took me long time to undestand that in

{<build-uri>}<project-id>/config:intask::key

I should choose between config or intask and then add ::key
I think one or two examples like:

fooproject/config::name
fooproject/intask::bartask

will resolve the problem.
In my case confusing parts appeared because I got used to the notion that I operate with sbt as if I operate with scala-code. But in case of project/axis::key notation I operate just with some sbt-specific command syntax that is not code. I think it should be highlighted in the beginning that we are dealing with some special notation and axises here do not mean some scala traits (like I thought in the beginning) but a part of sbt console commands.

Broken link in Organizing Build page

If you go the the Organizing Build page, and ctrl+f for "ld is to define one-off auto plugins in" The link to auto plugins is broken. What is this supposed to point to? I can submit a pull request with it fixed if someone can tell me where it's supposed to go.

Def.sequential example doesn't compile

The docs for Def.sequential don't compile.

[error] /home/bmccann/src/play-multidomain-seed/project/Common.scala:23: not found: value sideEffect0
[error] sideEffect0 := {
[error] ^
[error] /home/bmccann/src/play-multidomain-seed/project/Common.scala:28: not found: value sideEffect1
[error] sideEffect1 := {
[error] ^
[error] /home/bmccann/src/play-multidomain-seed/project/Common.scala:33: not found: value foo
[error] foo := Def.sequential(compile in Compile, sideEffect0, sideEffect1, test in Test).value
[error] ^
[error] three errors found
error Compilation failed

Search box

  • Sitemap
  • Search box UI that limits the search to /0.13/*/

segfault while installing sbt via apt-get

This issue was initially posted to sbt/sbt: sbt/sbt#1883

The documentation says to run the following commands to install on ubuntu

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-get update
sudo apt-get install sbt

If you do that, then you will get the following crash.

NV\sowen@kafka01:~$ echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
...
...
NV\sowen@kafka01:~$ sudo apt-get update
NV\sowen@kafka01:~$ sudo apt-get install sbt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  sbt
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
Need to get 1,041 kB of archives.
After this operation, 1,224 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  sbt
Install these packages without verification? [y/N] y
E: Method https has died unexpectedly!
E: Sub-process https received a segmentation fault.

Downloading the deb-file manually and installing with dpkg works fine. See:
http://stackoverflow.com/questions/13711395/install-sbt-on-ubuntu/13718915#13718915
http://stackoverflow.com/questions/28543911/sbt-install-failure-with-aptitude-on-ubuntu-14-04

Either the documentation should be updated, or a key should be included with the package.

Answer to original bug from jsuereth:

It looks like bintray recently starting having issues with HTTPs. Suprised it's a segfault. In any case, please reopen this against sbt/website.

version switch

Any improvement on this front would be great

problem 1

When you get to 0.13.5 from Google for example http://www.scala-sbt.org/0.13.5/docs/Getting-Started/Welcome.html, 0.13 isn't on the version switch menu.
0.13 should be at the top, and it should navigate to http://www.scala-sbt.org/0.13/tutorial/ if you're on Getting Started guide; http://www.scala-sbt.org/0.13/docs/ otherwise.

problem 2

If you can jump to the corresponding page on 0.13 that'll be cool. I think there are some redirects that I generated.

problem 3

When you are on 0.13 tutorial or reference, version switch control is not displayed.
Again, I think it's ok for the first round to jump to the index page.

notes

Here are the stuff to fix

StackOverflowException in MarkdownParser when running sbt under Java 8.

As of 7f98941, running makeSite causes a StackOverflowException in:

com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270)

Obviously not really a bug in the documentation, but logging since the docs can't be built until fixed.

Top of the stack trace:

java.lang.StackOverflowError
    at java.util.regex.Pattern.compile(Pattern.java:1683)
    at java.util.regex.Pattern.<init>(Pattern.java:1351)
    at java.util.regex.Pattern.compile(Pattern.java:1028)
    at scala.util.matching.Regex.<init>(Regex.scala:153)
    at scala.collection.immutable.StringLike$class.r(StringLike.scala:224)
    at scala.collection.immutable.StringOps.r(StringOps.scala:31)
    at scala.collection.immutable.StringLike$class.r(StringLike.scala:213)
    at scala.collection.immutable.StringOps.r(StringOps.scala:31)
    at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:261)
    at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270)
    at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270)
    at com.tristanhunt.knockoff.ChunkParser$$anon$1.findEnd(MarkdownParsing.scala:270)

Install via https

It would be nice to revert 801b238

We should investigate what the problem is and either fix the instructions or report the issue to bintray if that's where the problem is

PDF

Some people really really want PDF - https://twitter.com/bhaskar_vk/status/473117421067591681

This was one of the things I added to Pamflet, so I should be able to do it fairly quickly at least on my machine. Jenkins would require pandoc, but it would also require nanoc etc that I started using too.

local toc

There should be an ability to show toc for the current section.
This could bring in Getting Started Guide into the main doc.

HelloPlugin3 example does not compile

The HelloPlugin3 in 02-Plugins.md contains this code:

  lazy val helloCommand =
    Command.command("hello") { (state: State) =>
      println(greeting.value)
      state
    }

It calls .value on the SettingKey greeting outside of a task or setting macro. I've done something similar in my own plugin which gave me the following compile error:

`value` can only be used within a task or setting macro, such as :=, +=, ++=, Def.task, or Def.setting

So I guess this example also does not compile.

What would be an idiomatic way to implement helloCommand? Maybe like this:

  lazy val helloCommand =
    Command.command("hello") { (state: State) =>
      println(Project.extract(state).get(greeting))
      state
    }

?

Example in reference manual does not compile

package sbthello

import sbt._
import Keys._

object HelloPlugin3 extends AutoPlugin {
  object autoImport {
    val greeting = settingKey[String]("greeting")
  }
  import autoImport._
  override def trigger = allRequirements
  override lazy val buildSettings = Seq(
    greeting := "Hi!",
    commands += helloCommand)
  lazy val helloCommand =
    Command.command("hello") { (state: State) =>
      println(greeting.value)
      state
    }
}

error:

/home/richard/workspace/sbt-issues/HelloPlugin3.scala:17: `value` can only be used within a task or setting macro, such as :=, +=, ++=, Def.task, or Def.setting.
[error]       println(greeting.value)

/home/richard/workspace/sbt-issues/project/build.properties:

sbt.version=0.13.8

http://paste.ubuntu.com/11803979/

Error in docs for "Running commands"

On this page, in section Pass arguments to a command or task in batch mode, the docs give the following example:

$ sbt 'project X' clean '~ compile'

But this is wrong. Instead, the example should read:

$ sbt "project X" clean "~ compile"

That is, the single quotes should be replaced with double quotes.

I've tested this on both Windows and Linux, and only double quotes work.

Make SBT_OPS information page in Getting Started

We (cc @takezoux2 ) see common mistakes of sbt beginners who don't set SBT_OPS in our regular Scala meetups. Then, as you imagine, their sbt immediately run out of memory.

This is because recommended SBT_OPS setting was only written in Installing sbt manually page among Getting Started with sbt pages, while it should be relevant for all ways of installation (at least homebrew's). So people who have installed sbt in homebrew rarely see Installing sbt manually page and often misses SBT_OPS.

So we propose to make "recommended sbt options" page separate from Installing sbt manually, or put SBT_OPS information to all Installing sbt xxx pages.

If it's OK for you, we're happy to send pull requests as well.

Put the recommended platform installers on the download page

I use Linux, so the current download instructions on http://www.scala-sbt.org/download.html are fine for me, but I think the other recommended platform installers should be front and center on this page as well. They should be above the fold when browsing the page on a common desktop resolution.

I realize the links are available as part of the docs (http://www.scala-sbt.org/0.13/docs/Setup.html), but linking directly to the Windows, OSX, and Linux install instructions would make for a better UX (a few less clicks and scrolling).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.