Skip to content

Commit

Permalink
docs: add mkdocs and catalog-info (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Jun 12, 2023
1 parent ab59cf5 commit 401838d
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,26 @@ jobs:
display-name: RaBe Kafka on UBI9
tags: minimal rhel9 ubi9 rabe kafka
cosign-base-image-only: true
mkdocs:
runs-on: ubuntu-latest
permissions:
actions: none
checks: none
contents: write # for pushing gh-pages branch
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
id-token: none
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: pip install mkdocs mkdocs-material mkdocs-gen-files mkdocs-literate-nav mkdocs-section-index
- run: mkdocs build
- run: mkdocs gh-deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
18 changes: 18 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: kafka
description: Kafka on UBI9 Minimal
annotations:
backstage.io/techdocs-ref: dir:.
github.com/project-slug: radiorabe/container-image-kafka
links:
- url: https://kafka.apache.org/
title: Apache Kafka
spec:
type: container
lifecycle: experimental
owner: it-reaktion
dependsOn:
- component:default/rabe-ubi9-minimal
10 changes: 10 additions & 0 deletions docs/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* set primary color */
:root {
--md-primary-fg-color: #00C9BF;
--md-accent-fg-color: #00C9BF;
}

/* make code selectable on main */
.highlight .o {
user-select: none;
}
12 changes: 12 additions & 0 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Generate the code reference pages and navigation.
From https://mkdocstrings.github.io/recipes/
"""

from pathlib import Path

import mkdocs_gen_files

readme = Path("README.md").open("r")
with mkdocs_gen_files.open("index.md", "w", encoding="utf-8") as index_file:
index_file.writelines(readme.read())
46 changes: 46 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
site_name: Kafka on UBI9 Minimal
repo_url: https://github.com/radiorabe/container-image-kafka
repo_name: radiorabe/container-image-kafka

theme:
name: "material"
palette:
# Palette toggle for dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
# Palette toggle for light mode
- scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
icon:
repo: fontawesome/brands/git-alt
features:
- content.code.copy
- toc.integrate

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences

extra_css:
- css/style.css

plugins:
- search
- gen-files:
scripts:
- docs/gen_ref_pages.py
- literate-nav
- section-index

nav:
- README: index.md

watch:
- README.md

0 comments on commit 401838d

Please sign in to comment.