Skip to content
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

Fix relaton index files #63

Merged
merged 17 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
af9741c
chore(scripts): Add canonicalize-document-paths
ribose-jeffreylau Feb 11, 2025
f199f42
fix: Bring back relaton index files
ribose-jeffreylau Feb 11, 2025
ea84a16
chore: Add rubocop for :development
ribose-jeffreylau Feb 17, 2025
fd86f43
chore(scripts): Convert canonicalize-document-paths to Ruby and optimize
ribose-jeffreylau Feb 17, 2025
0585043
chore(scripts): Fix rubocop issues
ribose-jeffreylau Feb 17, 2025
33e3da4
chore(scripts): Make canonicalize-document-paths work within reasonab…
ribose-jeffreylau Feb 17, 2025
fbb32c4
chore(scripts): Make canonicalize-document-paths less chatty
ribose-jeffreylau Feb 17, 2025
5f53fbf
chore(scripts): Make canonicalize-document-paths ignore *.err files
ribose-jeffreylau Feb 17, 2025
0204998
chore(Makefile): Simplify
ribose-jeffreylau Feb 17, 2025
6858c19
chore: Remove pubdocs/ since they are all generated elsewhere
ribose-jeffreylau Feb 17, 2025
76f7844
chore(Makefile): Make relaton indexes compile
ribose-jeffreylau Feb 17, 2025
ffb5910
chore(Makefile): Simplify and fix dependencies
ribose-jeffreylau Feb 17, 2025
876d59c
ci(build-docs): Restore GHA-level caching
ribose-jeffreylau Feb 17, 2025
77be9e7
chore(scripts): Fix script dependency on bundler
ribose-jeffreylau Feb 17, 2025
a579c22
ci: Configure BUNDLE_GEMFILE for metanorma-related tasks
ribose-jeffreylau Feb 17, 2025
ad7fecb
chore(Makefile): Fix relaton-related targets
ribose-jeffreylau Feb 17, 2025
bba9ebb
chore: Update paths to specific documents
ribose-jeffreylau Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,18 @@ jobs:
with:
submodules: 'recursive'
fetch-depth: 1

- name: Calculate cache key
id: cache-key
run: |
echo "cache-key=$(scripts/metacachekey metanorma src-documents/metanorma-${{ matrix.doc_type }}.yml)" >> $GITHUB_OUTPUT
- name: Restore cache
id: cache
uses: actions/cache@v4
with:
path: _site/${{ matrix.doc_type }}
key: ${{ steps.cache-key.outputs.cache-key }}
- name: Metanorma generate site
if: steps.cache.outputs.cache-hit != 'true'
uses: actions-mn/build-and-publish@main
with:
destination: artifact
Expand All @@ -94,6 +104,12 @@ jobs:
artifact-name: metanorma-docs-${{ matrix.doc_type }}
source-path: ./
config-file: src-documents/metanorma-${{ matrix.doc_type }}.yml
- name: Save artifacts
if: steps.cache.outputs.cache-hit == 'true'
uses: actions/upload-artifact@v4
with:
name: metanorma-docs-${{ matrix.doc_type }}
path: _site/${{ matrix.doc_type }}

#
# At the very end, integrate them all with Jekyll.
Expand All @@ -102,7 +118,12 @@ jobs:
name: Check aggregating artifacts with site
runs-on: ubuntu-latest
needs: [build-site, build-docs]
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/src-documents/Gemfile
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download Jekyll artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -120,6 +141,15 @@ jobs:
for dir in _site/metanorma-docs-*; do
mv "$dir" "${dir/metanorma-docs-}"
done
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.3
- name: Build Relaton index files
shell: bash
run: |
make build-relaton
- name: Debug
if: ${{ github.ref != 'refs/heads/main' }}
run: |
Expand Down
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?

group :development do
gem "rubocop", "~> 1.72", require: false
gem "rubocop-performance", "~> 1.24.0", require: false
end
105 changes: 97 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@

SHELL := /bin/bash

NAME_ORG := "CalConnect"
CSD_REGISTRY_NAME := "CalConnect Document Registry"
CANON_PUBLIC_PATH := cc
SITE_DIR := _site

BIB_OUTPUT_DIR := relaton
BIB_YAML_OUTPUT_DIR := $(BIB_OUTPUT_DIR)/yaml
BIB_XML_OUTPUT_DIR := $(BIB_OUTPUT_DIR)/rxl
BIB_OUTPUT_FORMATS := yaml rxl
BIB_OUTPUTS := $(foreach output_format,$(BIB_OUTPUT_FORMATS),$(BIB_OUTPUT_DIR)/index.$(output_format))

ifdef METANORMA_DOCKER
METANORMA_PREFIX_CMD := >&2 echo "Running via docker..."; docker run -v "$$(pwd)":/metanorma/ $(METANORMA_DOCKER)
else
Expand All @@ -13,8 +24,13 @@ all: prep build-all-parallel

