Notes on miscellaneous stuff

Last updated on 24 Sep. 2025
13:55 04 September 2025
From notes of past few days:

Copy-paste numbered list from HTML to text preserving the numbers

Seems like there is no direct way to do that. Checked with ChatGPT - its suggestions did not work.
Free online utilities to convert HTML to text are around but they did not provide numbers and line separation.

Solution: Copy-paste numbered list from HTML page in browser to https://onlinetexttools.com/add-line-numbers . This will add the list without numbers but as separate lines in the input box. The 'Numbered Text Lines' box will have the content with the numbers which can be copied to clipboard after a delay of some seconds followed by providing permission to copy to clipboard.

[Later update: Another solution is to ask an AI chatbot to do it. But that will need creating a simple but unambiguous prompt which I can save for later reuse.]
---------------------

==========================

Excluding folder (or file) in .gitignore that has been committed to repo

Me: I want to exclude dist folder in my .gitignore. I added the entry (see uploaded file) but VSCode does not show dist as ignored folder (not gray colour).

Gem or ChatGPT don't recall which: .. 
The reason VS Code is not showing the dist folder as ignored is because the .gitignore file only affects files and folders that have not yet been committed to your Git repository.
If the dist folder was created and committed to your repository before you added dist to your .gitignore file, Git will continue to track it. VS Code, in turn, will continue to show it as a tracked directory, and its contents will not appear in gray.
To fix this, you need to tell Git to stop tracking the dist folder. You can do this with a two-step process:

Stop Tracking the Folder: Use the git rm --cached command to remove the folder from the Git index.
git rm -r --cached dist

rm: The "remove" command.
-r: The "recursive" flag, which tells Git to remove the folder and everything inside it.
--cached: This is the crucial flag. It tells Git to only remove the folder from the repository's index (its tracking list), but to leave the actual files on your local file system.

Commit the Change: Now you need to commit this change to your repository. This will tell Git that from now on, it should ignore the dist folder.

git commit -m "Remove dist folder from tracking"
After you run these two commands, you will see that the dist folder and its contents are no longer tracked by Git. You will also notice that VS Code now shows the folder name in gray, as you expected, indicating that it is being correctly ignored.

Me: That fixed it though I had to close and reopen VSCode for dist to be shown as gray.
================================

Blogger seems to trip up on <wbr> tag; Blogger shows 'invalid' HTML in red

20:30 06 September 2025
In https://raviswdev.blogspot.com/2025/09/vscode-extension-to-auto-add-id.html , when I would go to HTML view and then try to go back to Compose view without making any changes, I would be shown an error message that HTML is invalid and switching to Compose view may lead to loss of some data (paraphrasing).
At first, I could not figure out the exact issue and also how to identify the tags that Blogger is complaining about. Later i saw that Blogger was showing </wbr> tags in red and some other tags that contained it like </div> in red. [Note that I had figured that out using W3C validation service and fixed it but ... see update] Removing all the </wbr> tags fixed the issue. Apparently <wbr> alone is enough and one does not need <wbr></wbr>. Even W3C validation service pointed that out but it pointed some other issues too (like <br /> instead of <br>) which Blogger does not seem to complain about (and probably uses).

Update: After saving the post and then going back to HTML view mode, Blogger seems to have inserted the </wbr> tags itself, and now complains about it! The solution was to simply remove all <wbr> tags as well (so not <wbr><wbr/> tags in the post). That fixed the issue. Now I can switch between Compose and HTML view without any error messages from Blogger.

========================
========================
14 Sept. 2025

Blogger Compose View Limitation for Paragraphs in List Items

In Blogger’s Compose view, when writing inside an ordered (<ol>) or unordered (<ul>) list, pressing Enter always creates a new list item (<li>). There is no direct way to insert multiple paragraphs or line breaks inside the same list item.

Common Workarounds & Trade-offs

  • <p></p> inside <li>: Has to be done in HTML view: Works but can cause Blogger to complain or strip tags; not ideal.

  • <br><br> inside <li>: Has to be done in HTML view: Simple, valid, but creates inconsistent spacing between long items and subsequent short items.

  • Nested bulleted or numbered list <ul> or <ol>: Can be done in Compose view or HTML view: Maintains consistent spacing for long items. Limitation: Compose view does not easily allow adding a continuation sentence after the nested list within the parent <li>.

Solution to Nested Bulleted or Numbered List Limitation for Sentences After Nested List

