-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documentation] Python Automation script and workflow for github wiki (…
…#419) ## Description ### Motivation Create a [GitHub wiki](https://docs.github.com/en/communities/documenting-your-project-with-wikis/about-wikis) (a separate git repo relative to this repo) for the documentation across this GitHub repo. GitHub wikis have better visibility and navigation for users. ### Background GitHub wikis lack version control and are entirely separate relative to this source repository. To solve both of these issues, we use the documentation/markdown files from the main repo to update the Github wiki repository. To maximize the benefit of the wiki, a hierarchical view is created in a sidebar. However, the mapping of the markdowns files to the sidebar poses some challenges. The PR is an attempt at a very simple solution. A GitHub action that tracks changes to a set of files and triggers a python script. The script picks up pre-written comments in the set of files to generate a sidebar. From the sidebars linking reference, it copies over the files from the main repo to the wiki repo. ### Pre-Requisites to Merge this in - [ ] Create a repository secret. Based on the legacy access rules, tick the `repo` permission box. ### Outstanding issues - [ ] Improve the format of the sidebar, so categories don't repeat. Rolling the main README of a category into the category heading so that the heading is also a link and not just text. - [ ] Change the internal links of the Markdown files in the wiki to point to other paths in the wiki by either: 1. A regex change to the current wiki file names (aka wiki titles) 2. Changing the wiki file mapping to align with the internal links. ## Issue Fixes #133 Remaining/new issues ## Type of change Please mark the relevant option(s): - [x] New feature, functionality or library - [ ] Bug fix - [x] Code health or cleanup - [ ] Major breaking change - [x] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - (Apologies in advance) Some formatting changes from auto linting of markdowns files. I don't like this as it has blown out the diff. I can try to remove if it's too messy. - Added a GitHub action that tracks change to `.md` files, sets env variables and runs a python script - Added a python script in a new directory called tools. Finds the path of `.md` files, maps them to the specified format described in the files, generates a GitHub wiki sidebar file and respective wiki files. Pulls the current wiki, syncs the files and pushes them. - Added comments at the bottom of `.md` files found from `find . -name "*.md" | grep -v -e "vendor" -e "app"` in the form of `<!-- GITHUB_WIKI: category/subcategory/.../file_name -->`. - Brief description of maintaining the wiki format comment in the `docs/development/readme` - Brief mention and linking to the wiki in the main readme. ## Testing - [ ] `make develop_test` - [ ] [LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md) w/ all of the steps outlined in the `README` d Screenshot of output from example wiki on a personal fork: [example wiki](https://github.com/profishional/pocket/wiki) <img width="234" alt="image" src="https://user-images.githubusercontent.com/93366432/209815735-879b17c4-8e64-4b41-b75a-54ea4dc5c9fc.png"> ## Required Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have tested my changes using the available tooling - [ ] I have updated the corresponding CHANGELOG ### If Applicable Checklist - [x] I have updated the corresponding README(s); local and/or global - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added, or updated, [mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s) --- Co-authored-by: Daniel Olshansky <[email protected]> Co-authored-by: Dmitry Knyazev <[email protected]> Fixes #133
- Loading branch information
1 parent
36d06c6
commit 354dbf3
Showing
38 changed files
with
301 additions
and
7 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,24 @@ | ||
name: Publish docs to Wiki | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # 1. When changes are merged to the main branch | ||
paths: | ||
- '**/*.md' # 2. It detects changes to Markdowns files in the repository | ||
|
||
env: # 3. Set variables which the Python script uses for git commands | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # TODO_IN_THIS_COMMIT: provision repo secret through Pocket account | ||
USER_NAME: <user_name> | ||
USER_EMAIL: <user_email> | ||
OWNER: ${{ github.event.repository.owner.name }} | ||
REPOSITORY_NAME: ${{ github.event.repository.name }} | ||
|
||
jobs: | ||
publish_docs_to_wiki: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Generate and push Wiki | ||
run: | # 4. Runs a python script that uploads md files to Pocket Github Wiki | ||
python tools/wiki_sync.py |
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
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
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
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
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Flows | ||
|
||
The purpose of [shared/flows](./) is to document cross-module communication for end-to-end behaviour that has cross-module dependencies and and depends on the interfaces exposed by the interfaces exposed in [shared/modules](../modules). | ||
|
||
<!-- GITHUB_WIKI: shared/flows_readme --> |
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 |
---|---|---|
|
@@ -103,4 +103,6 @@ err := newModule.Stop() | |
if err != nil { | ||
// handle error | ||
} | ||
``` | ||
``` | ||
|
||
<!-- GITHUB_WIKI: shared/modules/readme --> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.