New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidebar changes #185
Sidebar changes #185
Conversation
I don't like this change, it basically entails to severely crippling the CHM file. Is there any way that the standard CHM sidebar/etc could be preserved? |
Your main problem is What do you think about receiving the possibility to replace it with:
and setting Apart from that, the functionality of the JavaScript sidebar is almost identical to the CHM sidebar (except the favorite tab which nobody is using), so I see no "severely crippling". |
It's a breaking change. The old method wouldn't work for newer help files, and the new method wouldn't work for older help files. CHM files are supposed to be openable directly within an application using the HTML Help API (which is what SciTE and Ahk2Exe use to open the help file). It shouldn't be necessary to rely on an external tool (hh.exe) to do it. The way I see it is that a sidebar was developed so that the online/web browser version also has a sidebar just like the CHM version. It shouldn't have been necessary to change how the CHM version works since it already had a working sidebar. |
Apparently only for these two programs. For example AutoHotkey.exe itself opens the Welcome page via hh.exe. The right-click menu item 'Help' or menu bar item 'User Manual' runs AutoHotkey.chm directly.
As far as I could check (Win XP/7/10), hh.exe is pre-installed on every windows version supported by AHK. Both methods, API or EXE, have the potential to be removed in future versions. In that case I think hh.exe would be easier to install than a Windows API to get it work again, if it's still necessary.
The goal is to slowly get away from CHM. Microsoft has given up the CHM principle for years. It's just outdated. Currently CHM runs on IE11 thanks to the X-UA-compatible meta tag, otherwise it would be IE7 by default, which would cause some problems. But since they stopped developing IE11 and releasing MS Edge, it's only a matter of time before IE will be fully removed from the system; at the latest then we will lose CHM forever. Roughly speaking, at some point the next step would be to abandon CHM and to bundle and present the documents in a different way (self-made browser or something like that, I have no idea). |
The keyword search via HTML Help API works now, but with the side effect that the CHM file is around 47 KB larger. |
I think you've done well, but like fincs (and despite having done work toward it myself), I'm not really sure that this was needed, or a net gain. There is a small but noticeable delay between page loads which is not present in the original CHM. If this is to do with scripts, I imagine it will be more noticeable for users with slower systems. If the side bar is being reloaded each time, perhaps this can be avoided by using frames (at least for the CHM, where it's not necessary for the overall document "location" to accurately reflect its content). In Search, the first time I press the Down key after focusing the search box, it scrolls down, putting the selected item out of view. If the result list is focused with the keyboard, there's a focus rectangle around the first item which does not follow the highlight. Why did you change the code box style? The "Select code" and "Download code" links are unimportant; having them left-aligned adds noise to the document. Having reserved (white) space at the top pushes the content away from the text above, which is often describing the code. I dislike the "hard" black (or dark grey) borders, though that's probably just personal preference. I don't think the "Select code" link is really useful for the syntax blocks. Is it that hard to select (usually) one line of code? Having it at the top especially calls out "this is code!", but it often isn't valid code; it is pseudo-code showing the syntax. The index seems to work better than before, retaining its state between page loads. (y) It probably doesn't make much sense to show the anchors on each heading (or treat each heading as a link to itself) within the CHM (but having it in local HTML can be useful for me). If I do a search, it forever wants to highlight that phrase on every page I load, even after clearing the search box. I generally don't ever want words highlighted, but I can live with it on the initial navigation via the search sidebar (as per the original behaviour) if others find it useful. Maybe it's just me, but I think the toolbar stands out too much, especially in contrast with the typically white window menu (and in my case, white title bar) and white page background.
Since when was our target just the necessities? Personally, my only issue with the standard side bar is that Ctrl+F doesn't work (you have to focus the page first); but that's easily fixed with a hotkey. I don't like the way the old search works, so I don't use it - I find the index to be much more efficient - but I might use the new search. |
I've changed the CHM to use a frame. I've also optimized the code to improve the JavaScript processing performance even further. There should be a significant improvement in load time when opening the sites (at least most of them). If I could, I would also use these frames for the online help, but there're too many restrictions like the cross domain violation on local use in some browsers or the missing location change in the address bar as you mentioned already.
Should be fixed.
As I mentioned before, to adjust them similar to the ones of the forum. I wasn't satisfied with this either ... nor with the old ones with the old-fashioned 3D border or the yellowed gray background (like a case of an old PC). So I've removed it, applied a "more modern" gray and changed the select and download buttons to show on mouseover (plus icons instead of text). In this case, the select button in the syntax code box shouldn't disturb anyone any more.
You're right. I missed that while changing the code structure. Should be fixed.
Took me a long time to understand what the hell do you want from me 😁 but the search highlighting should now behave like the one in the old CHM. Only links opened from the search listbox will receive keyword highlighting.
The one thing I have not changed. I've styled the navigation components for modern browsers, and in favor of the forum theme (as far as possible) and mobile devices. In this case, CHM is low priority. Furthermore, on Windows XP the window menu is gray - just for the record. In short: I like it at the moment. Maybe I'll change it in the future for the CHM, but I've no idea, which color would be suitable then. The links at the top contain these new changes. |
I've added shortcut keys with the same functionality like ALT+C/N/S in the CHM file (the german site uses ALT+I/N/S). Scripts which send keys to navigate inside the CHM work now (for example the "Context Sensitive Help in Any Editor" on the script showcase site). Also I've added the possibility to search via URL parameter in the format |
I will be deferring this until the next feature update (at the earliest). One thing this lacks that the CHM viewer normally provides is the ability to resize the side pane. I don't know how important it is to users; I only noticed because some of the index entries are now too long for the side pane on my system (125% DPI). It could no doubt be done in script, but I'm not aware of any way of saving information between sessions. The CHM viewer normally saves the size of the default side pane. |
Is there some way to open help with a specific side pane focused (for use from hotkeys)? |
I've added the possibility to change the width of the sidebar via mouse.
Normally the CHM viewer saves the information in I've found a (maybe the only) way, which works surprisingly. The CHM viewer can read (but not write) js files outside of itself. So we can provide the possibility to use a config file on the same location as the CHM file to overwrite the initial default values. However, in comparison to before, the user friendliness is reduced, since the user needs knowledge about objects and the settings, which have to be changed manually. I've not implemented this yet, because I need to know if it's worth it. At the moment, in my current test scenario, the user can create a file called "config.js" next to the CHM file which contains:
Only with the method above then. |
As requested in #192, I've added a button for editing the current page on GitHub. |
Wow. Just saw the ahkde demo. Everything is there, ahk-ish colours. Love it! works great. 👍 ❤️ |
Perhaps I'm missing something, but I cannot find a navigation / menu item Steps :
Missing the menu button This looks fantastic though,excellent job! |
That's because the v2 docs doesn't have the new sidebar layout yet. First of all, this pull request must be merged before the v2 docs gets the new layout. |
Thanks. |
The sidebar of the official documentation works, but it is still displayed in the old design. Check if JavaScript is enabled in your browser. Lexikos mentioned in #192 that the script which pulls the content across to autohotkey.com appears to be not working at the moment. I have no access to this script. Maybe an admin/mod like @joedf (?) who has access to it should check what's wrong here, if possible. |
I think i've found the culprit? The tocData = [["Quick Reference", "AutoHotkey.htm"], ["Usag .... "];
indexData = [["#AllowSameLineComments", "commands/_Allo ... "];
translateData = {
"Content": true,
"Index": true,
"Type in the keyword to find:": true,
"Search": true,
"Type in the word(s) to search for:": true,
"Hide/Show sidebar": true,
"Home page": true,
"en": true,
"Change language": true,
"v1": true,
"Change AHK version": true,
"https://lexikos.github.io/v2/docs/": true,
"Edit page on GitHub": true,
"https://github.com/Lexikos/AutoHotkey_L-Docs/edit/master/docs/": true,
"Go back": true,
"Go forward": true,
"Change font size": true,
"Print current document": true,
"C": true,
"N": true,
"S": true,
"Select code": true,
"Download code": true,
"Applies to:\nAutoHotkey_L Revision {0} and later\nAutoHotkey v1.0.90.00 and later": true,
"Applies to AutoHotkey {0} and later": true
}; *shorten the arrays to display clearer, all the special functions, code, etc is missing :b TLDR; Either the content.js did not get uploaded and replaced or another reason could be cloudflare cache not refreshing. I've found this quite annoying when I was updating the homepage's css. I had to reference say I don't Lexikos would have forgotten or missed this file. So, I am guessing the Cloudflare cache is the culprit (they take so long to update it). I don't have access now, but I will check this out later today. |
Ok, finally got access... Turns it out, it was both cases... :b I don't have access to the cloudflare panel to purge the cache... @ttnnkkrr would need to purge it. |
Thanks for your effort, but as far as I can see, content.js has been updated. This can easily be recognized by the fact that for example It looks like data_toc.js, data_index.js, data_translate. js and content.js have been merged, which is no longer necessary for the new sidebar. Therefore, I suppose there must be a script mentioned by Lexikos somewhere that does exactly that merging and needs to be adjusted accordingly. Did you find a script like that? How did you manage that when Lexikos released a new version and updated the documentation? Do you have to purge the Cloudflare cache every time in this case? It seemed to me that such changes were quite quickly visible on the website... |
Really? maybe it's different for regions with cloudflare? I am not sure... 😕 |
I see the same. They are different. You didn't do anything wrong. 😉 If the Cloudflare cache is purged, it should work for now (hopefully). My main problem at the moment is the content of content.js, which you posted first in the code block. |
For me, only https://autohotkey.com/docs/AutoHotkey0.htm shows the new changes. Clicking on any other docs pages shows without top or side bar. Maybe that's assumed... 🤷♂️ |
@Ragnar-F @derz00 Yes, the second one is the new one, but the other is still on the old cache version. I only modified this one page to preview the changes. However, the true solution is like @Ragnar-F mentioned: fix the 'processor' script and purge the cloudflare cache. |
Tank purged the cache. :) |
I've noticed it. Thanks. |
That is correct. Keep in mind that the web server does not run AutoHotkey scripts. Any changes you make to CreateFiles4Help.ahk (or compile_chm.ahk if intended to affect the online docs) must be reflected in the server-side script which is triggered by GitHub's web hook. Similarly, if the search index is built by an AutoHotkey script, either someone must run that script and upload the index each time the documentation is changed, or an equivalent script must be written to work on the server. For now, I have merely disabled the part of the script that combines the js scripts and overwrites content.js. Now it just syncs with GitHub. I'm not inclined to spend more time on this at the moment. |
I see. Should we keep a copy in the new docs or run a replace thought all the |
Wow, I didn't know this even exist 😮 AutoHotkey_logo_no_text.gif was never included in this repo. Maybe just on your server and someone deleted it. Currently, there is only AutoHotkey_logo_no_text.png. I recommend you to create a separate images folder in docs_1.0/ and modify the links accordingly. You can find the the old images on https://web.archive.org/web/20150607030723/http://www.autohotkey.com:80/docs/. By the way, the flags are missing, too. |
Oh shoots! Thanks. 👍 |
for CHM file the URL can't pass,in other words can't Locate to Specified page
|
#208 will fix this.
I can't do anything about the fact that IE loads a CHM page for the first time without sidebar - IE in conjunction with CHM seems to have the quirky behavior of ignoring any JavaScript at first startup. |
Hi there, really late reply on this, but I've fixed the images on the v1.0 Docs Turns out the images files were there. They were just not referenced (were using absolute paths instead of relative) correctly. |
Thanks, better late than never 😉 |
These changes was made with the focus on mobile device support and reducing CHM dependency.
Examples:
Online: https://ahkde.github.io/docs/AutoHotkey.htm
CHM file: https://github.com/ahkde/docs/releases/download/v1.1.26.00/AutoHotkeyHelp_DE.zip
Minimum requirements:
Test environments:
New features/changes:
docs/search.htm?q=query&m=mode
(mode is 1 for index tab and 2 for search tab)CHM file:
Known issues:
Because of the new sidebar in the CHM file, some AHK scripts which interact with this file (for example the F1 hotkey of SciTE4AutoHotkey) no longer workPossible future extensions:
Button for editing the page via GitHub[Added]