.PHONY: clean
## Clean up generated files
clean:
rm -rf _site
clean: clean-bib
rm -rf $(SITE_DIR)

.PHONY: clean-bib
## Clean up generated Relaton files
clean-bib:
rm -rf $(BIB_OUTPUT_DIR)

# `bundle` command alias just for Jekyll
JEKYLL_BUNDLE = bundle
Expand Down Expand Up @@ -56,7 +72,7 @@ repopulate-metanorma-yaml-$(doc_type):
## Build Metanorma document artifacts for $(doc_type)
build-$(doc_type):
$(METANORMA_PREFIX_CMD) metanorma site generate \
-o _site/$(doc_type) \
-o $(SITE_DIR)/$(doc_type) \
-c ./src-documents/metanorma-$(doc_type).yml
endef

Expand All @@ -69,24 +85,24 @@ repopulate-metanorma-yamls: $(addprefix repopulate-metanorma-yaml-,$(REPOPULATIN
.PHONY: repopulate-metanorma-yamls-parallel
## Update Metanorma YAML files (`metanorma.source.files`) for all doc types in parallel
repopulate-metanorma-yamls-parallel:
$(foreach doc_type,$(REPOPULATING_DOC_TYPES),make repopulate-metanorma-yaml-$(doc_type) &) wait
$(foreach doc_type,$(REPOPULATING_DOC_TYPES),$(MAKE) -s repopulate-metanorma-yaml-$(doc_type) &) wait

.PHONY: build
## Build all the documents in sequence
build: $(addprefix build-,$(DOC_TYPES))

.PHONY: build-all
## Build Jekyll, then build all the documents in sequence
build-all: _site build
build-all: $(SITE_DIR) build build-relaton

.PHONY: build-parallel
## Build all the documents in parallel
build-parallel:
$(foreach doc_type,$(DOC_TYPES),make build-$(doc_type) &) wait
$(foreach doc_type,$(DOC_TYPES),$(MAKE) -s build-$(doc_type) &) wait

.PHONY: build-all-parallel
## Build Jekyll, then build all the documents in parallel
build-all-parallel: _site build-parallel
build-all-parallel: $(SITE_DIR) build-parallel build-relaton

.PHONY: prep
## Checkout document modules and install dependencies
Expand All @@ -108,13 +124,86 @@ jekyll:
$(JEKYLL_BUNDLE) exec jekyll build

## Build Jekyll site
_site: jekyll
$(SITE_DIR): jekyll

.PHONY: serve
## Serve Jekyll site
serve:
$(JEKYLL_BUNDLE) exec jekyll serve

.PHONY: build-relaton
## Build Relaton documents
build-relaton: $(SITE_DIR)/$(BIB_OUTPUT_DIR)

$(SITE_DIR)/$(BIB_OUTPUT_DIR): $(BIB_OUTPUTS)
cp -a $(BIB_OUTPUT_DIR) $@

# This `.canonicalized` file is used to determine whether the artifacts have
# been canonicalized.
# It is a Makefile-only artifact.
$(SITE_DIR)/$(CANON_PUBLIC_PATH): $(SITE_DIR)/$(CANON_PUBLIC_PATH)/.canonicalized

$(SITE_DIR)/$(CANON_PUBLIC_PATH)/.canonicalized:
$(MAKE) -s canonicalize-artifacts

$(BIB_OUTPUT_DIR):
mkdir -p $@

$(BIB_OUTPUT_DIR)/rxl/%.rxl: $(SITE_DIR)/$(CANON_PUBLIC_PATH)/%.rxl
@>&2 echo "copying $$^ to $$@"
cp $$^ $$@


## Convert RXL generated from `metanorma site generate` to YAML,
## and move the YAML files to `relaton/yaml`
$(BIB_OUTPUT_DIR)/yaml: $(BIB_OUTPUT_DIR)/rxl
mkdir -p $@
while read -r f; \
do \
$(METANORMA_PREFIX_CMD) relaton convert \
$$f -f yaml -o "$${f%.rxl}.yaml"; \
mv "$${f%.rxl}.yaml" $@; \
done < <($(MAKE) -s list-all-rxl)

## Copy RXL files from canon path to `relaton/rxl`
$(BIB_OUTPUT_DIR)/rxl:
mkdir -p $@
while read -r f; \
do\
>&2 echo "copying $$f"; \
cp "$$f" $(BIB_OUTPUT_DIR)/rxl; \
done < <($(MAKE) -s list-all-rxl)

define BIB_TASKS
$(BIB_OUTPUT_DIR)/index.$(output_format): $(SITE_DIR)/$(CANON_PUBLIC_PATH) $(BIB_OUTPUT_DIR)/$(output_format) | $(BIB_OUTPUT_DIR)
$(METANORMA_PREFIX_CMD) relaton concatenate \
-t $(CSD_REGISTRY_NAME) \
-g $(NAME_ORG) \
-x $(output_format) \
$(BIB_OUTPUT_DIR)/$(output_format) $$@

endef

$(foreach output_format,$(BIB_OUTPUT_FORMATS),$(eval $(BIB_TASKS)))


.PHONY: list-all-rxl
## List all RXL files from compiled Metanorma documents (assuming canonicalized file names)
list-all-rxl: $(SITE_DIR)/$(CANON_PUBLIC_PATH)
@find $(SITE_DIR)/$(CANON_PUBLIC_PATH) -name "*.rxl" -type f

# Currently, the `canonicalize-artifacts` target is not amenable to parallelization,
# due to the fact that each process has the potential to modify the same files
# (e.g., when HTML links are updated to use the canonicalized paths).
.PHONY: canonicalize-artifacts
## Canonicalize path names for Metanorma artifacts in sequence
canonicalize-artifacts:
@if [ ! -f $(SITE_DIR)/$(CANON_PUBLIC_PATH)/.canonicalized ]; then \
$(foreach doc_type,$(DOC_TYPES),\
PUBLIC_PATH=$(CANON_PUBLIC_PATH) SITE_SUB_DIR=$(doc_type) scripts/canonicalize-document-paths;) \
fi
touch $(SITE_DIR)/$(CANON_PUBLIC_PATH)/.canonicalized

.PHONY: checkout-modules
## Initialize and checkout submodules (e.g., Metanorma documents)
checkout-modules:
Expand Down
2 changes: 1 addition & 1 deletion _pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CalConnect works closely with liaison partners including international
organizations such as ISO, OASIS and M3AAWG.

In compliance with WTO TBT rules, all documents under 60-day public review
(as defined in link:/csd/cc-10001.html[CC/DIR 10001])
(as defined in link:/cc/cc-dir10001-2019[CC/DIR 10001])
are provided on this site.

Documents in this registry are provided in the following formats:
Expand Down
4 changes: 2 additions & 2 deletions _pages/patents.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The CalConnect Patent Information Database is a public register for the disclosu
potential patent information relating to CalConnect standardization deliverables.

This patent information database is created in accordance with
Clause 5.7 of link:/directive/documents/src-documents/cc-directive-ipr-guidelines/cc-10005[CC/DIR 10005] ("Patent information database").
Clause 5.7 of link:/cc/cc-dir10005-2019[CC/DIR 10005] ("Patent information database").

[quote]
____
Expand All @@ -36,7 +36,7 @@ particular deliverable.
== Procedures

To file a patent information notice, please refer to:
link:/directive/documents/src-documents/cc-directive-ipr-guidelines/cc-10005[CC/DIR 10005 -- "Guidelines for the implementation of the CalConnect patent policy"].
link:/cc/cc-dir10005-2019[CC/DIR 10005 -- "Guidelines for the implementation of the CalConnect patent policy"].


== Patent information
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/CD0507 CalDAV Use Cases V1.0.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/CD0514 DST Advisory Notice V1.0.pdf
Binary file not shown.
Binary file removed pubdocs/CD0601 Min-IOP Use Cases V1.0.pdf
Binary file not shown.
Binary file removed pubdocs/CD0601 Min-IOP Use Cases V1.1.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/CD0605 OMA DS Briefing April 2006 V1.0.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/CD0701 Min-IOP Use Cases for Tasks V1.0.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/CD0812 Meet CalConnect 2008 V1.0.zip
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/CD0903 Freebusy Read URL V1.0.pdf
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/CD0906 Use Cases for Resources V1.0.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/CD1004 Cal-WS Web Services API V0.3.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed pubdocs/conference30rpt.pdf
Binary file not shown.
Binary file removed pubdocs/conference31rpt.pdf
Binary file not shown.
Binary file removed pubdocs/conference32rpt.pdf
Binary file not shown.
Binary file removed pubdocs/conference33rpt.pdf
Binary file not shown.
Binary file removed pubdocs/conference34rpt.pdf
Binary file not shown.
Binary file removed pubdocs/conference35rpt.pdf
Binary file not shown.
Binary file removed pubdocs/dstlinks.pdf
Binary file not shown.
Binary file removed pubdocs/dstreview.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent26rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent27rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent28rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent29rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent30rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent31rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent32rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent33rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent34rpt.pdf
Binary file not shown.
Binary file removed pubdocs/ioptestevent35rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable10rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable11rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable12rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable13rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable14rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable15rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable16rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable17rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable18rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable19rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable1rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable20rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable21rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable22rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable23rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable24rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable25rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable26rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable27rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable28rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable29rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable2rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable3rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable4rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable5rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable6rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable7rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable8rpt.pdf
Binary file not shown.
Binary file removed pubdocs/roundtable9rpt.pdf
Binary file not shown.
Binary file removed pubdocs/vachallengeworkshopreport.pdf
Binary file not shown.
Binary file removed pubdocs/vcardworkshopreport.pdf
Binary file not shown.
Loading
Loading