-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add doc generation scripts #16
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note that providing an optional descriptor like:
allows resulting md files to have more fields populated:
(using |
isaacbrodsky
approved these changes
Jun 28, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
H3 function description table looks good to me
It has been generated from the README, using duckdb, like: COPY (SELECT function, description, '' as comment, '' as example FROM 'README.md') TO 'function_descriptions.csv';
./script/fetch_extensions.sh duckdb Will fetch all each relevant extension usign the provided duckdb binary. ./script/generate_md.sh duckdb Will, usign the just installed extensions, generate markdown files for each extension
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EDIT: I have refined / iterate on this. It will need another couple of iterations depending on feedback, but this looks solid.
Recap is: there is a script that querying duckdb metadata functions (like
FROM duckdb_functions()
) before and after the LOAD of a given extension, can autogenerate documentation for the interface exposed by a given function.Path is:
extension binary -> extension_name.md
This script is run on CI on every extension build, and once again on the whole set of published extensions.
Given there is currently no stable way to provide descriptions / comments / example in the code itself, and we plan in introducing a proper API in the run to v1.1, extension developers can opt-in to provide a csv file with relevant metadata fields, that will be (by DuckDB!) joined to the data already collected.
Two very rough bash scripts, one that INSTALLs locally all relevant extensions, one that, using extensions in the folder
build/extension_dir/**
will generate markdown for each extension.To both scripts you need to provide a path to a duckdb binary for the right platform & version.
Also added description for functions in the h3 extension, using informations found on the README.md.
"Design" choices here are:
Example to build docs for a core extension (installing it from http://extensions.duckdb.org):
Example to build tpch extension locally and then generate docs for it:
Note that as of now, a
build
folder will be generated, polluting the current folder.