Replies: 1 comment 1 reply
-
When it comes to code snippets, I'd typically recommend using Gist, especially since Hugo provides this shortcode as a built-in feature. I appreciate the idea of fetching code directly from GitHub, and I understand the motivation behind your request – maintaining code and documentation together can be a challenging task. However, I have some reservations about how much a shortcode like this would fundamentally enhance our documentation. There are a couple of considerations when it comes to dynamically pulling code from remote Git repositories:
I think a better approach is to maintain a submodule from the documentation repository, and create symbolic links or use similar shortcode to read the code content similar to #26. I believe it's worth discussing this further in a dedicated thread where we can gather opinions and ideas from the community. |
Beta Was this translation helpful? Give feedback.
-
Feature Description
Fetching code from a remote repository like GitHub, GitLab, Codeberg, etc. is a very useful shortcode.
Embedding pieces of code in markdown makes it tougher to document a webpage. Having this feature in Hextra natively will ensure better documentation.
An existing implementation can be found here:
#26
Problem/Solution
People can fetch code maintained in a Git repository like (GitHub, GitLab, Codeberg, etc.) to complement their documentation.
Maintaining code and documentation together is a tedious task, and will exacerbate as the number of pages in the website increase.
Alternatives Considered
Yes, I'm currently using a custom shortcut, which I modified based on this suggestion:
#26
But it doesn't have a copy icon on the top right.
Additional Context
Received a suggestion in the Hextra's discussion a few weeks back:
#26
Beta Was this translation helpful? Give feedback.
All reactions