Skip to content

Commit

Permalink
filter groups
Browse files Browse the repository at this point in the history
  • Loading branch information
maxd-nordic committed Feb 23, 2024
1 parent 9ae1333 commit b98efbd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/docbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,22 @@ jobs:
working-directory: ncs/nrf/doc/_build/docsets/kconfig.docset/Contents/Resources/Documents
run: python3 ../../../../../../_scripts/rebuild_kconfig_index.py

- name: Filter out group elements from Zephyr docset
working-directory: ncs/nrf/doc/_build/docsets/zephyr.docset/Contents/Resources/Documents
run: python3 ../../../../../../_scripts/filter_docset_index.py

- name: Filter out group elements from nrf docset
working-directory: ncs/nrf/doc/_build/docsets/nrf.docset/Contents/Resources/Documents
run: python3 ../../../../../../_scripts/filter_docset_index.py

- name: Filter out group elements from nrfx docset
working-directory: ncs/nrf/doc/_build/docsets/nrfx.docset/Contents/Resources/Documents
run: python3 ../../../../../../_scripts/filter_docset_index.py

- name: Filter out group elements from nrfxlib docset
working-directory: ncs/nrf/doc/_build/docsets/nrfxlib.docset/Contents/Resources/Documents
run: python3 ../../../../../../_scripts/filter_docset_index.py

- name: Compress Docsets
working-directory: ncs/nrf/doc/_build
run: tar czf docsets.tar.xz docsets/
Expand Down
14 changes: 14 additions & 0 deletions doc/_scripts/filter_docset_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python3

import sqlite3

db_conn = sqlite3.connect("../docSet.dsidx")
cur = db_conn.cursor()
cur2 = db_conn.cursor()
res = cur.execute("select * from searchIndex")

for id, name, t, path in res:
if name.find("__") != -1 and any([name.startswith(x) for x in ["group", "union", "struct"]]):
cur2.execute(f"delete from searchIndex where id={id}")

db_conn.commit()

0 comments on commit b98efbd

Please sign in to comment.