-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
129 changed files
with
2,494 additions
and
943 deletions.
There are no files selected for viewing
This file contains 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,39 @@ | ||
# For details on how this file works refer to: | ||
# - https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
# - Check for updates once a week | ||
# - Group all updates into a single PR | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
groups: | ||
all-actions: | ||
patterns: [ "*" ] | ||
|
||
# Maintain dependencies for Python Packages | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
time: "04:00" | ||
timezone: "Canada/Pacific" | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-major"] | ||
|
||
# Maintain dependencies for Python Packages | ||
- package-ecosystem: "pip" | ||
directory: "/.circleci" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
time: "04:00" | ||
timezone: "Canada/Pacific" | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-major"] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains 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,39 @@ | ||
name: publish-docs | ||
|
||
on: | ||
push: | ||
# Publish `main` as latest, and when pushes are done to branches with "v-doc" prefix | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # fetch all commits/branches | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- uses: actions/cache@v4 | ||
with: | ||
key: ${{ github.ref }} | ||
path: .cache | ||
- name: Install Python dependencies | ||
run: pip install -r ./mkdocs-requirements.txt | ||
- name: Configure git user | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
- name: Deploy docs | ||
run: | | ||
python --version | ||
# Generate the content into the docs folder | ||
code/genSite.sh | ||
mike deploy --push --update-aliases main latest | ||
mike set-default latest |
This file contains 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 |
---|---|---|
|
@@ -5,3 +5,4 @@ __pycache__ | |
*.pyc | ||
*.tmp | ||
.pytest_cache | ||
docs |
This file contains 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 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 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 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 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,19 @@ | ||
#! /bin/bash | ||
|
||
# Usage: Given an RFC name and a commit, retrieve all the files of the RFC into the AIP RFC at the right commit. | ||
# Example: code/cpAIP.sh concepts/0003-protocols c3b0e2120ad24810598375663b6922b980f85d00 | ||
# Designed to fetch files in subdirectories, although it is not clear how to add them to the documentatioon | ||
|
||
PROTOCOL=$1 | ||
COMMIT=$2 | ||
AIP2=aip2 | ||
|
||
# echo Getting AIP docs for RFC $PROTOCOL, Commit $COMMIT | ||
cd docs | ||
for i in $(find $PROTOCOL -type f); do | ||
AIPFile=$(echo $i | sed -r "s#(features|concepts)/#${AIP2}/#") | ||
# echo $i $AIPFile | ||
mkdir -p $(dirname $AIPFile) | ||
curl -s https://raw.githubusercontent.com/hyperledger/aries-rfcs/${COMMIT}/$i -o $AIPFile | ||
done | ||
cd .. |
This file contains 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,75 @@ | ||
#!/bin/bash | ||
|
||
# echo Updating the Docs for Aries RFCs | ||
|
||
# Clean out the docs folder | ||
rm -rf docs/* | ||
mkdir -p docs | ||
|
||
# Root folder -- README.md | ||
cp -r contributing.md github-issues.md MAINTAINERS.md README.md SECURITY.md tags.md 0000*.md *.png collateral docs | ||
cp LICENSE docs/LICENSE.md | ||
sed -e "s#/tags.md#tags.md#g" index.md > docs/RFCindex.md | ||
|
||
# Features and Concept -- collect all of the RFCs | ||
cp -r features concepts docs | ||
|
||
# Update the index.md file | ||
python code/generate_index.py | ||
|
||
# Make a copy of AIP 2 RFCs using the right commit for each | ||
python code/aipUpdates.py -v 2.0 -l "./code/cpAIPs.sh" | \ | ||
sed -e "/0317-please-ack/d" -e "/0587-encryption-envelope-v2/d" -e "/0627-static-peer-dids/d" \ | ||
> copy_aip.sh | ||
source copy_aip.sh | ||
rm copy_aip.sh | ||
|
||
# Cleanup a few things in README, contributing and 0000-templates | ||
for i in docs/contributing.md docs/README.md docs/0000*.md; do | ||
sed \ | ||
-e 's#../../##g' \ | ||
-e 's#index.md#RFCindex.md#' \ | ||
-e 's#LICENSE)#LICENSE.md)#' \ | ||
$i >$i.tmp | ||
mv $i.tmp $i | ||
done | ||
|
||
|
||
# Cleanup missing mailtos -- will always be needed for aip2 folder, but will be cleaned up in files | ||
for i in docs/features/*/README.md docs/concepts/*/README.md docs/aip2/*/README.md; do | ||
sed -e '/Authors/s#](#](mailto:#g' -e 's#mailto:mailto:#mailto:#g' $i >$i.tmp; mv $i.tmp $i | ||
done | ||
|
||
# Cleanup the links in the RFCs | ||
for i in docs/features/*/README.md docs/concepts/*/README.md docs/aip2/*/README.md; do | ||
sed \ | ||
-e 's#(/#(../../#g' \ | ||
-e 's#index.md#RFCindex.md#' \ | ||
-e 's#[\./]*\(concepts\)#../../\1#g' \ | ||
-e 's#[\./]*\(features\)#../../\1#g' \ | ||
-e 's#discover-../../#discover-#g' \ | ||
$i >$i.tmp | ||
mv $i.tmp $i | ||
done | ||
|
||
# Remove the existing AIP and By Status Links -- we'll add them back | ||
MKDOCS=mkdocs.yml | ||
MKDOCSTMP=${MKDOCS}.tmp | ||
MKDOCSIDX=mkdocs_index.yml | ||
|
||
# Strip off the old navigation | ||
sed '/RFCs by AIP and Status/,$d' ${MKDOCS} >${MKDOCSTMP} | ||
|
||
# Add back in the marker | ||
echo '# RFCs by AIP and Status' >>${MKDOCSTMP} | ||
|
||
# Navigation for AIP 2.0 files | ||
echo "- AIP 2.0:" >>${MKDOCSTMP} | ||
for i in docs/aip2/*/README.md ; do head -n 1 $i | sed -e "s/# / - /" -e "s/: / /" -e "s#\$#: $i#" -e "s#docs/##"; done >>${MKDOCSTMP} | ||
|
||
# Navigation for all RFCs by Status | ||
python code/generate_mkdocs_index.py | ||
cat ${MKDOCSIDX} >>${MKDOCSTMP} | ||
rm ${MKDOCSIDX} | ||
|
||
mv ${MKDOCSTMP} ${MKDOCS} |
This file contains 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,46 @@ | ||
import argparse | ||
from operator import itemgetter | ||
import os | ||
from pathlib import Path | ||
import sys | ||
|
||
import rfcs | ||
|
||
def update(fname, tmp_fname): | ||
if not os.path.exists(fname): | ||
os.rename(tmp_fname, fname) | ||
# print('Generated %s.' % fname) | ||
return | ||
with open(fname, encoding='utf-8', mode='rt') as f: | ||
old = f.read() | ||
with open(tmp_fname, encoding='utf-8', mode='rt') as f: | ||
new = f.read() | ||
if old == new: | ||
# print('No change to %s.' % fname) | ||
return | ||
os.remove(fname) | ||
os.rename(tmp_fname, fname) | ||
# print('Updated %s.' % fname) | ||
|
||
|
||
def main(fname = None): | ||
if not fname: | ||
fname = os.path.join(rfcs.root_folder, 'mkdocs_index.yml') | ||
# Load all metadata | ||
all = [rfc for rfc in rfcs.walk()] | ||
all.sort(key=lambda x: x.num) | ||
tmp_fname = fname + '.tmp' | ||
with open(tmp_fname, 'w', encoding='utf-8') as out: | ||
for status in rfcs.status_list: | ||
out.write(f"- {status}:\n") | ||
with_status = [rfc for rfc in all if rfc.status == status] | ||
for rfc in with_status: | ||
out.write(f" - {rfc.num} {rfc.title}: {rfc.relpath}\n") | ||
update(fname, tmp_fname) | ||
|
||
|
||
if __name__ == '__main__': | ||
ap = argparse.ArgumentParser('Generate index') | ||
ap.add_argument('altpath', metavar='PATH', nargs='?', default=None, help='override where index is generated') | ||
args = ap.parse_args() | ||
main(args.altpath) |
This file contains 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
Binary file not shown.
This file contains 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
Oops, something went wrong.