Skip to content

Commit

Permalink
Schema registry static api documentation (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
emasab authored Jul 7, 2022
1 parent 471c246 commit 5811a4f
Show file tree
Hide file tree
Showing 3 changed files with 605 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
DIRS?=$(shell find . -xdev -type f -name '*.go' -exec dirname {} \; | sort | uniq)

docs: generr
mk/doc-gen.py > kafka/api.html
mk/doc-gen.py kafka > kafka/api.html && \
mk/doc-gen.py schemaregistry > schemaregistry/api.html

generr:
(cd kafka/go_rdkafka_generr && go install)
Expand Down
8 changes: 7 additions & 1 deletion mk/doc-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import subprocess
import re
import sys
from bs4 import BeautifulSoup


Expand All @@ -18,6 +19,10 @@ def convert_path(url, base_url, after):


if __name__ == '__main__':
if len(sys.argv) < 2:
print(f"usage: {sys.argv[0]} <package>")
sys.exit(1)
package = sys.argv[1]

tag = "v1.9.1"
base_css = "https://go.dev/css"
Expand All @@ -28,7 +33,8 @@ def convert_path(url, base_url, after):

# Use godoc client to extract our package docs
html_in = subprocess.check_output(
'godoc -url=/pkg/github.com/confluentinc/confluent-kafka-go/kafka ' +
'godoc -url=/pkg/github.com/confluentinc/' +
f'confluent-kafka-go/{package} ' +
'| egrep -v "^using (GOPATH|module) mode"', shell=True)

# Parse HTML
Expand Down
Loading

0 comments on commit 5811a4f

Please sign in to comment.