Skip to content

Commit e795d5a

Browse files
authored
Merge pull request #43 from mike-rambil/fix/mainContent
Fix/main content
2 parents edec296 + f18ffb4 commit e795d5a

7 files changed

+48
-33
lines changed

contents/git-command-reference-full-list.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
![Category: Reference](https://img.shields.io/badge/Category-Reference-blue)
77
> A comprehensive list of Git commands used in this project.
88
9+
## Subcommands
10+
- [git init --bare](./git-init-bare.md): Initialize a bare repository, typically used for remote repositories.
11+
- [git clone --mirror <repository>](./git-clone-mirror-repository.md): Clone a repository in mirror mode, including all refs and branches.
12+
913
A comprehensive list of Git commands used in this project, formatted according to our standard.
1014

1115

contents/how-to-use-git-worktree-safely.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
![Category: Worktree](https://img.shields.io/badge/Category-Worktree-blue)
77
> Work on multiple branches simultaneously without switching.
88
9+
## Subcommands
10+
- [Check Existing Worktrees](./check-existing-worktrees.md)
11+
- [Create a New Worktree](./create-a-new-worktree.md)
12+
- [Remove a Worktree](./remove-a-worktree.md)
13+
- [Switch Between Worktrees](./switch-between-worktrees.md)
14+
- [Use Worktrees for Temporary Fixes](./use-worktrees-for-temporary-fixes.md)
15+
- [Flags and Their Uses](./flags-and-their-uses.md)
16+
917
`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.
1018

1119

contents/miscellaneous-orphaned-git-commands.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
![Category: Miscellaneous](https://img.shields.io/badge/Category-Miscellaneous-blue)
77
> Useful Git commands and scripts not referenced elsewhere.
88
9+
## Subcommands
10+
- [git maintenance start](./git-maintenance-start.md): Runs a cronJob in background for the specified repo for periodic maintenance.
11+
- [git request-pull](./git-request-pull.md): Generate a request to pull changes into a repository.
12+
- [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.
13+
- [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.
14+
915
This file collects useful Git commands and scripts that were previously only in the README and not referenced elsewhere in this repository.
1016

1117

contents/past-commits-of-a-specific-file.md

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

1117

contents/sharing-changes-as-patch-files.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
![Category: Patch & Diff](https://img.shields.io/badge/Category-Patch%20%26%20Diff-blue)
77
> Generate and share patch files for committed or uncommitted changes.
88
9+
## Subcommands
10+
- [Create Patch from Last Commit(s)](./create-patch-from-last-commit-s.md)
11+
- [Apply Patch with Commit Metadata](./apply-patch-with-commit-metadata.md)
12+
- [Create Patch from Uncommitted Changes](./create-patch-from-uncommitted-changes.md)
13+
- [Apply Diff File](./apply-diff-file.md)
14+
- [Patch vs Diff: Quick Reference](./patch-vs-diff-quick-reference.md)
15+
916
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.
1017

1118

contents/useful-rare-git-commands-you-never-heard-of.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
![Category: Advanced](https://img.shields.io/badge/Category-Advanced-blue)
77
> A collection of lesser-known but powerful Git commands.
88
9+
## Subcommands
10+
- [git replace <old-commit> <new-commit>](./git-replace-old-commit-new-commit.md): Temporarily substitute one commit for another.
11+
912
A collection of lesser-known but powerful Git commands. Use these to level up your Git workflow!
1013

1114

scripts/generate-readme.js

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -229,47 +229,28 @@ function generateMiniSubtocTOC(obj) {
229229
return out + '\n';
230230
}
231231

232-
function hasOnlySubtocContent(obj) {
233-
// Returns true if the main file has no meaningful content except subtoc
234-
return !(
235-
obj.long_description ||
236-
obj.command ||
237-
obj.flags ||
238-
obj.examples ||
239-
obj['command similiar examples'] ||
240-
obj.steps ||
241-
obj.prerequisites ||
242-
obj.warnings ||
243-
obj.links ||
244-
obj.related_commands ||
245-
obj.output_example
246-
);
247-
}
248-
249232
function generateContentFile(obj, idx, tocData) {
250233
let slug = slugify(obj.Name);
251234
let md = `[⬅️ Back to Table of Contents](../README.md#${slug})\n\n`;
252235
md += `# ${obj.Name}\n\n`;
253236
if (obj.category) md += renderCategory(obj.category);
254237
if (obj.short_description) md += `> ${obj.short_description}\n\n`;
255-
// If only subtoc, add mini-TOC
256-
if (obj.subtoc && obj.subtoc.length && hasOnlySubtocContent(obj)) {
238+
// Always add mini-TOC if subtoc exists
239+
if (obj.subtoc && obj.subtoc.length) {
257240
md += generateMiniSubtocTOC(obj);
258-
} else {
259-
if (obj.long_description) md += `${obj.long_description}\n\n`;
260-
if (obj.command) md += renderCommand(obj.command);
261-
if (obj.flags) md += renderFlags(obj.flags);
262-
if (obj.examples) md += renderExamples(obj.examples);
263-
if (obj['command similiar examples'])
264-
md += renderCommandExamples(obj['command similiar examples']);
265-
if (obj.steps) md += renderSteps(obj.steps);
266-
if (obj.prerequisites) md += renderPrerequisites(obj.prerequisites);
267-
if (obj.warnings) md += renderWarnings(obj.warnings);
268-
if (obj.links) md += renderLinks(obj.links);
269-
if (obj.related_commands) md += renderRelatedCommands(obj.related_commands);
270-
if (obj.output_example) md += renderOutputExample(obj.output_example);
271241
}
272-
if (obj.subtoc) md += renderSubtoc(obj.subtoc);
242+
if (obj.long_description) md += `${obj.long_description}\n\n`;
243+
if (obj.command) md += renderCommand(obj.command);
244+
if (obj.flags) md += renderFlags(obj.flags);
245+
if (obj.examples) md += renderExamples(obj.examples);
246+
if (obj['command similiar examples'])
247+
md += renderCommandExamples(obj['command similiar examples']);
248+
if (obj.steps) md += renderSteps(obj.steps);
249+
if (obj.prerequisites) md += renderPrerequisites(obj.prerequisites);
250+
if (obj.warnings) md += renderWarnings(obj.warnings);
251+
if (obj.links) md += renderLinks(obj.links);
252+
if (obj.related_commands) md += renderRelatedCommands(obj.related_commands);
253+
if (obj.output_example) md += renderOutputExample(obj.output_example);
273254
md += conciseMetaLine(obj.author, obj.last_updated, obj.tags);
274255
return md;
275256
}

0 commit comments

Comments
 (0)