Skip to content

Commit d039e29

Browse files
committed
Fix gh-pages URL structure - copy docs to root level directories
1 parent afd6912 commit d039e29

File tree

2 files changed

+77
-22
lines changed

2 files changed

+77
-22
lines changed

.github/workflows/gh-pages.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,33 @@ jobs:
4040

4141
- name: Prepare Markdown documentation
4242
run: |
43-
# Markdown files are already in the repository, no conversion needed
44-
# GitHub Pages can serve Markdown files directly
45-
echo "Markdown documentation files are ready for GitHub Pages"
46-
# Add all Markdown files
47-
find . -name "*.md" -exec git add -f {} \;
43+
# Copy README files from src/ekglib/*/ to root-level directories
44+
# This fixes the URL structure: files at concept_parser/README.md
45+
# will be served as https://ekgf.github.io/ekglib/concept_parser/
46+
# instead of https://ekgf.github.io/ekglib/ekglib/concept_parser/
47+
if [ -d "src/ekglib" ]; then
48+
# Copy each subdirectory's README.md to root-level directory
49+
find src/ekglib -type d -mindepth 1 -maxdepth 1 | while read -r dir; do
50+
dirname=$(basename "$dir")
51+
if [ -f "$dir/README.md" ]; then
52+
mkdir -p "$dirname"
53+
# Copy and fix relative links: ../../ becomes ../ (one level up to root)
54+
sed 's|\[ekglib\](\.\./\.\./)|[ekglib](../)|g' "$dir/README.md" > "$dirname/README.md"
55+
fi
56+
done
57+
fi
58+
# Add root README.md and LICENSE
59+
git add -f README.md LICENSE 2>/dev/null || true
60+
# Add all the module directories that were copied
61+
find . -maxdepth 1 -type d \( -name "*_parser" -o -name "*_export" -o -name "dataops_*" -o -name "maturity_model_parser" -o -name "step_export" \) -exec git add -f {} \; 2>/dev/null || true
4862
shell: bash
4963

5064
- name: Remove irrelevant files from gh-pages branch
5165
run: |
5266
git rm --quiet -rf .github/ .idea/ .vscode/ .actrc .tool-versions *.sh *.code-workspace *.iml 2>/dev/null || true
67+
git rm --quiet -rf src/ tests/ dist/ .venv/ ekglib.egg-info/ junit/ 2>/dev/null || true
5368
find . -name '*.py' -exec git rm --quiet --force {} \; 2>/dev/null || true
69+
find . -name '__pycache__' -type d -exec git rm --quiet -rf {} \; 2>/dev/null || true
5470
shell: bash
5571

5672
- name: Showing contents of gh-pages branch when running locally

README.md

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,76 @@ A Python Library for various tasks in an EKG DataOps operation.
2323

2424
## Metadata Parsers
2525

26-
- [Concept Parser](ekglib/concept_parser/)
27-
- [Persona Parser](ekglib/persona_parser/)
28-
- [Story Validate Rule Parser](ekglib/dataops_rule_parser/)
29-
- [Story Vaidate Rules Capture](ekglib/dataops_rules_capture/)
30-
- [Story Validate Rules Executor](ekglib/dataops_rules_execute/)
31-
- [Use Case Parser](ekglib/use_case_parser/)
32-
- [User Story Parser](ekglib/user_story_parser/)
26+
- [Concept Parser](concept_parser/)
27+
- [Persona Parser](persona_parser/)
28+
- [Story Validate Rule Parser](dataops_rule_parser/)
29+
- [Story Vaidate Rules Capture](dataops_rules_capture/)
30+
- [Story Validate Rules Executor](dataops_rules_execute/)
31+
- [Use Case Parser](use_case_parser/)
32+
- [User Story Parser](user_story_parser/)
3333

3434
## Capture Steps
3535

36-
- [Xlsx Parser](ekglib/xlsx_parser/)
37-
- [LDAP Parser](ekglib/ldap_parser/)
36+
- [Xlsx Parser](xlsx_parser/)
37+
- [LDAP Parser](ldap_parser/)
3838

3939
---
4040

4141
## Installation
4242

43+
**Using `uv` (recommended)**
44+
45+
If you are using `uv` to manage your project, add `ekglib` as a dependency:
46+
47+
```bash
48+
uv add ekglib
49+
```
50+
51+
You can then run the provided CLI tools via `uv`:
52+
53+
```bash
54+
uv run xlsx-parser --help
55+
uv run user-story-parser --help
56+
uv run pipeline-example --help
57+
```
58+
59+
To install the CLI tools as global commands (similar to `pipx`):
60+
61+
```bash
62+
uv tool install ekglib
63+
64+
xlsx-parser --help
65+
user-story-parser --help
66+
pipeline-example --help
67+
```
68+
69+
**Using `pip`**
70+
71+
If you prefer to use `pip` directly:
72+
4373
```bash
44-
./setup.sh
74+
python -m pip install ekglib
4575
```
4676

47-
<details>
48-
<summary>⚠️ Troubleshooting: Python3 not linked</summary>
77+
The console scripts will then be available on your `PATH`:
78+
79+
```bash
80+
xlsx-parser --help
81+
user-story-parser --help
82+
pipeline-example --help
83+
```
84+
85+
---
86+
87+
## Development setup (from source)
4988

50-
If `python3` was not linked, run:
89+
If you cloned this repository and want to work on `ekglib` itself:
5190

5291
```bash
53-
brew link --overwrite python
92+
uv sync
5493
```
5594

56-
</details>
95+
This will create and populate a virtual environment using `uv` based on `pyproject.toml`.
5796

5897
---
5998

@@ -62,13 +101,13 @@ brew link --overwrite python
62101
To run all tests:
63102

64103
```bash
65-
./run-tests.sh
104+
uv run pytest
66105
```
67106

68107
To run a single test:
69108

70109
```bash
71-
./run-tests.sh <name of test>
110+
uv run pytest tests/<path-to-test> -k <name-of-test>
72111
```
73112

74113
---

0 commit comments

Comments
 (0)