Skip to content

Commit

Permalink
Merge pull request #211 from stan-dev/code-on-homepage
Browse files Browse the repository at this point in the history
Add code example on landing page
  • Loading branch information
WardBrian authored Jan 16, 2025
2 parents 74aa20c + aff9e49 commit 7f32cd9
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 3 deletions.
68 changes: 68 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* custom CSS only for the home page */
/* all other CSS is shared with docs and in the quarto-config submodule */



.content-block {
padding-top: 20px;
padding-bottom: 10px;
margin-left: 30px;
margin-right: 30px;
}

@media (min-width: 900px) {
.content-block {
margin-left: 50px;
margin-right: 50px;
}
}

@media (min-width: 1200px) {
.content-block {
max-width: 1100px;
margin-left: auto;
margin-right: auto;
}
}

.hero-banner {
position: relative;
display: flex;
justify-content: center;
color: var(--stan-hero);
background-color: var(--stan-hero-bg);
border: 10px solid var(--stan-secondary);
}

.hero-banner h1 {
font-size: 2.5rem;
margin-top: 1rem;
text-align: center;
}

.hero-banner .content-block {
padding-top: 0;
}

.hero-code {
display: flex;
justify-content: center;
align-items: center;
padding-bottom: 1rem;
padding-top: 1rem;
}

.hero-code pre,
.hero-code code {
color: var(--bs-body-color);
padding: 0.25em;
}

.hero-code .code-with-filename-file {
border: 1px solid rgba(233, 236, 239, 0.2);
background-color: var(--stan-secondary);
}
.hero-code .code-with-filename-file pre {
background-color: inherit;
color: var(--stan-hero);
}
27 changes: 24 additions & 3 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ aliases:
- events/index.html
- users/index.html


css: index.css
code-copy: false
---


Expand All @@ -20,7 +21,8 @@ aliases:

# Stan: Software for Bayesian Data Analysis

::::: {.hero-text}
::::: {.hero-text .grid}
:::::: {.g-col-12 .g-col-md-8}

### Bayesian Modeling

Expand All @@ -35,7 +37,26 @@ Stan's probabilistic programming language is suitable for a wide range of applic
Interfaces for Python, Julia, R, and the Unix shell make it easy to use Stan in any programming environment,
on laptops, clusters, or in the cloud. A rich ecosystem of tools for validation and visualization support
decision-making and communication.

::::::

:::::: {.g-col-12 .g-col-md-4 .hero-code}

```{.stan filename="bernoulli.stan"}
data {
int<lower=0> N;
array[N] int<lower=0, upper=1> y;
}
parameters {
real<lower=0, upper=1> theta;
}
model {
// uniform prior on interval 0,1
theta ~ beta(1, 1);
y ~ bernoulli(theta);
}
```

::::::

:::::
::::: {.hero-buttons style="position: relative; display: flex; justify-content: center;"}
Expand Down

0 comments on commit 7f32cd9

Please sign in to comment.