def run(self): config_path = self.arguments[0] or "../" output_file = tempfile.mkstemp()[1] generate_changelog_for_docs(config_path, output_filename=output_file) with open(output_file) as fobj: include_lines = statemachine.string2lines(fobj.read(), convert_whitespace=True) self.state_machine.insert_input(include_lines, "") return []
"filename_pattern": "^((?!skip_).)*$", "examples_dirs": example_dir, "gallery_dirs": path.joinpath("generated", "gallery"), "default_thumb_file": path.joinpath("logo", "sunpy_icon_128x128.png"), "abort_on_example_error": False, "plot_gallery": True, } """ Write the latest changelog into the documentation. """ target_file = os.path.abspath("./whatsnew/latest_changelog.txt") try: from sunpy.util.towncrier import generate_changelog_for_docs if is_development: generate_changelog_for_docs("../", target_file) except Exception as e: print(f"Failed to add changelog to docs with error {e}.") # Make sure the file exists or else sphinx will complain. open(target_file, "a").close() def setup(app): if not has_sphinx_gallery: import warnings warnings.warn("The sphinx_gallery extension is not installed, so the " "gallery will not be built. You will probably see " "additional warnings about undefined references due " "to this.")
'astropy': 'http://docs.astropy.org/en/stable/', 'matplotlib': 'https://matplotlib.org/', 'numpy': 'http://docs.scipy.org/doc/numpy/', }, 'abort_on_example_error': True, 'plot_gallery': True } """ Write the latest changelog into the documentation. """ target_file = os.path.abspath("./whatsnew/latest_changelog.txt") try: from sunpy.util.towncrier import generate_changelog_for_docs generate_changelog_for_docs("../", target_file) except Exception: # If we can't generate it, we need to make sure it exists or else sphinx # will complain. open(target_file, 'a').close() def setup(app): if not has_sphinx_gallery: app.warn('The sphinx_gallery extension is not installed, so the ' 'gallery will not be built. You will probably see ' 'additional warnings about undefined references due ' 'to this.') if has_yaml: app.connect("source-read", rstjinja)