-
Notifications
You must be signed in to change notification settings - Fork 0
chore(draft): setup github action for generating editor's draft .html/ .docx #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
18dc4ee
chore(draft): setup github action for generating working draft .html/…
awoie d100b97
chore(draft): address build-pipeline review feedback
awoie 5f6edf2
fix(build): make html/docx work out of the box
awoie fe3cf56
fix(draft): don't assert an IETF stream on an OIDF/ISO document
awoie 4dd687e
fix(ci): trigger the build workflow on tests/** changes
jogu 396bd32
fix(template): sanitize the committed pandoc reference docx
jogu 03ea681
fix(tools): track code fences per CommonMark in the pandoc converter
jogu f2efb4b
fix(tools): make front-matter splitting robust in the pandoc converter
jogu 2c43a97
fix(tools): end the abstract drop at setext headings too
jogu b914059
fix(tools): drop indented '.# Abstract' and '{: ...}' lines too
jogu 19f1b8a
fix(tools): split converter input on newlines only
jogu 465a994
fix(template): remove the ISO source template; guard the committed docx
jogu 4813589
chore: cleanup pass over the build/test pipeline
jogu 0ab620e
chore: add acknowledgement and doc history
awoie 75ec92a
chore: move tests and template to tools folder
awoie 74e5faa
fix: added placeholder to acknowledgements section
awoie e63e6c5
fix: remove requirements section
awoie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,108 @@ | ||
| name: Build DCHP specification | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'draft/**' | ||
| - 'tools/**' | ||
| - 'Makefile' | ||
| - '.github/workflows/build.yml' | ||
| pull_request: | ||
| paths: | ||
| - 'draft/**' | ||
| - 'tools/**' | ||
| - 'Makefile' | ||
| - '.github/workflows/build.yml' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| DOC: digital-credentials-harmonized-presentation | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build HTML Editor's Copy and ISO Word document | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # HTML Editor's Copy (markdown2rfc / mmark), same tooling as other OpenID | ||
| # DCP specifications; published to GitHub Pages below. | ||
| - name: Render HTML Editor's Copy | ||
| run: make html | ||
|
|
||
| # Pin the interpreter: the mmark->pandoc converter needs tomllib (3.11+). | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Run tests | ||
| run: make test | ||
|
|
||
| # ISO-styled Word document (pandoc), for sharing the draft with ISO. | ||
| # Delivered as a workflow artifact only; not published to the site. | ||
| # Pinned .deb release so the .docx rendering is reproducible (and faster | ||
| # than `apt-get update && install`, which pulls whatever the runner has). | ||
| - name: Install pandoc | ||
| env: | ||
| PANDOC_VERSION: '3.8.3' | ||
| run: | | ||
| curl -fsSL -o /tmp/pandoc.deb \ | ||
| "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb" | ||
| sudo dpkg -i /tmp/pandoc.deb | ||
|
|
||
| - name: Render ISO Word document | ||
| run: make docx | ||
|
|
||
| - name: Assemble HTML for GitHub Pages | ||
| run: | | ||
| mkdir -p _site | ||
| cp build/*.html _site/ | ||
| # Redirect the bare Pages URL to the Editor's Copy (avoids a root 404). | ||
| printf '<!doctype html>\n<meta http-equiv="refresh" content="0; url=%s-editors-copy.html">\n' \ | ||
| "${{ env.DOC }}" > _site/index.html | ||
|
|
||
| - name: Upload site artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: site | ||
| path: _site | ||
|
|
||
| - name: Upload ISO Word document artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: iso-word-document | ||
| path: build/${{ env.DOC }}.docx | ||
|
|
||
| publish-to-pages: | ||
| name: Publish Editor's Copy to GitHub Pages | ||
| if: github.ref == 'refs/heads/main' | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| # Serialise Pages deployments so two quick merges to main can't race (one | ||
| # failing with "a deployment is already in progress", or publishing stale). | ||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false | ||
| permissions: | ||
| pages: write | ||
| id-token: write | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - name: Download site artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: site | ||
| path: _site | ||
| - name: Upload Pages artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: _site | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
This file contains hidden or 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
This file contains hidden or 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,81 @@ | ||
| # Build the DCHP specification. | ||
| # | ||
| # make html - render the HTML Editor's Copy with markdown2rfc (Docker) | ||
| # make docx - render the ISO-styled Word document with pandoc | ||
| # make all - build both | ||
| # make test - run the test suite | ||
| # make clean - remove the build/ directory | ||
| # | ||
| # Source scripts live in tools/; everything generated goes to build/ (which is | ||
| # git-ignored). `make html` needs Docker; `make docx` needs pandoc and a Python | ||
| # with tomllib (3.11+, for the converter). | ||
|
|
||
| SRCDIR := draft | ||
| DOC := digital-credentials-harmonized-presentation | ||
| SRC := $(SRCDIR)/$(DOC).md | ||
|
|
||
| TOOLS := tools | ||
| BUILD := build | ||
|
|
||
| # The mmark->pandoc converter needs tomllib (Python 3.11+). Auto-pick the first | ||
| # available interpreter that has it, so `make docx` works even where the default | ||
| # python3 is older; override explicitly with `make docx PYTHON=/path/to/python`. | ||
| PYTHON ?= $(shell for p in python3 python3.13 python3.12 python3.11; do \ | ||
| command -v $$p >/dev/null 2>&1 && $$p -c 'import tomllib' >/dev/null 2>&1 \ | ||
| && { echo $$p; exit 0; }; \ | ||
| done) | ||
|
|
||
| # Pinned by digest so the HTML rendering is reproducible: an untagged/:latest | ||
| # image could silently change the output between identical commits. Regenerate | ||
| # the digest with `docker inspect --format '{{index .RepoDigests 0}}' <image>`. | ||
| MD2RFC_IMAGE := danielfett/markdown2rfc@sha256:7b4412559d6ba5db45a14174a28da5b240512e7c2a886a5e4adb44e5e67f34ca | ||
|
|
||
| # Reference document with the ISO styles/layout, committed to the repo (derived | ||
| # once from the ISO template by tools/make-iso-reference.py; not regenerated per | ||
| # build). The ISO template itself is not committed — see that script's docstring. | ||
| REFDOC := $(TOOLS)/template/iso-reference.docx | ||
|
|
||
| HTML_OUT := $(BUILD)/$(DOC)-editors-copy.html | ||
|
|
||
| .PHONY: all html docx test clean need-python | ||
|
|
||
| all: html docx | ||
|
|
||
| # The converter and the tests need $(PYTHON); fail with guidance if none found. | ||
| need-python: | ||
| @test -n "$(strip $(PYTHON))" || { \ | ||
| echo "error: no Python with tomllib (3.11+) found;"; \ | ||
| echo " install one or run: make <target> PYTHON=/path/to/python3.11+"; \ | ||
| exit 1; } | ||
|
|
||
| ## HTML Editor's Copy (markdown2rfc / mmark) -> build/ | ||
| html: $(SRC) | ||
| # Clean stale intermediates first so the copy below is unambiguous even if a | ||
| # previous run was interrupted. | ||
| rm -f $(SRCDIR)/$(DOC)*.html $(SRCDIR)/$(DOC)*.xml $(SRCDIR)/$(DOC)*.txt | ||
| docker run --rm -v "$(CURDIR)/$(SRCDIR):/data" $(MD2RFC_IMAGE) $(DOC).md | ||
| mkdir -p $(BUILD) | ||
| # Cleaned above, so this glob now matches exactly the fresh output whatever | ||
| # markdown2rfc names it (it may add a draft-version suffix). | ||
| cp $(SRCDIR)/$(DOC)*.html $(HTML_OUT) | ||
| rm -f $(SRCDIR)/$(DOC)*.html $(SRCDIR)/$(DOC)*.xml $(SRCDIR)/$(DOC)*.txt | ||
| @echo "HTML Editor's Copy -> $(HTML_OUT)" | ||
|
|
||
| ## ISO-styled Word document (pandoc) -> build/ | ||
| docx: need-python $(SRC) $(REFDOC) $(TOOLS)/mmark-to-pandoc.py $(TOOLS)/iso-styles.lua | ||
| mkdir -p $(BUILD) | ||
| $(PYTHON) $(TOOLS)/mmark-to-pandoc.py < $(SRC) > $(BUILD)/$(DOC).pandoc.md | ||
| pandoc $(BUILD)/$(DOC).pandoc.md \ | ||
| --reference-doc=$(REFDOC) \ | ||
| --lua-filter=$(TOOLS)/iso-styles.lua \ | ||
| -o $(BUILD)/$(DOC).docx | ||
| rm -f $(BUILD)/$(DOC).pandoc.md | ||
| @echo "ISO Word document -> $(BUILD)/$(DOC).docx" | ||
|
|
||
| ## Test suite (every tools/tests/test_*.py, so new tests run without editing this) | ||
| test: need-python | ||
| @for t in $(TOOLS)/tests/test_*.py; do $(PYTHON) $$t || exit 1; done | ||
|
|
||
| clean: | ||
| rm -rf $(BUILD) | ||
| rm -f $(SRCDIR)/$(DOC)*.html $(SRCDIR)/$(DOC)*.xml $(SRCDIR)/$(DOC)*.txt |
This file contains hidden or 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
This file contains hidden or 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,120 @@ | ||
| %%% | ||
| title = "Digital Credentials Harmonized Presentation - Editor's Copy" | ||
| abbrev = "dchp" | ||
| ipr = "none" | ||
| workgroup = "Digital Credentials Harmonized Presentation" | ||
| keyword = ["digital credentials", "mdoc", "sd-jwt vc", "presentation", "iso"] | ||
|
|
||
| # NOTE: this [seriesInfo] block is IETF Internet-Draft scaffolding needed by the | ||
| # markdown2rfc (mmark/xml2rfc) HTML toolchain; it is NOT a claim that this is an | ||
| # IETF document. mmark 2.2.31 hard-codes <rfc submissionType="IETF"> and does not | ||
| # propagate the stream, so a non-IETF stream (e.g. "independent") makes xml2rfc | ||
| # fail with a stream/submissionType mismatch. We therefore leave "stream" unset | ||
| # rather than assert a false "IETF" stream; mmark only warns ("Empty 'stream'") | ||
| # and the HTML still builds. The real publication reference for this OpenID/ISO | ||
| # joint document is a WG/SDO decision -- see issue 13. | ||
| [seriesInfo] | ||
| name = "Internet-Draft" | ||
| value = "digital-credentials-harmonized-presentation" | ||
| status = "standard" | ||
|
|
||
| [[author]] | ||
| initials = "TBD" | ||
| surname = "Editor" | ||
| fullname = "TBD Editor" | ||
| organization = "OpenID Foundation" | ||
| [author.address] | ||
| email = "openid-specs-dchp@lists.openid.net" | ||
|
|
||
| %%% | ||
|
|
||
| .# Abstract | ||
|
|
||
| This document specifies a harmonized protocol for the presentation of digital | ||
| credentials, bringing together the credential presentation approaches of | ||
| ISO/IEC 18013-5 and OpenID for Verifiable Presentations across multiple | ||
| credential formats, including ISO mdoc and IETF SD-JWT VC. | ||
|
|
||
| .# Foreword | ||
|
|
||
| This specification has been jointly developed by members of ISO/IEC JTC 1/SC 17 | ||
| WG 10 and members of the OpenID Foundation Digital Credentials Protocols (DCP) | ||
| Working Group, under the OpenID Foundation's Digital Credentials Harmonized | ||
| Presentation (DCHP) Working Group. | ||
|
|
||
| This is an Editor's Copy. It is a work in progress and is subject to change | ||
| at any time. | ||
|
|
||
| .# Introduction | ||
|
|
||
| ISO/IEC 18013-5 (Device Request / Device Response) and OpenID for Verifiable | ||
| Presentations (Authorization Request / Authorization Response) take different | ||
| approaches to credential presentation. This document defines a harmonized | ||
| digital credentials request protocol that brings these together, supporting both | ||
| in-person and online presentation and the coexistence of multiple credential | ||
| formats, including ISO mdoc and IETF SD-JWT VC. | ||
|
|
||
| The objective is to enable interoperability among the parties involved in the | ||
| presentation of digital credentials while allowing existing deployments to | ||
| continue to operate. | ||
|
|
||
| {mainmatter} | ||
|
|
||
| # Scope | ||
|
|
||
| To be completed. | ||
|
|
||
| # Normative references | ||
|
|
||
| The following documents are referred to in the text in such a way that some or | ||
| all of their content constitutes requirements of this document. | ||
|
|
||
| To be completed. | ||
|
|
||
| # Terms and definitions | ||
|
|
||
| For the purposes of this document, the following terms and definitions apply. | ||
|
|
||
| ISO and IEC maintain terminology databases for use in standardization at the | ||
| following addresses: | ||
|
|
||
| * ISO Online browsing platform: available at <https://www.iso.org/obp> | ||
| * IEC Electropedia: available at <https://www.electropedia.org/> | ||
|
|
||
| To be completed. | ||
|
|
||
| # Symbols and abbreviated terms | ||
|
|
||
| To be completed. | ||
|
|
||
| # Conventions | ||
|
|
||
| In this document, the following verbal forms are used: | ||
|
|
||
| * "shall" indicates a requirement; | ||
| * "should" indicates a recommendation; | ||
| * "may" indicates a permission; | ||
| * "can" indicates a possibility or a capability. | ||
|
|
||
| These verbal forms are used in accordance with ISO/IEC Directives, Part 2, | ||
| Clause 7 (see <https://www.iso.org/directives-and-policies.html>). | ||
|
|
||
| {backmatter} | ||
|
|
||
| # Bibliography | ||
|
|
||
| [1] ISO/IEC Directives, Part 2, *Principles and rules for the structure and | ||
| drafting of ISO and IEC documents* | ||
|
|
||
| # Acknowledgements {#Acknowledgements} | ||
|
|
||
| We would like to thank TBD for their | ||
| valuable feedback and contributions to this specification. | ||
|
|
||
| # Document History | ||
|
|
||
| [[ To be removed from the final specification ]] | ||
|
|
||
| -00 | ||
|
|
||
| * initial working draft |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure, but i do believe this would currently trigger twice for pushes to PRs - I believe we only want push to trigger on main?