docs: add standalone reference page for @hydra.main() decorator#3136
docs: add standalone reference page for @hydra.main() decorator#3136dhruvildarji wants to merge 1 commit intofacebookresearch:mainfrom
Conversation
Adds website/docs/advanced/hydra_main.md with a comprehensive reference page for the @hydra.main() decorator covering all parameters (config_path, config_name, version_base), runtime behavior, HydraConfig global state, return value semantics, and common usage patterns. Registers the new page in website/sidebars.js under the Reference manual section, before compose_api. Closes facebookresearch#845
|
Hi @dhruvildarji! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary
Closes #845.
This PR adds
website/docs/advanced/hydra_main.md, a dedicated reference page for the@hydra.main()decorator.The page covers:
@hydra.main()does — a plain-English description of the full runtime lifecycle (argument parsing, Hydra initialization, config composition,HydraConfigpopulation, and task function invocation).config_path— relative paths,pkg://prefix,None, and how the default interacts withversion_base.config_name— how Hydra resolves the primary config file; whatNonemeans.version_base— a table of supported values and their behavioral differences, with a recommendation to always set it explicitly.HydraConfigglobal state — how to access job name, output directory, and overrides from inside the task function; whenHydraConfig.get()raises.decorating_main, andversion_baseupgrade guide.The new page is registered in
website/sidebars.jsunder Reference manual, immediately before the existing Compose API entry.Test plan
website/docs/advanced/hydra_main.mdrenders correctly in the Docusaurus dev server (cd website && npm start).compose_api.md,decorating_main.md,../upgrades/version_base.md,search_path.md) resolve without 404s.hydra/main.pyfor accuracy.