yncat / temporarySkip

Skip certain phrases for a while
GNU General Public License v2.0
1 stars 1 forks source link

docs location fix #6

Open XLTechie opened 2 months ago

XLTechie commented 2 months ago

The second one should make it show up as the help file in the store.

Closes #5

yncat commented 2 months ago

@XLTechie Thanks for your pull request. As for the help menu in the store, I tested and confirmed that it is showing English / Japanese readme file on the local machine, respectively. So, I don't see why we need to copy the readme file to the root. Would you mind elaborating on this?

XLTechie commented 2 months ago

If I install the add-on in a portable copy of NVDA, here is the speech log when I try to read the help file from the store. As you can see, it only has two lines. They are the lines you have in the readme.md file at the root of your repo.

down arrow
TemporarySkip; Status: Enabled; Installed version: 1.0.3; Channel: Stable; Author: Yukio Nozawa <personal@nyanchangames.com>  2 of 2
applications
Context  menu
down arrow
Disable  d
down arrow
Remove  r
down arrow
Help  h
enter
Add-on Store - Installed add-ons (All)  dialog  TemporarySkip
TemporarySkip 1.0.3 — Mozilla Firefox
TemporarySkip 1.0.3
heading    level 1  Temporary Skip NVDA add-on
visited  link    Add-on readme
heading    level 1  Temporary Skip NVDA add-on

visited  link    Add-on readme

down arrow
visited  link    Add-on readme
down arrow
visited  link    Add-on readme
up arrow
heading    level 1  Temporary Skip NVDA add-on
ctrl+l
Navigation  tool bar
combo box  collapsed
Search with DuckDuckGo or enter address  edit  has auto complete  selected file:///C:/Users/luke/Desktop/NVDA versions/pr4/userConfig/addons/TemporarySkip/doc/en/readme.html
expanded
XLTechie commented 2 months ago

I believe the add-on template is ignoring your addon/doc/en/readme.md file, and substituting /readme.md for it, because you have your baseLanguage variable set to "en". It assumes that the repo root readme.md is the one for the base language. That is normally a safe assumption.

Here, though, you have your baseLanguage set to English, but have placed your English readme at the place where it copies the root readme to, and put a stub readme at the root of the repo. When scons runs, it replaces your English readme with the stub readme, because of the base language setting.

As to why it's showing up correctly on your machine, I have no idea. You can look at the block starting on line 155 of the sconstruct file, to see what's being done.

CC @josephsl, in case he has any comments.

yncat commented 2 months ago

@XLTechie Can you look at %appdata%\nvda\addons\temporarySkip\doc\en\readme.html?

Here, I have the full html like this:

(skipping the header)

<body>
<h2>TemporarySkip</h2>
<h2>Overview</h2>
<p>This NVDA add-on allows you to skip certain phrases for a short period of time. You may wonder if you need such a thing. Simple. I wanted it, so I made it. I'm not sure if other people find it useful or not, but why not make it public.</p>
<p>I'm assuming use cases like the following:
- Skipping over the common and long prefix at the beginning of a console line during a CUI operation
- Silencing annoying "add line comments" while reviewing code on GitHub
- Skipping over the same person's name on Slack or Discord when they post dozens of posts in a row</p>

This is the official 1.0.3 installation, so I think we're same at least about this fact.

yncat commented 2 months ago

Or does it happen only when installed into a portable copy?

yncat commented 2 months ago

Tried building the add-on again, and the doc\en\readme.{md | html} indeed have the correct content.

Also, about the sconstruct. Although I'm not familiar with reading scons recipes,

https://github.com/yncat/temporarySkip/blob/f6a152c7243317e02fcb4604376f9b9b2929f239/sconstruct#L156-L157

here, seems like the readme path looks for "doc/en/readme.md". But I don't have prior knowledge about the next line

readmeTarget = env.Command(readmePath, "readme.md", Copy("$TARGET", "$SOURCE"))

I don't know what $target and $source actually store.