You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ja...@apache.org on 2026/05/02 20:42:22 UTC
(grails-static-website) 01/01: Polish code-block rendering and tighten the README contributor flow
This is an automated email from the ASF dual-hosted git repository.
jamesfredley pushed a commit to branch improve-code-block-styling
in repository https://gitbox.apache.org/repos/asf/grails-static-website.git
commit 91d928d2a5c6ce64e3ec6d2de59b7d17cc2e8bd7
Author: James Fredley <ja...@users.noreply.github.com>
AuthorDate: Sat May 2 16:42:15 2026 -0400
Polish code-block rendering and tighten the README contributor flow
Code-block CSS (buildSrc/src/main/template/css/main.css):
- Inline <code> in narrative paragraphs (p, li, td, dd, dt, h1-h6) now gets a subtle gray pill background + small color shift so it stands out from regular prose. Block <code> inside <pre> is unchanged.
- The <code data-lang='...'> label on every listing block is now always visible (was hover-only on desktop) with a small inset chip so it doesn't look like it's escaping the box.
- The 'filename' caption above each listing block (the .title block, e.g. 'grails-app/views/_fields/manyToOne/_widget.gsp') now sits flush against the code below as a gray header bar with monospace text, instead of floating italic text disconnected from the block.
- Listings with a title get square top corners on the <pre> so the title bar and the code meet seamlessly.
- Listings now overflow horizontally instead of word-wrapping mid-token, so long lines stay readable.
README.md - Requesting a sample-app repository section:
- Removed the dev-mailing-list and Slack bullet points - we already point readers at the community page just one sentence above; the bullets duplicated that and are out of step with how a contributor actually requests a repo today (most ask via Slack DM or a GitHub issue, not a mailing list email with a guide-name request).
- Updated the post-provisioning sentence: A PMC member creates the repo and sets the default branch, then the contributor opens a PR from their personal GitHub fork (not push directly to grails-guides/<name>, which would require write access on grails-guides org).
Verified by re-rendering grails-fields-custom-widgets-and-wrappers v8: the new selectors land in build/dist/guides/.../css/main.css at lines 1221-1271.
Assisted-by: claude-code:claude-opus-4-7
---
README.md | 7 +---
buildSrc/src/main/template/css/main.css | 66 ++++++++++++++++++++++++++++++++-
2 files changed, 67 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 21547e2a4ea..9471736b0d8 100644
--- a/README.md
+++ b/README.md
@@ -203,12 +203,9 @@ Sample-app flavour adds `sampleRef`:
Repositories under [`https://github.com/grails-guides`](https://github.com/grails-guides) are owned and provisioned by the Apache Grails PMC. Sample-app flavour guides need one of these repositories before the guide can ship.
-**Contact the PMC via the [community page](https://grails.apache.org/community.html):**
+Contact the PMC via the [community page](https://grails.apache.org/community.html).
-- **Dev mailing list**: subscribe by sending a blank email to [`dev-subscribe@grails.apache.org`](mailto:dev-subscribe@grails.apache.org), then post your request to [`dev@grails.apache.org`](https://lists.apache.org/list.html?dev@grails.apache.org). Include the proposed guide name, a one-line description, and which Grails major version(s) the sample will target.
-- **Slack**: join via [https://slack.grails.org](https://slack.grails.org) and ping the PMC in the appropriate channel.
-
-A PMC member with org-admin access on `grails-guides` will create the repository, set the default branch (the latest `grails<N>` you target), and grant you push access. From there you push your `initial/` (and optionally `complete/`) tree as normal.
+A PMC member with org-admin access on `grails-guides` will create the repository, set the default branch (the latest `grails<N>` you target). Then you will create a PR from your personal GitHub fork.
### Local validation checklist
diff --git a/buildSrc/src/main/template/css/main.css b/buildSrc/src/main/template/css/main.css
index cddebbd6443..c665d27dbaf 100644
--- a/buildSrc/src/main/template/css/main.css
+++ b/buildSrc/src/main/template/css/main.css
@@ -1214,4 +1214,68 @@ table.CodeRay td.code>pre{padding:0}
.CodeRay .insert .insert{color:#080}
.CodeRay .delete .delete{color:#800}
.CodeRay .change .change{color:#66f}
-.CodeRay .head .head{color:#f4f}
\ No newline at end of file
+.CodeRay .head .head{color:#f4f}
+
+/* ---- Code-block + inline-code refinements (apache/grails-static-website) ---- */
+
+/* Inline <code> in narrative paragraphs gets a subtle pill background so it
+ stands out from regular prose. Excludes <code> inside <pre> blocks so the
+ syntax-highlighted listings keep their existing flush layout. */
+p > code,
+li > code,
+td > code,
+dd > code,
+dt > code,
+h1 > code, h2 > code, h3 > code, h4 > code, h5 > code, h6 > code {
+ background: #f3f3f4;
+ padding: 0.12em 0.35em;
+ border-radius: 3px;
+ font-size: 0.92em;
+ color: #c7254e;
+ word-break: break-word;
+}
+
+/* The block-code language label was hover-only on desktop; show it always so
+ readers can see the language without mousing over. Also pin it slightly
+ inside the rounded corner so it doesn't look like it's escaping the box. */
+.listingblock code[data-lang]:before {
+ display: block;
+ top: 0.35rem;
+ right: 0.6rem;
+ padding: 0.05em 0.4em;
+ background: rgba(0, 0, 0, 0.05);
+ border-radius: 3px;
+ letter-spacing: 0.04em;
+}
+
+/* The "filename" caption above each listing block (rendered from the
+ "[source,html]\n.path/to/file"-style title) is currently styled like a
+ floating italic line with no visual connection to the code below. Bind
+ it visually to the listing by giving it a top-rounded gray bar that
+ sits flush against the code block. */
+.listingblock > .title {
+ background: #ebebed;
+ color: #555;
+ font-style: normal;
+ font-family: "Droid Sans Mono", "DejaVu Sans Mono", monospace;
+ font-size: 0.78em;
+ padding: 0.4em 0.9em;
+ border-radius: 4px 4px 0 0;
+ margin-bottom: 0;
+ border-bottom: 1px solid #dcdcde;
+}
+
+/* When a listing has a title, square off the top corners of the pre so the
+ title and code meet seamlessly. */
+.listingblock > .title + .content > pre,
+.listingblock > .title + .content > pre[class] {
+ border-radius: 0 0 4px 4px;
+}
+
+/* Slightly relax horizontal scrolling so long lines don't wrap mid-token. */
+.listingblock pre,
+.listingblock pre[class] {
+ overflow-x: auto;
+ word-wrap: normal;
+ white-space: pre;
+}
\ No newline at end of file