Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created June 4, 2021 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ableasdale/13198575402b1275e29628d510b5d3b2 to your computer and use it in GitHub Desktop.
Save ableasdale/13198575402b1275e29628d510b5d3b2 to your computer and use it in GitHub Desktop.
Kafka Streams JavaDoc (v1.0.0) - get methods and text descriptions and generate an HTML definition list (uses bootstrap.js)
xquery version "1.0-ml";
xdmp:save("/Users/ableasdale/javadoc.html",
element html { attribute lang {"en"},
element head {
element meta {attribute charset {"utf-8"}},
element meta {attribute name {"viewport"}, attribute content {"width=device-width, initial-scale=1"}},
element link {
attribute href {"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"},
attribute rel {"stylesheet"},
attribute integrity {"sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"},
attribute crossorigin {"anonymous"}
}
},
element body {
element div { attribute class {"container"},
element h1 {"KStream JavaDoc"},
element script {
attribute src {"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"},
attribute integrity {"sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4"},
attribute crossorigin {"anonymous"}, text{" "}
},
element dl {
for $i in xdmp:document-get("https://kafka.apache.org/0100/javadoc/org/apache/kafka/streams/kstream/KStream.html", <options xmlns="xdmp:document-get">
<format>xml</format>
<repair>full</repair>
</options>)//body//div[@class = "details"]/ul/li/ul/li/ul
return
(element dt{fn:string($i//h4 )},
element dd{fn:string($i//div[@class = "block"])})
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment