Skip to content

Commit

Permalink
Merge pull request #132 from OAI/specification
Browse files Browse the repository at this point in the history
PR to set up infra for publishing a respec version of moonwalk
  • Loading branch information
darrelmiller authored Jun 10, 2024
2 parents 3123a9f + da486ca commit 14cc1e6
Show file tree
Hide file tree
Showing 8 changed files with 2,209 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ concurrency:
cancel-in-progress: false

jobs:

# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install respec
- name: Generate Editors draft
shell: powershell
run: ./scripts/generate.ps1
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
Expand Down
6 changes: 6 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Moonwalk

The OpenAPI Moonwalk [Special Interest Group](https://learn.openapis.org/glossary.html) (SIG) is working on the next major release of the OpenAPI Specification (OAS), version 4.0, with a goal of [publishing by the end of 2024](https://www.openapis.org/blog/2023/12/06/openapi-moonwalk-2024).


[Editors Draft](moonwalk.html)
15 changes: 15 additions & 0 deletions doc/initial-proposals/examples/FlatOperations/OperationList.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
openapi: 4.0.0
operations:
- id: GetFlat
name: Get
method: GET
uriTemplate: /api/v1/flat
description: Get a list of flat objects
responses:
- status: 200
description: OK
contentType: application/json
schema:
type: array
items:
$ref: '#/components/schemas/Flat'
1,383 changes: 1,383 additions & 0 deletions doc/moonwalk.html

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions scripts/Generate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Usage: .\Generate.ps1

$SpecName = "moonwalk"
# get the folder of the script
$ScriptFolder = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$SpecFolder = Join-Path -Path $ScriptFolder -ChildPath "..\specification"
$OutputFolder = Join-Path -Path $ScriptFolder -ChildPath "..\doc"

$HostFile = Join-Path -Path $SpecFolder -ChildPath ($SpecName + "-host.html")
$SourceFile = Join-Path -Path $SpecFolder -ChildPath ($SpecName + "-source.md")
$MergedFile = Join-Path -Path $SpecFolder -ChildPath ($SpecName + "-merged.html")
$OutputFile = Join-Path -Path $OutputFolder -ChildPath ($SpecName + ".html")

# Outer HTML template
$template = Get-Content $HostFile

# Core Markdown content
$content = Get-Content $SourceFile -raw

# Replace the content in the template
$template = $template -replace "<!-- CONTENT -->", $content
$template | Set-Content $MergedFile

# Do Respec processing on the merged file
& respec --src $MergedFile --out $OutputFile

Remove-Item $MergedFile
15 changes: 15 additions & 0 deletions specification/moonwalk-host.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<title>Moonwalk</title>

<head>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove" defer></script>
<script class="remove" src="respecConfig.js"></script>
</head>

<body>
<!-- CONTENT -->

</body>

</html>
720 changes: 720 additions & 0 deletions specification/moonwalk-source.md

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions specification/respecConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Need to figure out how to make this https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/yaml.min.js
// work with the example here https://github.com/speced/respec/wiki/pre-and-code-elements

var respecConfig = {
//preProcess: [loadYaml],
// isPreview: true,
format: "markdown",
noTOC: false,
maxTocLevel: 3,
// additionalCopyrightHolders: "the Linux Foundation",
// includePermalinks: true,
latestVersion: "https://spec.openapis.org/oas/v3.1.0",
github: {
repoURL: "https://github.com/OAI/sig-moonwalk/",
branch: "main"
},
logos:[{src:"https://raw.githubusercontent.com/OAI/OpenAPI-Style-Guide/master/graphics/bitmap/OpenAPI_Logo_Pantone.png",alt:"OpenAPI Initiative",height:48,url:"https://openapis.org/"}],
specStatus: "unofficial", //Use "unofficial" for unofficial drafts
shortName: "moonwalk-draft", // This should become part of the latestVersion URL
editors: [
{
name: "TBD"
}
],
localBiblio: {
"CommonMark": {
"title": "CommonMark syntax",
"href": "https://spec.commonmark.org/",
"status": "Living Standard",
"publisher": "John MacFarlane"
}
}

}

0 comments on commit 14cc1e6

Please sign in to comment.