Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 152 additions & 50 deletions doc/index.css
Original file line number Diff line number Diff line change
@@ -1,84 +1,186 @@
:root {
--color-background: #1c1f26;
--color-text: white;
--color-ruby: #CC342D;
--color-ruby-dark: #A50C07;
--color-bg: #FFFFFF;
--color-bg-alt: #F7F7F7;
--color-text: #3E4451;
--color-text-light: #6B7280;
--color-border: #E5E7EB;
}

body {
background-color: var(--color-background);
font-family: "Noto Sans", "Helvetica Neue", Helvetica, sans-serif;
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

header {
height: 10vh;
body {
background-color: var(--color-bg);
color: var(--color-text);
font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
line-height: 1.6;
}

h1 {
color: var(--color-text);
header {
background-color: var(--color-ruby);
color: white;
padding: 3rem 2rem;
text-align: center;
line-height: 10vh;
margin: 0;
}

header h1 {
font-size: 2.25rem;
font-weight: 700;
margin-bottom: 0.5rem;
}

header p {
font-size: 1.1rem;
}

:focus-visible {
outline: 2px solid var(--color-ruby);
outline-offset: 2px;
}

main {
display: grid;
grid-template-rows: 1fr 1fr;
grid-template-columns: 1fr 1fr;
height: 36vh;
margin: 2vh 20vw;
max-width: 56rem;
margin: 0 auto;
padding: 0 2rem;
}

@media only screen and (max-width: 1200px) {
main {
margin: 2vh 10vw;
}
section {
margin-top: 2.5rem;
}

@media only screen and (max-width: 900px) {
main {
grid-template-rows: repeat(1fr);
grid-template-columns: 1fr;
height: 72vh;
}
section h2 {
font-size: 1.25rem;
font-weight: 700;
margin-bottom: 1rem;
color: var(--color-text);
}

section p {
color: var(--color-text-light);
font-size: 0.9375rem;
margin-bottom: 0.75rem;
}

.playground-link {
display: inline-block;
margin-top: 0.5rem;
padding: 0.625rem 1.25rem;
background: var(--color-ruby);
color: white;
text-decoration: none;
border-radius: 0.375rem;
font-size: 0.9375rem;
font-weight: 600;
transition: background-color 150ms ease;
}

.playground-link:hover {
background: var(--color-ruby-dark);
}

pre {
background: var(--color-bg-alt);
border: 1px solid var(--color-border);
border-radius: 0.375rem;
padding: 0.75rem 1rem;
font-size: 0.875rem;
overflow-x: auto;
margin-bottom: 0.75rem;
}

code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

@media only screen and (max-width: 600px) {
main {
margin: 2vh 5vw;
/* API reference cards */
.grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}

@media (max-width: 640px) {
.grid {
grid-template-columns: 1fr;
}
}

.reference {
border-radius: 1em;
box-sizing: border-box;
color: var(--color-text);
height: 18vh;
padding: 4vh 0;
text-align: center;
display: flex;
align-items: center;
gap: 1.25rem;
padding: 1.25rem;
border: 1px solid var(--color-border);
border-radius: 0.5rem;
text-decoration: none;
transition: background-color 100ms ease;
vertical-align: middle;
color: var(--color-text);
background: var(--color-bg);
transition: border-color 150ms ease, box-shadow 150ms ease;
}

.reference:hover {
border-color: var(--color-ruby);
box-shadow: 0 2px 8px rgba(204, 52, 45, 0.1);
}

.reference > img {
height: 10vh;
width: 10vh;
margin-right: 1em;
vertical-align: middle;
.reference img {
width: 2.5rem;
height: 2.5rem;
flex-shrink: 0;
}

.reference > h2 {
display: inline;
.reference h3 {
font-size: 1rem;
font-weight: 600;
margin: 0;
text-decoration: underline;
color: var(--color-ruby);
}

.reference:hover {
background-color: rgba(255, 255, 255, 0.1);
.reference span {
display: block;
font-size: 0.8125rem;
color: var(--color-text-light);
margin-top: 0.125rem;
}

#logo {
/* Guide links */
.guide {
display: block;
height: 50vh;
margin: 0 auto;
padding: 0.625rem 0.875rem;
border: 1px solid var(--color-border);
border-radius: 0.375rem;
text-decoration: none;
color: var(--color-text);
font-size: 0.875rem;
transition: border-color 150ms ease, color 150ms ease;
}

.guide:hover {
border-color: var(--color-ruby);
color: var(--color-ruby);
}

/* Footer */
footer {
margin-top: 3rem;
padding: 1.5rem 2rem;
text-align: center;
border-top: 1px solid var(--color-border);
display: flex;
justify-content: center;
gap: 2rem;
}

footer a {
color: var(--color-text-light);
font-size: 0.875rem;
}

footer a:hover {
color: var(--color-ruby);
}
93 changes: 71 additions & 22 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,86 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Prism</title>
<link href="https://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic&amp;subset=latin,cyrillic,greek,vietnamese" rel="stylesheet" type="text/css">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<meta name="description" content="Prism is a portable, error-tolerant Ruby parser. Bundled with CRuby 3.3+ and available as a gem.">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src https://fonts.googleapis.com 'self'; font-src https://fonts.gstatic.com; img-src 'self';">
<title>Prism Ruby Parser</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<header>
<h1>Prism Ruby parser</h1>
<h1>Prism</h1>
<p>A portable, error-tolerant Ruby parser</p>
</header>
<main>
<a class="reference" href="c/index.html">
<img src="images/c.svg" alt="C">
<h2>C reference</h2>
</a>
<a class="reference" href="rb/index.html">
<img src="images/ruby.svg" alt="Ruby">
<h2>Ruby reference</h2>
</a>
<a class="reference" href="rust/doc/ruby_prism/index.html">
<img src="images/rust.svg" alt="Rust">
<h2>Rust reference</h2>
</a>
<a class="reference" href="java/index.html">
<img src="images/java.png" alt="Java">
<h2>Java reference</h2>
</a>
<section>
<h2>Try it</h2>
<p>Parse Ruby code in your browser — no installation required.</p>
<a class="playground-link" href="playground.html">Open playground &rarr;</a>
</section>

<section>
<h2>Getting started</h2>
<p>Prism is bundled with CRuby 3.3+ and available as a gem for earlier versions.</p>
<pre><code>gem install prism</code></pre>
</section>

<section>
<h2>API Reference</h2>
<div class="grid">
<a class="reference" href="c/index.html">
<img src="images/c.svg" alt="C">
<div>
<h3>C Reference</h3>
<span>Core library API documentation</span>
</div>
</a>
<a class="reference" href="rb/index.html">
<img src="images/ruby.svg" alt="Ruby">
<div>
<h3>Ruby Reference</h3>
<span>Ruby gem API documentation</span>
</div>
</a>
<a class="reference" href="rust/doc/ruby_prism/index.html">
<img src="images/rust.svg" alt="Rust">
<div>
<h3>Rust Reference</h3>
<span>Rust crate API documentation</span>
</div>
</a>
<a class="reference" href="java/index.html">
<img src="images/java.png" alt="Java">
<div>
<h3>Java Reference</h3>
<span>Java package API documentation</span>
</div>
</a>
</div>
</section>

<section>
<h2>Guides</h2>
<div class="grid">
<a class="guide" href="https://github.com/ruby/prism/blob/main/docs/mapping.md">AST mapping</a>
<a class="guide" href="https://github.com/ruby/prism/blob/main/docs/build_system.md">Build system</a>
<a class="guide" href="https://github.com/ruby/prism/blob/main/docs/configuration.md">Configuration</a>
<a class="guide" href="https://github.com/ruby/prism/blob/main/docs/design.md">Design</a>
<a class="guide" href="https://github.com/ruby/prism/blob/main/docs/encoding.md">Encoding</a>
<a class="guide" href="https://github.com/ruby/prism/blob/main/docs/parser_translation.md">Parser translation</a>
<a class="guide" href="https://github.com/ruby/prism/blob/main/docs/ruby_api.md">Ruby API</a>
<a class="guide" href="https://github.com/ruby/prism/blob/main/docs/serialization.md">Serialization</a>
</div>
</section>
</main>
<footer>
<img id="logo" src="images/prism.png" alt="Prism">
<a href="https://github.com/ruby/prism">GitHub</a>
<a href="https://github.com/ruby/prism/blob/main/CHANGELOG.md">Changelog</a>
<a href="https://rubygems.org/gems/prism">RubyGems</a>
</footer>
</body>
</html>
Loading