Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Add docs for kotlin:ank:playground #53

Closed
wants to merge 5 commits into from
Closed

Conversation

nomisRev
Copy link
Member

No description provided.


Ank also has support to turn Kotlin snippets into Kotlin Playgrounds w/ support for Arrow.
For a snippet to be runnable it needs to contain a `main` function,
and you can mark the begin and end of the example using `//sampleStart` & `//sampleEnd`.
Copy link
Member

Choose a reason for hiding this comment

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

I would add a reminder about the need for having all the sources you need in the snippet otherwise it'll fail. Also clarify that if you need to showcase compile time generated syntax you'll need to copy those generated elements on the snippet, given Playgrounds can only depend on the sources in the snippet, and the playgrounds server doesn't run kapt either.

About the different behavior between Ank and playgrounds when it comes to classpath dependencies: Playgrounds can also work incrementally so you don't need to redeclare everything on every single snippet, like Ank does. You can do it with an "incremental" flag but last time I tried random stuff failed, so I'm not completely sure whether that works fine.

Copy link
Member

@rachelcarmena rachelcarmena left a comment

Choose a reason for hiding this comment

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

Awesome @nomisRev 🙌 I didn't realize about those details for every modifier. Maybe we could re-organize the content for a better understanding:

  • language:ank
  • language:ank:<modifier> for every modifier in the same order of the table and a note together the table to know that there are details and examples for every modifier

Note: checks are not run for this pull request because they are not necessary for README changes. Just merge when having 2 approvals. Thanks!!

@rachelcarmena
Copy link
Member

Hi fellow contributor 👋

Arrow repositories has been reunified again into arrow so this repository is going to be archived.

Please, if you want to replay this pull request on arrow repository, follow these steps:

# Adapt your branch to be able to be merged in the new arrow repository
cd arrow-ank
git-filter-repo --to-subdirectory-filter arrow-libs/ank
cd ..

# Create a new branch in arrow repository and merge your content
git clone git@github.com:arrow-kt/arrow.git
cd arrow
git checkout -b <new-branch>
git remote add arrow-ank ../arrow-ank
git fetch arrow-ank
git merge --no-edit --allow-unrelated-histories arrow-ank/<your-branch>
# check and create the pull request again on arrow repository

Please, let us know if we can help you!

Thank you so much for your contributions!! 🙌

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

Successfully merging this pull request may close these issues.

3 participants