Skip to content

feat: ability to include assets in markdown#328

Merged
jaredwray merged 7 commits intomainfrom
feat-ability-to-include-assets-in-your-markdown-files
Mar 5, 2026
Merged

feat: ability to include assets in markdown#328
jaredwray merged 7 commits intomainfrom
feat-ability-to-include-assets-in-your-markdown-files

Conversation

@jaredwray
Copy link
Owner

@jaredwray jaredwray commented Mar 5, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
feat: ability to include assets in markdown

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 introduces a significant feature that enhances content management within Docula by enabling the seamless inclusion of various assets directly within markdown directories. Previously, only markdown files were processed from docs/ and changelog/. Now, images, PDFs, and other specified file types placed alongside markdown content will be automatically copied to the build output, simplifying asset management and referencing. This change provides greater flexibility for authors to structure their documentation and changelogs with embedded media.

Highlights

  • Markdown Asset Inclusion: Introduced the capability to automatically copy non-markdown files (assets) from docs/ and changelog/ directories to the build output, preserving their relative paths.
  • Configurable Asset Extensions: Added a new assetExtensions option to DoculaOptions, allowing users to define which file types should be copied as assets, with a comprehensive list of default extensions.
  • Documentation Update: Updated the README.md to include a new section detailing how to use and configure the asset inclusion feature.
  • Robust Testing: Implemented a new suite of unit tests to ensure the correct copying of assets, proper filtering by extension, and handling of custom configurations.
Changelog
  • README.md
    • Added a new entry to the table of contents for "Including Assets in Markdown".
    • Included a new configuration option assetExtensions in the configuration table.
    • Added a detailed section explaining how assets are included, directory structure examples, and how to customize supported extensions.
  • src/builder.ts
    • Introduced calls to a new copyContentAssets method for both docs and changelog directories during the build process.
    • Modified the parseDocuments method to explicitly filter for .md and .mdx files, preventing non-markdown files from being processed as documents.
    • Added a new private method copyContentAssets which recursively copies files based on the assetExtensions configuration.
  • src/options.ts
    • Added a new public property assetExtensions initialized with a default list of common image, document, media, and data file extensions.
    • Updated the constructor to parse and apply assetExtensions from user-provided options.
  • test/builder.test.ts
    • Added a new test suite "Docula Builder - Content Assets" with multiple test cases.
    • Included tests to verify copying of non-markdown files from docs and changelog to their respective output directories.
    • Added tests to confirm that only files with allowed extensions are copied and that custom assetExtensions are respected.
    • Included a test to ensure the builder handles directories without non-markdown files gracefully.
  • test/fixtures/mega-page-site/changelog/images/release-screenshot.png
    • Added a new test image file for changelog asset copying.
  • test/fixtures/multi-page-site/docs/images/diagram.png
    • Added a new test image file for docs asset copying.
  • test/options.test.ts
    • Added tests to verify the parsing of assetExtensions from options.
    • Included tests to ensure non-array values for assetExtensions are ignored.
    • Added a test to confirm the presence of default assetExtensions.
Activity
  • The pull request introduces a new feature to include assets in markdown.
  • The author has indicated that the changes fulfill the contributing and code of conduct guidelines.
  • Despite the unchecked box in the PR description, new tests have been added to cover the asset inclusion functionality, including scenarios for default and custom asset extensions.
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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc53d9f58a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

This pull request introduces a valuable feature for including assets in markdown files. However, the implementation of copyContentAssets is vulnerable to an arbitrary file read attack via symbolic links, as it follows symbolic links when copying files, potentially allowing an attacker to exfiltrate sensitive system files. A fix is recommended to skip symbolic links during the copy process. Additionally, there are suggestions to fix broken links in the new documentation, refactor the asset copying logic to use asynchronous I/O for consistency and performance, and improve the robustness of new tests by correctly handling file fixtures.

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8439d49) to head (1fb7aea).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #328   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines         1171      1230   +59     
  Branches       341       357   +16     
=========================================
+ Hits          1171      1230   +59     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jaredwray
Copy link
Owner Author

@codex review this

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fc31c562d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jaredwray jaredwray merged commit 82caf68 into main Mar 5, 2026
1 check passed
@jaredwray jaredwray deleted the feat-ability-to-include-assets-in-your-markdown-files branch March 5, 2026 18:06
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.

1 participant