Skip to content

Commit

Permalink
Use separate ronn packages
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Nov 1, 2024
1 parent 0170b7b commit 0f651c7
Show file tree
Hide file tree
Showing 16 changed files with 217 additions and 456 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,54 @@ jobs:
files: "*-binaries/restyler-*.tar.gz"
fail_on_unmatched_files: true

docs:
#if: ${{ github.ref == 'refs/heads/main' }}
needs: [build]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- run: echo "$HOME/.local/share/gem/ruby/3.0.0/bin" >>"$GITHUB_PATH"
- run: gem install --user ronn-ng
- uses: actions/download-artifact@v4
with:
name: linux-binaries
- run: |
tar xzf restyler-*.tar.gz
mkdir -p ./bin
sudo mv -v restyler-*/restyle /usr/local/bin
# TODO: only checkout doc folder
- uses: actions/checkout@v4

- name: Generate ronn documenation
run: |
restyle __render-docs-man1__ > doc/restyle.1.ronn
restyle __render-docs-man5__ > doc/restyled.yaml.5.ronn
- name: Generate HTML sources to _site
run: |
env \
RONN_STYLE=./doc \
RONN_ORGANIZATION=Restyled \
RONN_MANUAL="Restyler v$(restyle --version | cut -d' ' -f 2)" \
ronn --style toc,custom --roff --html doc/*.ronn
mkdir -p _site/man-pages
cp -v doc/*.html _site/man-pages/
- uses: actions/configure-pages@v3
- uses: actions/upload-pages-artifact@v1
with:
path: _site
- id: deployment
uses: actions/deploy-pages@v1

test-install:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
.stack-work*
*.hie
**/.hiedb

doc/*
!doc/custom.css
!doc/index.txt
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ curl --proto '=https' --tlsv1.2 -sSf \

## Usage

See the [reference documentation](./doc/reference.txt).
See [`restyle(1)`][restyle.1] and [`restyled.yaml(5)`][restyled.yaml.5].

[restyle.1]: https://restyled-io.github.io/restyler/man-pages/restyle.1
[restyled.yaml.5]: https://restyled-io.github.io/restyler/man-pages/restyled.yaml.5

### GitHub Actions

Expand Down
22 changes: 22 additions & 0 deletions doc/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.mp h1,
.mp h2,
.mp h3,
.mp h4,
.mp h5,
.mp h6,
.mp code {
color: #A00000;
}

.mp var {
color: #006000;
}

.mp dd p {
margin-top: 20px;
}

ol.man-decor li.tc {
letter-spacing: inherit;
text-transform: none;
}
7 changes: 7 additions & 0 deletions doc/index.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# manuals included in this project:
restyle(1) restyle.1.ronn
restyled.yaml(5) restyled.yaml.5.ronn

# external manuals:
docker(1) https://manpages.org/docker
git(1) https://man.cx/git(1)
Loading

0 comments on commit 0f651c7

Please sign in to comment.