Skip to content

Commit

Permalink
Sort index alphabetically and do not include README, index or prod-as…
Browse files Browse the repository at this point in the history
…-built
  • Loading branch information
almenscorner committed Mar 26, 2024
1 parent 60b267c commit 11dcc47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/IntuneCD/intunecdlib/documentation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,10 @@ def get_md_files(configpath):
configpathname = configpath.split(slash)[-1]
filepath = filepath[filepath.index(configpathname) :]
filepath = "/".join(filepath[1:])

md_files.append(f"./{filepath}")
ignore_files = ["README", "index", "prod-as-built"]
if filepath.rsplit("/", maxsplit=1)[-1] not in ignore_files:
md_files.append(f"./{filepath}")
# Sort the list alphabetically by file name without extension, case-insensitive
md_files.sort(key=lambda f: os.path.splitext(os.path.basename(f))[0].lower())

return md_files

0 comments on commit 11dcc47

Please sign in to comment.