Switch to HTML view and manually add the sentences after nested  list as follows:

<li> Main point text <ul> <li>Subpoint 1</li> <li>Subpoint 2</li> </ul> Additional sentence at parent level. </li>

The nested bulleted or numbered list with above solution ensures:

  • Proper line spacing and alignment

  • Ability to continue parent list item text after nested lists


Mobile Hotspot Internet Connection related Powershell scripts

ismetered.ps1 - Powershell script that reports whether Internet connection is metered or not

CheckUnmetered.ps1 - Powershell script that checks and notifies if Internet connection is Unmetered

CheckISP.ps1 - Powershell script that reports ISP name of Jio or Airtel and whether metered or not

-----------------------------------

TXT Files Concatenation Powershell Script

This PowerShell script allows a user to specify a top-level folder as input and recursively collects all .txt files within that folder and its subfolders. Before concatenation, it lists all found files along with the total count, prompting the user for confirmation to proceed. The output file is created in the current directory where the script is run, with a name that starts with the current date, followed by -concat-, and a truncated, sanitized representation of the input folder path.

-----------------------------------

Add a “TreeView” Option to the Send To Menu in Windows 11

Summary info. from ChatGPT chat 'GUI equivalent of tree' on 21 Sep. 2025 is given below.

If you often need a full folder tree listing like the tree command provides, you can add a Send To context menu entry to quickly generate it for any folder. Here’s a simple, safe method using a batch file:


1️⃣ Create the PowerShell Script

Create a PowerShell script TreeView.ps1 with the following content:

param([string]$folderPath) # Default to current directory if no path is provided if (-not $folderPath) { $folderPath = "." } # Generate tree output and save to a temporary file tree $folderPath /f | Out-File "$env:TEMP\treeview.txt" -Encoding UTF8 # Open the result in Notepad notepad "$env:TEMP\treeview.txt"
  • Save it in a convenient folder, e.g.,

    C:\Users\<YourUser>\Scripts\TreeView.ps1

2️⃣ Create a Batch File Wrapper

Windows SendTo menu reliably passes folder paths to batch files, so we create a small wrapper .bat file:

@echo off REM Pass the selected folder to TreeView.ps1 powershell.exe -NoProfile -ExecutionPolicy Bypass -File "TreeView.ps1" "%~1"
  • Save this as TreeView.bat in same folder as above TreeView.ps1


3️⃣ Add to SendTo Menu

  1. Create a shortcut to your TreeView.bat.

  2. In Windows Explorer, open the folder: %APPDATA%\Microsoft\Windows\SendTo

  3. Copy the shortcut you just created into this SendTo  folder.

  4. Rename the shortcut to TreeView (you can remove the .bat in the name).

  5. (Optional) Change the icon of the shortcut for a cleaner look:

    • Right-click the shortcut → Properties → Change Icon


4️⃣ Using the TreeView Option

  • Right-click any folderSend to → TreeView

  • A Notepad window opens showing the full folder and file hierarchy (like tree /f).


✅ Notes

  • The .bat wrapper ensures the folder path is passed correctly to PowerShell.

  • No registry edits are needed.

  • You can create a second shortcut/batch for “folders only” (omit /f) if desired.


This method is safe, easy, and fully reversible: remove the shortcut from SendTo to disable it.


[I used the above process and it is working for me.]

...


Why we use a batch file wrapper:
Windows Send To menu reliably passes the selected folder path only to executable files like .exe or .bat. If you try to put the PowerShell script (.ps1) directly in SendTo, Explorer will not pass the folder argument correctly — the script sees a literal %1 instead of the folder path.

Using a small batch file wrapper ensures the selected folder path is correctly passed to the PowerShell script, making the Send To option work reliably.


...

[I have not tried what is suggested below but I think it should work ...]


Extending to Any PowerShell Script that takes a folder as the first argument

The same procedure can be used to add Send To context menu support for any PowerShell script that takes a folder as its first (or only) argument. Simply create a small batch file wrapper for your script, place a shortcut to the batch file in the %APPDATA%\Microsoft\Windows\SendTo folder, and optionally rename or change the icon of the shortcut. This ensures the selected folder path is correctly passed to the script, allowing it to run reliably from the right-click menu.


Strange issue with Excel.

07:58 22 September 2025
Insert Row context menu command is greyed out. Tried out some suggestions after Net search ... no solution.
But Home -> Insert -> Insert sheet Rows works. So I have a workaround.

==================


Comments