-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add restylers-docs, generates _docs/restylers.md
This will replace https://docs.restyled.io/restylers.
- Loading branch information
Showing
16 changed files
with
412 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ jobs: | |
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: tools | ||
path: ${{ steps.stack.outputs.local-install-root }}/bin/restylers | ||
path: "${{ steps.stack.outputs.local-install-root }}/bin/*" | ||
if-no-files-found: error | ||
|
||
changes: | ||
|
@@ -148,6 +148,41 @@ jobs: | |
manifest: ./restylers.yaml | ||
dry-run: true | ||
|
||
update-docs: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
needs: | ||
- tools | ||
- restylers | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: {name: tools} | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: {name: manifest} | ||
|
||
- name: Update and commit _docs | ||
run: | | ||
chmod +x ./restylers-docs | ||
./restylers-docs "$GH_SHA" restylers.yaml > _docs/restylers.md | ||
git config user.name "github-actions[bot]" | ||
git config user.email "[email protected]" | ||
if ! git commit -m "Update docs" _docs/restylers.md; then | ||
echo "No documentation changes" | ||
exit 0 | ||
fi | ||
git push | ||
env: | ||
GH_SHA: ${{ github.sha }} | ||
|
||
release: | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
needs: [restylers] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- | | ||
-- | ||
-- Module : Main | ||
-- Copyright : (c) 2025 Patrick Brisbin | ||
-- License : AGPL-3 | ||
-- Maintainer : [email protected] | ||
-- Stability : experimental | ||
-- Portability : POSIX | ||
module Main (main) where | ||
|
||
import Restylers.Docs.Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: restylers-docs | ||
version: 0.0.0.0 | ||
license: AGPL-3 | ||
|
||
language: GHC2021 | ||
|
||
default-extensions: | ||
- DataKinds | ||
- DeriveAnyClass | ||
- DerivingStrategies | ||
- DerivingVia | ||
- DuplicateRecordFields | ||
- GADTs | ||
- LambdaCase | ||
- NamedFieldPuns | ||
- NoFieldSelectors | ||
- NoImplicitPrelude | ||
- NoMonomorphismRestriction | ||
- NoPostfixOperators | ||
- OverloadedRecordDot | ||
- OverloadedStrings | ||
- QuasiQuotes | ||
- TypeFamilies | ||
|
||
ghc-options: | ||
- -fignore-optim-changes | ||
- -fwrite-ide-info | ||
- -Weverything | ||
- -Wno-all-missed-specialisations | ||
- -Wno-missed-specialisations | ||
- -Wno-missing-import-lists | ||
- -Wno-missing-kind-signatures | ||
- -Wno-missing-safe-haskell-mode | ||
- -Wno-prepositive-qualified-module | ||
- -Wno-unsafe | ||
|
||
dependencies: | ||
- base | ||
|
||
library: | ||
source-dirs: src | ||
dependencies: | ||
- aeson | ||
- restylers | ||
- shakespeare | ||
- text | ||
- yaml | ||
|
||
executables: | ||
restylers-docs: | ||
main: Main.hs | ||
source-dirs: app | ||
dependencies: | ||
- restylers-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
cabal-version: 1.12 | ||
|
||
-- This file has been generated from package.yaml by hpack version 0.37.0. | ||
-- | ||
-- see: https://github.com/sol/hpack | ||
|
||
name: restylers-docs | ||
version: 0.0.0.0 | ||
license: AGPL-3 | ||
build-type: Simple | ||
|
||
library | ||
exposed-modules: | ||
Restylers.Docs.Main | ||
Restylers.Docs.Prelude | ||
Restylers.Docs.Render | ||
other-modules: | ||
Paths_restylers_docs | ||
hs-source-dirs: | ||
src | ||
default-extensions: | ||
DataKinds | ||
DeriveAnyClass | ||
DerivingStrategies | ||
DerivingVia | ||
DuplicateRecordFields | ||
GADTs | ||
LambdaCase | ||
NamedFieldPuns | ||
NoFieldSelectors | ||
NoImplicitPrelude | ||
NoMonomorphismRestriction | ||
NoPostfixOperators | ||
OverloadedRecordDot | ||
OverloadedStrings | ||
QuasiQuotes | ||
TypeFamilies | ||
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe | ||
build-depends: | ||
aeson | ||
, base | ||
, restylers | ||
, shakespeare | ||
, text | ||
, yaml | ||
default-language: GHC2021 | ||
|
||
executable restylers-docs | ||
main-is: Main.hs | ||
other-modules: | ||
Paths_restylers_docs | ||
hs-source-dirs: | ||
app | ||
default-extensions: | ||
DataKinds | ||
DeriveAnyClass | ||
DerivingStrategies | ||
DerivingVia | ||
DuplicateRecordFields | ||
GADTs | ||
LambdaCase | ||
NamedFieldPuns | ||
NoFieldSelectors | ||
NoImplicitPrelude | ||
NoMonomorphismRestriction | ||
NoPostfixOperators | ||
OverloadedRecordDot | ||
OverloadedStrings | ||
QuasiQuotes | ||
TypeFamilies | ||
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe | ||
build-depends: | ||
base | ||
, restylers-docs | ||
default-language: GHC2021 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-- | | ||
-- | ||
-- Module : Restylers.Docs.Main | ||
-- Copyright : (c) 2025 Patrick Brisbin | ||
-- License : AGPL-3 | ||
-- Maintainer : [email protected] | ||
-- Stability : experimental | ||
-- Portability : POSIX | ||
module Restylers.Docs.Main | ||
( main | ||
) where | ||
|
||
import Restylers.Docs.Prelude | ||
|
||
import Data.Text.IO qualified as T | ||
import Data.Yaml qualified as Yaml | ||
import Restylers.Docs.Render | ||
import System.Environment (getArgs) | ||
import System.Exit (ExitCode (..), exitWith) | ||
import System.IO (hPutStrLn, stderr) | ||
|
||
main :: IO () | ||
main = do | ||
args <- getArgs | ||
case args of | ||
[ref, path] -> do | ||
restylers <- Yaml.decodeFileThrow path | ||
T.putStrLn $ renderDocs (pack ref) restylers | ||
_ -> do | ||
hPutStrLn stderr "Usage: restyler-docs <ref> <manifest>" | ||
exitWith $ ExitFailure 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- | | ||
-- | ||
-- Module : Restylers.Docs.Prelude | ||
-- Copyright : (c) 2025 Patrick Brisbin | ||
-- License : AGPL-3 | ||
-- Maintainer : [email protected] | ||
-- Stability : experimental | ||
-- Portability : POSIX | ||
module Restylers.Docs.Prelude | ||
( module X | ||
) where | ||
|
||
import Data.Text as X (Text, pack, unpack) | ||
import Prelude as X |
Oops, something went wrong.