Skip to content

Conversation

@nithishr
Copy link
Contributor

The current generation is purely based on the notebook name.
With the way we are creating notebooks in folders by reusing the existing notebook name, we are getting only one tutorial rather than the individual ones. Examples can be found in GSI & FTS or Capella notebooks.

New Naming

OK   - Converted 
                ../../crewai-short-term-memory/gsi/CouchbaseStorage_Demo.ipynb to 
                output_md/crewai-short-term-memory-gsi-CouchbaseStorage_Demo.md 
         with frontmatter.
OK   - Converted 
                ../../crewai-short-term-memory/fts/CouchbaseStorage_Demo.ipynb to 
                output_md/crewai-short-term-memory-fts-CouchbaseStorage_Demo.md 
         with frontmatter.

Also added one misplaced frontmatter to the right place.

…ctory structure. The directory path is now replaced with hyphens in the output markdown file name for better organization.
@gemini-code-assist
Copy link

Summary of Changes

Hello @nithishr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where the tutorial generation process would produce a single output for notebooks sharing the same name but residing in different nested folders. The core change modifies the naming convention for generated markdown files to include the notebook's directory structure, ensuring each tutorial has a unique and descriptive filename. This enhancement improves the clarity and organization of generated documentation. Additionally, a previously misplaced frontmatter file has been moved to its correct location.

Highlights

  • Nested Tutorial Generation: Implemented support for generating unique tutorial markdown files from notebooks located in nested directories by incorporating the directory path into the output filename.
  • File Renaming: Corrected the location of a frontmatter file by renaming it from 'langgraph/fts/frontmatter.md' to 'langgraph/frontmatter.md'.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

Caution

Notebooks or Frontmatter Files Have Been Modified

  • Please ensure that a frontmatter.md file is accompanying the notebook file, and that the frontmatter is up to date.
  • These changes will be published to the developer portal tutorials only if frontmatter.md is included.
  • Proofread all changes before merging, as changes to notebook and frontmatter content will update the developer tutorial.

0 Notebook Files Modified:

Notebook File Frontmatter Included?

1 Frontmatter Files Modified:

Frontmatter File
langgraph/frontmatter.md
Note: frontmatter will be checked and tested in the Test Frontmatter workflow.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces a change in how markdown file paths are generated from Jupyter notebooks, incorporating the directory structure into the filename to avoid naming conflicts when notebooks with the same name exist in different folders. This change ensures that each notebook gets a unique markdown file, addressing the issue of overwriting tutorials when reusing notebook names across different directories.

Comment on lines +64 to +67
# Get the directory path relative to the project_dir
dir_path = os.path.dirname(relative_path)
# Replace slashes with hyphens
dir_name = dir_path.replace(os.sep, "-")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This change introduces directory names into the markdown file name. It's important to ensure that very long directory names do not result in excessively long file names that could cause issues with file systems or other tools. Consider truncating or hashing the directory name if it exceeds a certain length.

Also, consider the case where dir_path is empty. The current implementation would result in a leading hyphen in the markdown file name. It might be better to conditionally include the dir_name only if it's not empty to avoid the leading hyphen.

Suggested change
# Get the directory path relative to the project_dir
dir_path = os.path.dirname(relative_path)
# Replace slashes with hyphens
dir_name = dir_path.replace(os.sep, "-")
# Get the directory path relative to the project_dir
dir_path = os.path.dirname(relative_path)
# Replace slashes with hyphens
dir_name = dir_path.replace(os.sep, "-")
if dir_name:
markdown_file = os.path.join(markdown_dir, f"{dir_name}-{notebook_name}.md")
else:
markdown_file = os.path.join(markdown_dir, f"{notebook_name}.md")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very relevant for this repo but have added it as it is not a bad idea in general

@nithishr
Copy link
Contributor Author

nithishr commented Oct 23, 2025

We would also need to wipe the current autogenerated tutorials before merging this, so that they are generated properly without duplicating the tutorials.
This should be merged after merging couchbase-examples/couchbase-tutorials#72

…empty directory names. If no directory is present, the markdown file will now be named using only the notebook name.
@nithishr nithishr merged commit e6f3ac4 into main Oct 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants