Skip to content

Commit

Permalink
Start linking Analysis from home page
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Jan 10, 2022
1 parent 3bec032 commit 9b2d6ee
Show file tree
Hide file tree
Showing 13 changed files with 249 additions and 24 deletions.
19 changes: 19 additions & 0 deletions arrow-site/docs/_code/analysis-home-code.md
@@ -0,0 +1,19 @@
---
library: analysis
---
{: data-executable="true"}
```kotlin
import arrow.analysis.*

fun increment(x: Int): Int {
pre(x > 0) { "value must be positive" }
return (x + 1).post({ it > 0 }) { "result is positive" }
}

class Positive(val value: Int) {
init { require(value > 0) }

fun add(other: Positive) =
Positive(this.value + other.value)
}
```
8 changes: 7 additions & 1 deletion arrow-site/docs/_data/features.yml
Expand Up @@ -12,7 +12,7 @@ content:
id: core

- title: FX
description: Functional Effects Framework companion to KotlinX Coroutines.
description: Functional Effects Framework companion to KotlinX Coroutines
icon: img/home/arrow-fx-lines
url: /fx/
id: fx
Expand All @@ -23,6 +23,12 @@ content:
url: /optics/
id: optics

- title: Analysis
description: Pre-, post-condition, and invariant checks for your Kotlin code
icon: img/home/arrow-analysis-lines
url: /meta/analysis/
id: analysis

- title: Meta
description: Metaprogramming library for Kotlin compiler plugins
icon: img/home/arrow-meta-lines
Expand Down
2 changes: 1 addition & 1 deletion arrow-site/docs/_includes/_header.html
Expand Up @@ -20,7 +20,7 @@ <h1 id="header-text">{{site.data.commons.description}}</h1>
<div id="core-arrow-animation" class="image-animation" alt="Arrow core"></div>
<div id="fx-arrow-animation" class="image-animation" alt="Arrow fx"></div>
<div id="optics-arrow-animation" class="image-animation" alt="Arrow optics"></div>
<div id="meta-arrow-animation" class="image-animation" alt="Arrow meta"></div>
<div id="analysis-arrow-animation" class="image-animation" alt="Arrow analysis"></div>
<img id="logo-white-lines" class="image-animation" src="{{ '/img/home/logo-white-lines.svg' | relative_url }}" alt="Arrow white lines"></img>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions arrow-site/docs/_includes/_main.html
Expand Up @@ -4,6 +4,7 @@
{% for item in site.data.features.content %}
{% assign title = item.title | downcase %}
{% if item.id != "quickstart" %}
{% if item.id != "meta" %}
<a id="{{ item.id }}" class="{{ item.id }} main-item feature" href="{{ item.url | relative_url }}">
<div id="{{ item.id }}-header" class="item-header">
<div id="icon-{{ item.id }}-content" class="icon-content">
Expand All @@ -16,6 +17,7 @@ <h2 id="{{ item.id }}-title">{{ item.title }}</h2>
</div>
</a>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions arrow-site/docs/_sass/components/home/_header.scss
Expand Up @@ -117,7 +117,7 @@
visibility: hidden;
}

#meta-code-block {
#analysis-code-block {
visibility: hidden;
}

Expand Down Expand Up @@ -165,7 +165,7 @@
right: 7px;
}

#meta-arrow-animation {
#analysis-arrow-animation {
position: absolute;
opacity: 0;
transition: $opacity-transition;
Expand Down
61 changes: 61 additions & 0 deletions arrow-site/docs/img/home/arrow-analysis-lines-color.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions arrow-site/docs/img/home/arrow-analysis-lines-white.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions arrow-site/docs/img/home/arrow-analysis-lines.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions arrow-site/docs/js/animations.js
Expand Up @@ -35,12 +35,22 @@ const arrowOpticsAnimation = lottie.loadAnimation({
path: 'js/json/arrow-optics.json'
});

// meta animation
// analysis animation
const arrowAnalysisAnimation = lottie.loadAnimation({
container: document.getElementById('analysis-arrow-animation'),
renderer: 'svg' / 'canvas' / 'html',
loop: false,
autoplay: false,
path: 'js/json/arrow-analysis.json'
});


/* // meta animation
const arrowMetaAnimation = lottie.loadAnimation({
container: document.getElementById('meta-arrow-animation'),
renderer: 'svg' / 'canvas' / 'html',
loop: false,
autoplay: false,
path: 'js/json/arrow-meta.json'
});
}); */

1 change: 1 addition & 0 deletions arrow-site/docs/js/json/arrow-analysis.json

Large diffs are not rendered by default.

0 comments on commit 9b2d6ee

Please sign in to comment.