StefMa / pkl-gha

A Pkl (https://pkl-lang.org/) template for writing GitHub Action workflows
MIT License
7 stars 0 forks source link

Generate Pkldoc and deploy to GitHub pages #27

Open StefMa opened 2 weeks ago

StefMa commented 2 weeks ago

See https://pkl-lang.org/main/current/pkl-doc/index.html

StefMa commented 1 week ago

I played around with it a bit. Here are some notes how to do that:

  1. Create doc-package-info.pkl
    
    /// Write GitHub Action Workflows with Pkl
    amends "pkl:DocPackageInfo"

name = "com.github" version = "0.0.4-SNAPSHOT" importUri = "package://pkg.pkl-lang.org/github.com/stefma/pkl-gha/com.github.action@(version)/" issueTracker = "https://github.com/stefma/pkl-gha/issues" sourceCode = "https://github.com/stefma/pkl-gha" authors { "Stefan M. StefMaDev@outlook.com" }


2. [Install jbang](https://www.jbang.dev/download/) and create the docs
```bash
jbang run --main org.pkl.doc.Main "org.pkl-lang:pkl-doc:0.26.3" GitHubAction.pkl doc-package-info.pkl -o .out
  1. Because I do this on GitHub Codespaces, start a webserver:
    python3.12 -m http.server 4242 -d out

Then make this port public via codespaces: https://docs.github.com/en/codespaces/developing-in-a-codespace/forwarding-ports-in-your-codespace