Skip to content

Commit 7d6031f

Browse files
authored
Recipe documentation rework (#459)
* Recipe structure rework Based on a request from marketing + Olga, we want to remove all proprietary recipes from the OpenRewrite docs and put them in the Moderne docs instead. As part of this, though, we want to add redirects to all of these pages so anyone using old links still can get to the docs. All open-source recipes (5087 right now - including source available ones) will still have their documentation here. The various reference files have also been updated to only include these open source recipes (other than the moderne recipe page). The GitHub actions workflow has also been updated to handle these new changes. * Add a few more recipes * De-duplicate recipes --------- Co-authored-by: Mike Solomon <mike-solomon@users.noreply.github.com>
1 parent d19e5d6 commit 7d6031f

File tree

590 files changed

+15037
-10393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

590 files changed

+15037
-10393
lines changed

.github/workflows/update-docs.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
repository: 'openrewrite/rewrite-recipe-markdown-generator'
3535
path: 'rewrite-recipe-markdown-generator'
3636
- name: Generate Markdown
37-
run: ./gradlew ${{ env.GRADLE_SWITCHES }} run -PlatestVersionsOnly=${{ github.event.inputs.latest-versions-only == 'true' }}
37+
run: ./gradlew run -PlatestVersionsOnly=${{ github.event.inputs.latest-versions-only == 'true' }}
3838
working-directory: rewrite-recipe-markdown-generator
3939

4040
# Checkout docs repository
@@ -50,26 +50,46 @@ jobs:
5050
git config user.email "team@moderne.io"
5151
git config user.name "team-moderne[bot]"
5252
53-
# Conditionally replace latest versions, as recipe runs lack certain language modules
53+
# Conditionally replace latest versions only
5454
- name: Replace latest versions
5555
if: ${{ inputs.latest-versions-only }}
5656
working-directory: rewrite-docs
5757
run: |
58-
cp ../rewrite-recipe-markdown-generator/build/docs/*.md docs/reference/
59-
cp ../rewrite-recipe-markdown-generator/build/docs/*.js src/plugins/
58+
cp ../rewrite-recipe-markdown-generator/build/docs/latest-versions-of-every-openrewrite-module.md docs/reference/
59+
cp ../rewrite-recipe-markdown-generator/build/docs/latest-versions.js src/plugins/
6060
git add docs/reference/latest-versions-of-every-openrewrite-module.md src/plugins/latest-versions.js
6161
62-
# Otherwise replace recipes only
63-
- name: Replace recipes
62+
# Full recipe update - replace recipes and all reference files
63+
- name: Replace recipes and reference files
6464
if: ${{ !inputs.latest-versions-only }}
6565
working-directory: rewrite-docs
6666
run: |
67+
# Replace recipes directory (contains all 5,000+ individual recipe markdown files)
6768
rm -rf docs/recipes/
6869
cp -r ../rewrite-recipe-markdown-generator/build/docs/recipes docs/recipes
69-
git add docs/recipes
70+
71+
# Copy reference/list files
72+
cp ../rewrite-recipe-markdown-generator/build/docs/all-recipes.md docs/reference/
73+
cp ../rewrite-recipe-markdown-generator/build/docs/recipes-by-tag.md docs/reference/
74+
cp ../rewrite-recipe-markdown-generator/build/docs/recipes-with-data-tables.md docs/reference/
75+
cp ../rewrite-recipe-markdown-generator/build/docs/scanning-recipes.md docs/reference/
76+
cp ../rewrite-recipe-markdown-generator/build/docs/standalone-recipes.md docs/reference/
77+
cp ../rewrite-recipe-markdown-generator/build/docs/moderne-recipes.md docs/reference/
78+
cp ../rewrite-recipe-markdown-generator/build/docs/latest-versions-of-every-openrewrite-module.md docs/reference/
79+
80+
# Copy JS plugin file
81+
cp ../rewrite-recipe-markdown-generator/build/docs/latest-versions.js src/plugins/
82+
83+
# Copy static HTML redirect pages for proprietary recipes -> Moderne
84+
# These are served at old recipe URLs and redirect to Moderne docs
85+
rm -rf static/recipes/
86+
cp -r ../rewrite-recipe-markdown-generator/build/docs/static/recipes static/recipes
87+
88+
# Stage all changes
89+
git add docs/recipes docs/reference src/plugins/latest-versions.js static/recipes
7090
7191
# Commit and push changes
7292
- name: Commit and push
7393
working-directory: rewrite-docs
7494
run: |
75-
git diff --quiet HEAD || (git commit -m "[Auto] Latest versions as of $(date +'%Y-%m-%dT%H%M')" && git push origin master)
95+
git diff --quiet HEAD || (git commit -m "[Auto] Update docs as of $(date +'%Y-%m-%dT%H%M')" && git push origin master)

docs/reference/all-recipes.md

Lines changed: 743 additions & 2195 deletions
Large diffs are not rendered by default.

docs/reference/latest-versions-of-every-openrewrite-module.md

Lines changed: 4 additions & 36 deletions
Large diffs are not rendered by default.

docs/reference/moderne-recipes.md

Lines changed: 695 additions & 532 deletions
Large diffs are not rendered by default.

docs/reference/recipes-by-tag.md

Lines changed: 345 additions & 1829 deletions
Large diffs are not rendered by default.

docs/reference/recipes-with-data-tables.md

Lines changed: 195 additions & 494 deletions
Large diffs are not rendered by default.

docs/reference/scanning-recipes.md

Lines changed: 259 additions & 340 deletions
Large diffs are not rendered by default.

docs/reference/standalone-recipes.md

Lines changed: 4620 additions & 4959 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://docs.moderne.io/user-documentation/recipes/recipe-catalog/ai/findagentsinuse">
6+
<link rel="canonical" href="https://docs.moderne.io/user-documentation/recipes/recipe-catalog/ai/findagentsinuse">
7+
<title>Redirecting to Find AI agents configuration files</title>
8+
<script>window.location.replace("https://docs.moderne.io/user-documentation/recipes/recipe-catalog/ai/findagentsinuse");</script>
9+
</head>
10+
<body>
11+
<p>This recipe has moved to Moderne docs.</p>
12+
<p>If you are not redirected automatically, <a href="https://docs.moderne.io/user-documentation/recipes/recipe-catalog/ai/findagentsinuse">click here</a>.</p>
13+
</body>
14+
</html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="refresh" content="0; url=https://docs.moderne.io/user-documentation/recipes/recipe-catalog/ai/findcommentslanguage">
6+
<link rel="canonical" href="https://docs.moderne.io/user-documentation/recipes/recipe-catalog/ai/findcommentslanguage">
7+
<title>Redirecting to Find comments' language distribution</title>
8+
<script>window.location.replace("https://docs.moderne.io/user-documentation/recipes/recipe-catalog/ai/findcommentslanguage");</script>
9+
</head>
10+
<body>
11+
<p>This recipe has moved to Moderne docs.</p>
12+
<p>If you are not redirected automatically, <a href="https://docs.moderne.io/user-documentation/recipes/recipe-catalog/ai/findcommentslanguage">click here</a>.</p>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)