Merge pull request #43 from mike-rambil/fix/mainContent

Fix/main content
This commit is contained in:
Micheal Palliparambil
2025-07-10 20:52:28 -05:00
committed by GitHub
7 changed files with 48 additions and 33 deletions

View File

@@ -6,6 +6,10 @@
![Category: Reference](https://img.shields.io/badge/Category-Reference-blue)
> A comprehensive list of Git commands used in this project.
## Subcommands
- [git init --bare](./git-init-bare.md): Initialize a bare repository, typically used for remote repositories.
- [git clone --mirror <repository>](./git-clone-mirror-repository.md): Clone a repository in mirror mode, including all refs and branches.
A comprehensive list of Git commands used in this project, formatted according to our standard.

View File

@@ -6,6 +6,14 @@
![Category: Worktree](https://img.shields.io/badge/Category-Worktree-blue)
> Work on multiple branches simultaneously without switching.
## Subcommands
- [Check Existing Worktrees](./check-existing-worktrees.md)
- [Create a New Worktree](./create-a-new-worktree.md)
- [Remove a Worktree](./remove-a-worktree.md)
- [Switch Between Worktrees](./switch-between-worktrees.md)
- [Use Worktrees for Temporary Fixes](./use-worktrees-for-temporary-fixes.md)
- [Flags and Their Uses](./flags-and-their-uses.md)
`git worktree` allows you to manage multiple working directories linked to a single Git repository. It helps developers work on multiple branches simultaneously without switching branches in the same directory.

View File

@@ -6,6 +6,12 @@
![Category: Miscellaneous](https://img.shields.io/badge/Category-Miscellaneous-blue)
> Useful Git commands and scripts not referenced elsewhere.
## Subcommands
- [git maintenance start](./git-maintenance-start.md): Runs a cronJob in background for the specified repo for periodic maintenance.
- [git request-pull](./git-request-pull.md): Generate a request to pull changes into a repository.
- [View and Clean Up Local Git Branches (Bash)](./view-and-clean-up-local-git-branches-bash.md): Scripts to view and clean up local branches using Bash.
- [View and Clean Up Local Git Branches (PowerShell)](./view-and-clean-up-local-git-branches-powershell.md): Scripts to view and clean up local branches using PowerShell.
This file collects useful Git commands and scripts that were previously only in the README and not referenced elsewhere in this repository.

View File

@@ -6,6 +6,12 @@
![Category: History and Inspection](https://img.shields.io/badge/Category-History%20and%20Inspection-blue)
> See all commits and changes for a specific file.
## Subcommands
- [Show Commit History of a Specific File](./show-commit-history-of-a-specific-file.md)
- [Show Detailed Commit History (With Changes)](./show-detailed-commit-history-with-changes.md)
- [Show Commit History With Author and Date](./show-commit-history-with-author-and-date.md)
- [See Who Last Modified Each Line (Blame)](./see-who-last-modified-each-line-blame.md)
You can see all commits related to a specific file using Git commands. Here are a few ways to do it:

View File

@@ -6,6 +6,13 @@
![Category: Patch & Diff](https://img.shields.io/badge/Category-Patch%20%26%20Diff-blue)
> Generate and share patch files for committed or uncommitted changes.
## Subcommands
- [Create Patch from Last Commit(s)](./create-patch-from-last-commit-s.md)
- [Apply Patch with Commit Metadata](./apply-patch-with-commit-metadata.md)
- [Create Patch from Uncommitted Changes](./create-patch-from-uncommitted-changes.md)
- [Apply Diff File](./apply-diff-file.md)
- [Patch vs Diff: Quick Reference](./patch-vs-diff-quick-reference.md)
How to create patch files from your changes for sharing via email, SCP, Slack, or other means. Covers both committed (with full commit metadata) and uncommitted changes.

View File

@@ -6,6 +6,9 @@
![Category: Advanced](https://img.shields.io/badge/Category-Advanced-blue)
> A collection of lesser-known but powerful Git commands.
## Subcommands
- [git replace <old-commit> <new-commit>](./git-replace-old-commit-new-commit.md): Temporarily substitute one commit for another.
A collection of lesser-known but powerful Git commands. Use these to level up your Git workflow!

View File

@@ -229,47 +229,28 @@ function generateMiniSubtocTOC(obj) {
return out + '\n';
}
function hasOnlySubtocContent(obj) {
// Returns true if the main file has no meaningful content except subtoc
return !(
obj.long_description ||
obj.command ||
obj.flags ||
obj.examples ||
obj['command similiar examples'] ||
obj.steps ||
obj.prerequisites ||
obj.warnings ||
obj.links ||
obj.related_commands ||
obj.output_example
);
}
function generateContentFile(obj, idx, tocData) {
let slug = slugify(obj.Name);
let md = `[⬅️ Back to Table of Contents](../README.md#${slug})\n\n`;
md += `# ${obj.Name}\n\n`;
if (obj.category) md += renderCategory(obj.category);
if (obj.short_description) md += `> ${obj.short_description}\n\n`;
// If only subtoc, add mini-TOC
if (obj.subtoc && obj.subtoc.length && hasOnlySubtocContent(obj)) {
// Always add mini-TOC if subtoc exists
if (obj.subtoc && obj.subtoc.length) {
md += generateMiniSubtocTOC(obj);
} else {
if (obj.long_description) md += `${obj.long_description}\n\n`;
if (obj.command) md += renderCommand(obj.command);
if (obj.flags) md += renderFlags(obj.flags);
if (obj.examples) md += renderExamples(obj.examples);
if (obj['command similiar examples'])
md += renderCommandExamples(obj['command similiar examples']);
if (obj.steps) md += renderSteps(obj.steps);
if (obj.prerequisites) md += renderPrerequisites(obj.prerequisites);
if (obj.warnings) md += renderWarnings(obj.warnings);
if (obj.links) md += renderLinks(obj.links);
if (obj.related_commands) md += renderRelatedCommands(obj.related_commands);
if (obj.output_example) md += renderOutputExample(obj.output_example);
}
if (obj.subtoc) md += renderSubtoc(obj.subtoc);
if (obj.long_description) md += `${obj.long_description}\n\n`;
if (obj.command) md += renderCommand(obj.command);
if (obj.flags) md += renderFlags(obj.flags);
if (obj.examples) md += renderExamples(obj.examples);
if (obj['command similiar examples'])
md += renderCommandExamples(obj['command similiar examples']);
if (obj.steps) md += renderSteps(obj.steps);
if (obj.prerequisites) md += renderPrerequisites(obj.prerequisites);
if (obj.warnings) md += renderWarnings(obj.warnings);
if (obj.links) md += renderLinks(obj.links);
if (obj.related_commands) md += renderRelatedCommands(obj.related_commands);
if (obj.output_example) md += renderOutputExample(obj.output_example);
md += conciseMetaLine(obj.author, obj.last_updated, obj.tags);
return md;
}