Skip to content

Commit

Permalink
Tweak docs formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Jan 11, 2025
1 parent bf245d3 commit 4b3d661
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions _tools/restylers-docs/src/Restylers/Docs/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ renderDocs = T.intercalate "\n\n" . map restylerMarkdown
restylerMarkdown :: Restyler -> Text
restylerMarkdown restyler =
[st|
## #{restyler.name}-restyler
## #{restyler.name} - #{restyler.image.tag}

- **Languages**: #{langs}
- **Tag**: `#{restyler.image.tag}` [see all](https://gallery.ecr.aws/restyled-io/restyler-#{restyler.name})
- **Links**:
Restyles #{langs}, #{runsAutomatically}.

- #{links}
<details class="documentation">
<summary>Documentation</summary>

- **Enabled by default?**: #{enabled}
- #{links}

</details>

<details class="config">
<summary>Configuration</summary>
Expand All @@ -50,13 +51,19 @@ restylers:
#{examplesMarkdown}

</details>

[See all available images](https://gallery.ecr.aws/restyled-io/restyler-#{restyler.name})
|]
where
langs :: Text
langs = T.intercalate ", " $ restyler.metadata.languages
langs =
T.intercalate ", " $ map (\x -> "_" <> x <> "_") $ restyler.metadata.languages

enabled :: Text
enabled = if restyler.enabled then "Yes" else "No"
runsAutomatically :: Text
runsAutomatically =
if restyler.enabled
then "runs automatically"
else "must be explicitly enabled"

infoYaml :: Text
infoYaml = T.intercalate "\n " $ T.lines $ decodeUtf8 $ Yaml.encode info
Expand All @@ -72,7 +79,7 @@ restylers:
]

links :: Text
links = T.intercalate "\n - " $ restyler.documentation
links = T.intercalate "\n- " $ restyler.documentation

examplesMarkdown :: Text
examplesMarkdown =
Expand Down

0 comments on commit 4b3d661

Please sign in to comment.