-
Notifications
You must be signed in to change notification settings - Fork 1k
Migrate contribute section from scala-lang to a guide #2350
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
Merged
bishabosha
merged 220 commits into
scala:main
from
bishabosha:move-contribute-from-scala-lang-pr
Mar 30, 2022
Merged
Changes from 1 commit
Commits
Show all changes
220 commits
Select commit
Hold shift + click to select a range
9ff6a34
Pushing uncommitted footprint
heathermiller fc99948
Some work on the contribute section
ingoem 02337f4
Add partest guide
ingoem 9ea42c1
first 1.5 steps of the hacker guide
xeno-by a2eb30e
"Contribute" landing page
VladUreche b09e5f1
1.5 more sections
xeno-by ca316b6
Merge branch 'master' of github.com:scala/scala-lang
xeno-by 59c99c1
tentative fin
xeno-by a541a62
polishing the hacker guide
xeno-by edc6f15
removes the git guide - it's been subsumed by the hacker's guide
xeno-by ca55cb4
removes the workflow page - it's been subsumed by the hacker's guide
xeno-by de59612
Fixing issues with images, formatting fixups, moving maintainers list…
heathermiller 42987dd
Fixes to the wording in the hacker guide.
heathermiller 2ce31f9
Continuing to tweak the hacker guide, and to add info where needed. R…
heathermiller 023f0b0
Final tweaks to the hacker guide. Mostly wording
heathermiller 36ce309
Fixed a build error
sjrd 3a415b7
First shot at a 'community tickets' feed fetched from JIRA.
sjrd af5a53c
Added a dynamic pager in the community tickets feed.
sjrd f317bfc
Bug reporting guide.
fe39e12
contribute -> get-involved
manojo ab597ab
Going back to having a 'Contribute' section
heathermiller 8559dda
Going back to having a 'Contribute' section, take 2
heathermiller 96c6854
Making contribute page full width
heathermiller 2ddf889
Added hall of fame of May 2013.
sjrd 81e5474
3-column layout for hall of fame pages.
sjrd 5a8dd18
Added namin in EPFL people.
sjrd 5056003
Styling contents and other cleanups
heathermiller 43b72d9
Formatting fix to hackers guide
heathermiller 05854a1
Moving community tickets back to contribute section
heathermiller 9cd49cd
Hall of fame June 2013.
sjrd 24ee607
Moved community tickets to a separate page.
sjrd 8b3d91c
Moved contributing pages around.
sjrd 22dc808
A bit of rewording on the contribute page.
sjrd 684bb8b
Dropped 3 boxes on the Contribute guide.
sjrd 13462b9
Moved the contribute intro text to contribute/.
sjrd 966a0f2
Removing double title on the hall of fame
heathermiller 688d556
Add section “Test” and “Merge”, rename “Discuss” to “Review”
soc 29705fc
minor copyediting to hacker guide
SethTisue 8efe137
Merge pull request #95 from SethTisue/hacker-guide-tweaks
sjrd 50d5041
fix links in hacker guide and various typos.
gourlaysama f053d6a
Merge pull request #98 from gourlaysama/fix/typos
heathermiller ac890ec
Make hacker-guide valid.
relrod 38ef7cf
Add hall of fame for July and August 2013.
sjrd 1fad035
Add hall of fame for 2013-09.
sjrd 9b709e0
Update hacker-guide.md
AndreVanDelft 071e23e
Merge pull request #147 from AndreVanDelft/patch-1
heathermiller 6f80442
Update hacker guide: add more info, fix broken links.
folone a076f43
Address the feedback.
folone 9373b9d
Merge pull request #212 from folone/update-hacker-guide
heathermiller 8f63cd0
Fix more references to spec
adriaanm e4ad4ef
Merge pull request #226 from adriaanm/master
sjrd afc73aa
Hall of fame Auguest 2014.
sjrd d4630ea
Add 2014 scala-fame data
fsalvi bd730a6
Add 2013 scala-fame data
fsalvi 3d71e5b
Add scala-fame data
fsalvi 84d53a9
Add scala-fame data
fsalvi def0d83
Removed PHP issues page in favor of direct JIRA queries.
dickwall 76fcdfa
Add scala-fame data
fsalvi fd4cf44
Add scaladoc contribution page and link up.
dickwall b049734
Corrected JIRA search URL for compiler bugs.
dickwall 28b1a79
Merge pull request #253 from dickwall/doc/communitytickets
sjrd b53c6bd
Wording tweaks
heathermiller b27128f
Some reorganization and tweaks
heathermiller c605c2e
Merge pull request #257 from dickwall/doc/contributedoc
heathermiller 66f39d2
Fix the Forking url and grammatical consistency
JustinPihony 75efc9d
Merge pull request #262 from JustinPihony/scaladoc/updatecontrib
heathermiller f2a174c
Correct a couple of spelling typos on contribution pages.
dickwall 720507a
Merge pull request #263 from dickwall/doc/fixtyposcontrib
heathermiller db2a14f
Add u to docmentation typo
JustinPihony 4080865
Merge pull request #264 from JustinPihony/scaladoc/updatecontrib
heathermiller eb1e3cb
Update contributor pages for bugs/issues - provide issue checklist
dickwall 0083e20
Alter when documentation/bug fix scala-internals postings are recomme…
dickwall d7c254b
Correct scala-internals link and remove missing resource links.
dickwall bdacdf6
Merge pull request #268 from scala/doc/bugcontrib
dickwall a4fb06f
Add scala-fame data
fsalvi db78065
Re-org and simplify contribution section pages.
dickwall 090c9de
Remove wiki info, use scala-lang.org.
dickwall b8fd97d
Merge pull request #276 from scala/fix/contributereview
dickwall e172523
Add IDEs and Build Tools page
dickwall 391caec
Respond to review comments - correct link, reorder projects
dickwall 78759cd
Tweak the all community bugs link
dickwall 84da163
Add fix me links and core lib page.
dickwall 66c5272
Add a missing paragraph opener on tools.md
dickwall a2d1817
Merge pull request #285 from scala/fix/tools-page
dickwall cde252c
Fix intra-page links for main markdown engine.
dickwall 5d944e7
Merge pull request #286 from scala/fix/contribute-markdown-links
dickwall 70673bb
Remove extra _ in fix-page link.
dickwall e73e5ad
Merge pull request #287 from scala/fix/fix-page-link
dickwall fa3402a
Fix documentation page intra-link.
dickwall 380c4bf
Merge pull request #288 from scala/fix/documentation-contrib
dickwall fc02b4d
Add contribute PR review page to /contribute
dickwall 77cd3f5
Incorporate comments, reduce wordiness
dickwall 3c9d4cd
Add scala-fame data
fsalvi 4bada26
Fix transposition of github.scala.com.
dickwall 5b4b706
Merge pull request #290 from scala/doc/contribute-reviews
dickwall 57b4392
phase out old GitHub wiki pages
SethTisue 2fed551
Merge pull request #315 from SethTisue/no-more-github-wiki
SethTisue 6a53d06
hacker's guide: replace out-of-date reviewer list with link
SethTisue b794365
Merge pull request #319 from SethTisue/link-to-current-maintainers-list
heathermiller 23f6274
SI-9495 Add note about configuring Ant for HTTP proxies
retronym 127aaf6
Merge pull request #333 from scala/ticket/9495
SethTisue 4d8f053
fix slightly malformed Markdown
SethTisue 50b14af
SI-9501 add prominent links to relevant docs in main Scala repo
SethTisue 9e311d3
Merge pull request #336 from SethTisue/add-links-near-start
SethTisue 0feb67a
fix typo
SethTisue c80d070
October 2015 hall of fame
SethTisue 761af81
tweak Hall of Fame page
SethTisue 3ebb301
Merge pull request #353 from SethTisue/hall-of-fame-tweak
SethTisue 7a039ae
tiny fix
SethTisue 749a690
hall of fame: 2.12.x is default branch now
SethTisue f0fb46c
November 2015 contributors hall of fame
SethTisue fd9efb3
Merge pull request #364 from SethTisue/hall-of-fame-nov-215
SethTisue f928c82
fix bad Markdown
SethTisue 42986b1
Merge pull request #379 from SethTisue/fix-bad-markdown
SethTisue 719edc3
add text about community libraries, Scala community build
SethTisue eeee725
Code of Conduct page, relocated from docs site
SethTisue cc3d461
tweak wording of community build section
SethTisue 9a9c6e7
Merge pull request #381 from SethTisue/tout-community-build
heathermiller 856fc9c
retire the Scala Contributor Hall of Fame
SethTisue 51e1aa8
Merge pull request #387 from SethTisue/no-more-hall-of-fame
sjrd 76fa6b9
Typesafe -> Lightbend in a bunch of places
SethTisue cb47977
Merge pull request #416 from SethTisue/light-saber-type-fender
SethTisue 55dfcf6
Replace references to ant with corresponding sbt references
chaselal 5532eb4
Changes per PR feedback
chaselal 1ea529f
Correct misleading instructions for publishing a local Scala version
chaselal 2a94e25
Update Ensime's contributing and readme page
bertzzie a41edfc
Implement some review feedback, some polish of my own
adriaanm ed07235
Merge pull request #504 from adriaanm/chaselal-update-hacker-guide
SethTisue 6a5ddf9
fix Github -> GitHub
SethTisue 78590ba
recommend sbt, not Activator
SethTisue 891183e
fix a lot of broken links
jarrodu bca634e
Merge pull request #533 from jarrodwb/fix-links
SethTisue 17179d3
Merge pull request #530 from SethTisue/sbt-not-activator
SethTisue ffe3a69
fix blank alt tags
jarrodu c46edc1
Fix formatting problems in hacker guide
ashawley c27f49c
fix miscellaneous links
jarrodu 378fa3d
Merge pull request #544 from jarrodwb/broken-links
SethTisue f2b3a20
2.11 -> 2.12 in some more places
SethTisue 0371cb8
Merge pull request #572 from SethTisue/more-version-bumps
SethTisue 1a25805
First migration of content pages to new content layout - First migrat…
b58955f
Short items list for the contribute subpages
0aa2f7f
Adding code of conduct
1a423d1
Merge pull request #33 from 47deg/sl9-internal-pages-implementation
32684ba
Update bug reporting links
janekdb 7390eec
Add scalacheck tips and note removal of partest
janekdb 6f05619
Merge pull request #671 from janekdb/topic/scalacheck-run-one
travissarles 2434ec3
Merge branch 'master' of https://github.com/scala/scala-lang into exp…
travissarles 98cab4f
Merge pull request #670 from janekdb/topic/bug-reporting-link
heathermiller 290816e
Dealing with conflicts
heathermiller 72f6b45
Merge pull request #679 from scala/pr/667
heathermiller c8305a9
Get rid of some of the permalinks that are breaking everything
heathermiller fbca9ca
Bug reporting guide link fixes
heathermiller e2f7c07
Removing some mentions of scala-internals
heathermiller 5c3fbae
Missing whitespace
heathermiller d1d0f26
fix or remove links to wiki
SethTisue dc38fbc
Merge pull request #711 from SethTisue/wiki-is-dead
SethTisue 81a9902
scala.github.com -> docs.scala-lang
SethTisue 287b50a
Fix broken links of https://scala-lang.org/contribute/#contribute.
jiminhsieh 05fc415
Merge pull request #729 from jiminhsieh/ticket/#727
heathermiller 18f49fc
More link fixes
heathermiller aaf513b
Extend partest guide with sbt and mention batch script removals
janekdb 48e43e8
fix typo
SethTisue 6f2ca77
Fix links to Hacker guide
Philippus 3db9bb5
Add missing space
Philippus 725800e
Fix links
Philippus 56abdcb
Link to GitHub instead of JIRA
Philippus 46fc7ea
Reword and link to GitHub instead of JIRA
Philippus 381b641
Link to GitHub instead of JIRA
Philippus 74ce081
Fix ironically broken link
Philippus 832e674
Link to GitHub instead of JIRA
Philippus e4f39bf
Fix Scalariform section
Philippus 4a9c5f0
Remove Scalap
Philippus 0dc0f0d
Link to GitHub instead of JIRA
Philippus 5ad09fd
Remove link to 'Actors Migration Kit'
Philippus 1b4d548
Replace references to 'JIRA' with 'GitHub'
Philippus 7666532
Remove 'Community Tickets' section almost completely
Philippus 0dda547
Fix links to Mailing Lists
Philippus 2f7d9fb
Fix broken links
Philippus f00b6f3
Update links for ENSIME
Philippus 5d99628
Remove link to not-existing page
Philippus d13b13b
Update DBuild links
Philippus 2fc39af
Merge branch 'master' into remove-links-to-jira
propensive df0a9ab
Update broken/outdated links
Philippus b2151d9
Merge pull request #838 from Philippus/fix-more-broken-links
SethTisue d0fc35c
s/username/user-name/ to please htmlproofer
OlivierBlanvillain 0846496
Fix contribute link
OlivierBlanvillain b8524d6
Merge pull request #840 from OlivierBlanvillain/cleanup-links
SethTisue 44032b5
update spec links and advisements
SethTisue abc232e
Merge pull request #1050 from SethTisue/spec-links
SethTisue 4643f12
Point the hacker guide to 2.13
dwijnand a8b0a77
Merge pull request #1056 from scala/2.13-hacker
SethTisue 4a881b1
renamed community-builds repo to community-build
SethTisue ef84a93
ENSIME is dead, Abide is dead (#1083)
SethTisue 7fbd26d
fix dead links
SethTisue 905ee66
fix dead links (#1108)
dwijnand cd0e4fa
fix some 404s
SethTisue 398d1aa
Merge pull request #1109 from SethTisue/fix-more-bad-links
dwijnand ae348d2
Replace references to SLIP with SIP
Philippus 6342df9
Reword bit about significant changes
Philippus fa1fc2b
remove incorrect bit about partest (#1163)
SethTisue 545f84c
Use HTTPS for links
Marcono1234 b129513
Use correct capitalization for "GitHub"
Marcono1234 cd127dc
Merge pull request #1194 from Marcono1234/marcono1234/https-links
SethTisue b91365a
Add the Inclusive Language Guide.
sjrd 7756c54
Discord is now our main chat platform
SethTisue 79597c8
Merge pull request #1312 from SethTisue/hello-discord
SethTisue 532dbc3
enable collection contribute_resources
bishabosha d9c44eb
prepare for move files
bishabosha 3073565
move contribute files
bishabosha db3d07e
convert to multipage overview
bishabosha c692ad3
migrate urls to /overviews/contribute
bishabosha ef8f171
modernise the content somewhat
bishabosha b32fe56
add new page - Add New Guides/Tutorials
bishabosha 4b34e7f
integrate guide with the site
bishabosha 302bfbf
revert to /contribute/ urls
bishabosha 573e494
use jekyll link tag to render internal links
bishabosha 7de6290
add back Scoverage as a project in need
bishabosha e2a41dc
use more accessible language in Add New Guides/Tutorials
bishabosha d8e9d2e
enhance contribute intro
bishabosha add60f3
final proof read
bishabosha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,221 @@ | ||
--- | ||
title: Add New Guides/Tutorials | ||
layout: multipage-overview | ||
num: 7 | ||
partof: scala-contribution | ||
overview-name: Contributing to Scala | ||
--- | ||
|
||
## Why Contribute New Learning Material? | ||
|
||
As [Heather Miller writes](/contribute.html), contributing to [docs.scala-lang.org](https://docs.scala-lang.org) is | ||
critical to making Scala accessible to newcomers, experience programmers, and anyone who is curious. | ||
It is also a fantastic way to contribute for anyone who is comfortable using Scala, but maybe does not want to get | ||
involved with complex tools like the compiler. | ||
|
||
## Architecture | ||
|
||
This documentation website is backed by an open-source [github repository](https://github.com/scala/docs.scala-lang), | ||
and is always contribution-ready. | ||
|
||
### Content | ||
|
||
Currently, the _types_ of documentation supported in this repository are: | ||
|
||
- **Guides/Overviews**: Definitive guides/overviews of specific language features. Often long, detailed documents, | ||
often produced by members of the Scala team. An example is the excellent [Collections][collections-overview] overview. | ||
bishabosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- **Tutorials**: Bite-size, example-rich, and concise articles meant to get a developer up to speed quickly. | ||
- **Cheatsheets**: Quick reference of Scala syntax and behaviors. | ||
bishabosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Implementation | ||
|
||
The website is statically generated from [Markdown](https://en.wikipedia.org/wiki/Markdown) source using | ||
[Jekyll](https://github.com/mojombo/jekyll), and hosted on [GitHub Pages](https://pages.github.com/). | ||
This workflow was chosen so as to make it as easy as possible for core committers and the community alike | ||
to produce HTML documentation, and as easy as possible to publish it in a central location. | ||
|
||
The markdown syntax being used supports [Maruku](https://github.com/bhollis/maruku) extensions, and has automatic | ||
syntax highlighting, without the need for any tags. | ||
|
||
Additionally [mdoc](https://github.com/scalameta/mdoc) is used during pull requests to validate Scala code blocks. | ||
To use this feature you must use the backtick notation as documented by mdoc. Note that only validation is done. | ||
The output files from mdoc are not used in the building of the tutorial. Use `mdoc` or `mdoc:fail` for your code blocks. | ||
bishabosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Submitting Docs | ||
|
||
For one to contribute a document, one must simply | ||
bishabosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[fork](https://help.github.com/articles/fork-a-repo/) the | ||
[repo](https://github.com/scala/docs.scala-lang), write their article in | ||
[Markdown](https://daringfireball.net/projects/markdown/syntax) (example below), and submit a pull request. That's it. | ||
Likely after some edits and discussion, your document will be made live | ||
on [docs.scala-lang.org](https://docs.scala-lang.org). | ||
|
||
--- | ||
layout: overview | ||
title: My Awesome Title | ||
--- | ||
|
||
## An h2 Header in Markdown | ||
|
||
And a paragraph, with a [link](https://www.scala-lang.org). | ||
|
||
One can contribute code in a markdown document by either | ||
- indenting it by 4 spaces | ||
- surrounding by triple backticks, as shown below | ||
- in-line by putting backticks around it, e.g. `def foo`. | ||
|
||
```scala | ||
println("hello") | ||
``` | ||
|
||
Everything else is automatically generated for you; tables of contents, and most index pages. And of course, the | ||
styling is already taken care of for you. | ||
|
||
### Criteria for Docs to be Accepted | ||
|
||
The goal of this documentation repository is to be tighter and more organized than other community-driven documentation platforms, like wikis. As such, any document pulled in for inclusion on | ||
[docs.scala-lang.org](https://docs.scala-lang.org) must: | ||
|
||
- **"fit in"** to the repository ( _i.e.,_ it should not be a complete duplicate of another article), | ||
- **be polished** it must be thorough, complete, correct, organized, and "article-like" (personal programming notes | ||
don't quite fit.) | ||
- **be maintained** if the document might require revisions from time to time, be prepared to keep it up to date, or | ||
nominate someone to take ownership. | ||
|
||
If you have something you're thinking about contributing, or that you're thinking about writing in order to contribute | ||
-- we'd love to consider it! Please don't hesitate to use GitHub issues and pull requests and the | ||
\#scala-contributors room [on Discord](https://discord.com/invite/scala) for any questions, concerns, | ||
clarifications, etc. | ||
|
||
## Document Templates | ||
|
||
> **Note:** These templates will soon change slightly as a result of necessary refactoring. | ||
|
||
### Guides/Overviews | ||
|
||
A guide or an overview that can be logically placed on **one** page must be placed in the directory | ||
`_overviews/RELEVANT-CATEGORY/_posts` with the file name in the format `YYYY-MM-dd-title-separated-by-dashes.md`, | ||
bishabosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
and header: | ||
|
||
--- | ||
layout: overview | ||
title: YOUR TITLE | ||
--- | ||
|
||
The rest of the document should, of course, be written in [Markdown](https://en.wikipedia.org/wiki/Markdown). | ||
|
||
At the moment, `RELEVANT-CATEGORY` corresponds to only a single category, "core," because we are currently focusing on | ||
building up documentation of core libraries. However, expect more categories here in the future. | ||
|
||
If your document consists of **multiple** pages, like the [Collections][collections-overview] overview, an ordering | ||
must be specified, by numbering documents in their logical order with `num`, and a name must be assigned to the | ||
collection of pages using `partof`. For example, the following header might be used for a document in the collections | ||
overview: | ||
|
||
--- | ||
layout: overview | ||
title: YOUR TITLE | ||
|
||
partof: collections | ||
num: 10 | ||
--- | ||
|
||
A **single** document in the collection must contain a tag in the header, `outof`, that indicates the total number of | ||
documents in the large overview. Putting it on the last page in the overview is often best: | ||
|
||
--- | ||
layout: overview | ||
title: YOUR TITLE | ||
|
||
partof: collections | ||
num: 15 | ||
outof: 15 | ||
--- | ||
|
||
Index pages, such as [docs.scala-lang.org/overviews/index.html](https://docs.scala-lang.org/overviews/index.html) are | ||
generated, by reading data from a configuration file, such as `_data/overviews.yml`, so your overview should be | ||
placed into a category there. | ||
|
||
### Tutorials | ||
|
||
At the moment, tutorials are written the same as Guides/Overviews, except that their link must be added to | ||
bishabosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
the metadata of `/tutorials.md`. e.g. for the [Scala With Maven][scala-with-maven] tutorial, the | ||
metadata of `/tutorials.md` looks like | ||
|
||
--- | ||
layout: inner-page-parent | ||
title: Tutorials | ||
|
||
tutorials: | ||
... | ||
- title: "Scala with Maven" | ||
url: "/tutorials/scala-with-maven.html" | ||
description: "Create a Scala project with Maven." | ||
icon: code | ||
--- | ||
|
||
For a single-page tutorial, the typical directory to place them in is `_overviews/tutorials`. | ||
|
||
### Cheatsheets | ||
|
||
For now, cheatsheets are assumed to be in the form of tables. To contribute a cheatsheet, one must simply produce their | ||
cheatsheet as a Markdown table, with the following header: | ||
|
||
--- | ||
layout: cheatsheet | ||
title: YOUR TITLE | ||
by: YOUR NAME | ||
about: SOME TEXT ABOUT THE CHEAT SHEET. | ||
--- | ||
|
||
### Code blocks | ||
|
||
The site build process uses [mdoc](https://scalameta.org/mdoc/) to typecheck | ||
code snippets in markdown. This is a great way to ensure the code snippets that | ||
you're including typecheck and are valid. Here are a few quick types to get | ||
started. | ||
|
||
To get started, add `mdoc` after `scala` when you are creating a | ||
code block. The `mdoc` modifier here will make sure that `mdoc` runs the code | ||
snippet and ensures that it's valid. | ||
|
||
```scala mdoc | ||
val a = 1 | ||
``` | ||
If you have a snippet that you expect to fail, you can also account for this by | ||
using `mdoc:fail` for a compile error `mdoc:crash` for a runtime-error. | ||
|
||
```scala mdoc:fail | ||
val b: String = 3 // won't compile | ||
``` | ||
Keep in mind that a single file is all compiled as a single unit, so you can't | ||
redefine a variable that was defined above in another code snippet. _However_ | ||
there are a couple ways to get around this. Firstly, you can use the `mdoc:nest` | ||
modifier with will wrap the snippet in a `scala.Predef.locally{...}`. This will | ||
essentially "hide" the snippet from the others. Another way around this is to | ||
use the `mdoc:reset` modifier, which _resets_ and forgets about everything up | ||
above. Here is an example using the various modifiers. | ||
|
||
```scala mdoc | ||
import java.time.Instant | ||
|
||
def now() = Instant.now() | ||
object Foo {} | ||
``` | ||
|
||
```scala mdoc:nest | ||
case class Foo(a: Int) // conflicts with Foo above, but it's nested so it's fine | ||
``` | ||
|
||
```scala mdoc | ||
val a = s"The time is ${now()}" // still have access to the now method from above | ||
``` | ||
```scala mdoc:reset | ||
case class Foo(a: String) // forget the previous Foo's and start fresh | ||
``` | ||
```scala mdoc | ||
val myFoo = Foo("hi") // now we only have access to the last Foo | ||
``` | ||
|
||
[collections-overview]: {% link _overviews/collections-2.13/introduction.md %} | ||
[scala-with-maven]: {% link _overviews/tutorials/scala-with-maven.md %} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.