Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created June 4, 2021 12:23
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/57f209f89d42cd0d50bc675348a39541 to your computer and use it in GitHub Desktop.
Save ableasdale/57f209f89d42cd0d50bc675348a39541 to your computer and use it in GitHub Desktop.
Kafka Streams JavaDoc (API Docs v2.8) - get methods and text descriptions and generate a card for each item (uses bootstrap.js)
xquery version "1.0-ml";
xdmp:save("/Users/ableasdale/javadoc28.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 (2.8 API)"},
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{" "}
},
for $i in
xdmp:document-get("https://kafka.apache.org/28/javadoc/org/apache/kafka/streams/kstream/KStream.html",
<options xmlns="xdmp:document-get">
<format>xml</format>
<repair>full</repair>
</options>)//body/main/div[2]/div[3]/ul/li/section/ul/li/ul
return (
element div { attribute class {"card mb-3"},
element div { attribute class {"card-header"}, element h5 {fn:string($i//h4)}},
element div { attribute class {"card-body"}, $i//div[@class = "block"]}
}
)
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment