What is the process for implementing a CSS theme switch in a CHM file and ensuring that it remains persistent?

Welcome to my tech world

Greetings! I am a tech writer with a side interest in scripting JavaScript/jQuery for our help file (CHM file). While I consider myself a beginner in JS scripting, I have ventured into the realm of dynamic theme swapping within CHMs by loading different .css files for light/dark/classic themes. You can follow my progress on the matter through this discussion thread on the Adobe forums: )

Project Scope and Requirements

  • Our users frequently lack internet access.
  • The CHMs are locally stored on their machines, so any solution needs to be standalone.
  • Note that CHM files operate using IE 7 as the backend.
  • We utilize RoboHelp 2015 as our authoring tool.

The Dilemma at Hand

While the CHM successfully loads various CSS stylesheets, the challenge lies in tracking a user's choice from a CHM file. Is this even feasible?

Exploring Solutions

Initially, cookies seemed promising, but they proved ineffective within a CHM based on research and testing. Though successful in a local .htm file, seamlessly transferring values back to the CHM presented challenges.

An attempt with iframes involved setting up a local .htm in the CHM folder, yet failed to integrate properly.

Lastly, leveraging scripting to communicate with an external file revealed hurdles in passing parameters from .htm pages back to the calling CHM. Efforts to establish a parameter passage mechanism faced technical roadblocks.

A Call for Innovation

As I navigate the intricacies of storing and retrieving data within a CHM environment, I question the efficacy of current methodologies. Are there alternative approaches better suited to address our unique constraints?

Answer №1

While my response may not directly address your question, it aims to fulfill your requirements.

Stick with using the zeal instead of the chm document.

  • To switch to dark mode: Press Alt+E for Edit→NPreference→Content→Appearance (restart required). Use Alt+DDark.

If your system is already in dark mode, no action is needed as it will automatically adjust. I hope you enjoy this feature.

Should you prefer to solely rely on the chm doc, here are some useful suggestions.

  1. For reading purposes only: xchm
  2. Portable option with USB flash drive: Kchmviewer
  3. Management tools: Calibre Okular
  4. Customization and expansion: MyBase
  5. Exporting to another file format via CLI: pandoc
pandoc input.chm -o output.<filetype> # [html|pdf|equb|markdown]

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Excess spacing in image on top of CSS background overlay

While playing around with text scrolling over a fixed background image (similar to parallax scrolling but with no movement in the background), I encountered an issue. There seems to be a small margin or padding (around 5-10px) between the bottom of the upp ...

What is causing the reluctance of my Angular test to accept my custom form validation function?

I'm currently facing an issue with testing an angular component called "FooComponent" using Karma/Jasmine. Snippet of code from foo.component.spec.ts file: describe('FooComponent', () => { let component: FooComponent let fixture ...

"Implementing a responsive design with a background image and radial gradient - how to

The image currently in use: https://i.stack.imgur.com/piK6l.jpg Here is how I've implemented it using Vue.js, Bootstrap, and CSS: Code Snippet <div class="landing"> <div class="container text-white details h-100"> ...

Issue with custom function not being triggered by datepicker onSelect in Internet Explorer with JQuery

I have a datepicker set up like this: $("#startDate").datepicker({ onSelect: changeDate }); This is used with the following input field: <input type="text" id="startDate" value="" class="dateField"/> This setup works well in Chrome, but encou ...

What is causing my Bootstrap Controls to malfunction?

I'm trying to create a Bootstrap carousel that shows 3 items at once and includes controls to switch between them. The carousel I've made does display the three items, but for some reason, the controls are not responding when clicked. I'm un ...

Learning the process of accessing a JSON file from a different directory

I am faced with a straightforward folder structure, it looks like this: project │ └───data │ file.json │ └───js test.js My goal is to access the content of file.json within the test.js file in order to perform some ...

Having trouble with $(document).ready not functioning correctly?

After following the instructions to move my jQuery CDN to the bottom of the page, I encountered a problem. The script below was functioning perfectly when my jquery files were at the top of the page: if ($(window).width() >= 768) { $('.col-l ...

When I deploy my React and Express.js page to production on RAILWAY, my authentication cookies disappear every time I refresh the page

I have created this middleware function for cookies in Express using JWT: export const createAccessToken = async (payload) => { return new Promise((resolve, reject) => { jwt.sign(payload, TOKEN_SECRET, { expiresIn: "1d" }, (err, token ...

Utilizing lodash to Filter Arrays Within Arrays

Let's take a look at the JSON structure provided below. comapany : ABC Emp Info:[ { empName: D, empID:4 salary[ { year: 2017, ...

Angular is able to select an element from a specified array

I'm currently struggling with using Angular to manipulate a TMDB API. I am having difficulty retrieving an item from an array. Can someone provide assistance? Here is the response that the array returns: { "id": 423108, "results ...

Display information using an ASP.Net barcode scanner

Currently, I am developing a WCF service application that involves receiving characters from a barcode reader and displaying the data on the UI for the user. My issue arises when inputting data using the keyboard into a textbox; everything functions corr ...

What is the reason behind changing the line-height for one inline-block sibling div affecting both divs?

Here's my setup: <div> <div style="display:inline-block; ">div_1</div> <div style="display:inline-block; line-height:20px;">div_2</div> </div> Why does setting the line-height property f ...

Oops! The Route.get() function in Node.js is throwing an error because it's expecting a callback function, but it received

Currently, I am learning how to create a web music admin panel where users can upload MP3 files. However, I have encountered the following errors: Error: Route.get() requires a callback function but received an [object Undefined] at Route. [as get] (C:&bso ...

The React Native File generator

Currently, we are utilizing redux actions in our web project. In an effort to share logic between web and native applications, we have integrated these actions into our react native project with the intention of only having to modify the components. One o ...

The CSS stylesheet appears to be properly linked, however, it is not displaying correctly on the preview page

Here are the locations of my folders: index.ejs can be found inside Markdown Blog/views/articles This is where my css stylesheet is located: ../../css/styles.css Despite ctrl+clicking the path and successfully navigating to the css file, the styles do no ...

Propelling Information using the Chakra-UI Drawer Element

I've been exploring the features of the Chakra-UI drawer component and you can find more information about it here. Overall, the functionality aligns with my needs, except for one particular aspect - instead of pushing the content to the side, the dra ...

Node Express app issue: Only one page is not having CSS applied

I've been working on a node application that utilizes Handlebars.js (hbs) as the html templating language. In my project, I have a CSS file stored in a public folder. The .hbs files within the 'views' folder successfully link to this CSS fil ...

What is the best way to align a div with a fixed width in the center, when it is positioned between two other divs within a parent

I have this HTML (technically JSX) code snippet here: The center div with the class domain-input-parent is supposed to have a fixed width of 400px and stay centered horizontally on the screen. This arrangement ensures that both the domain-label and icon- ...

Vanilla JavaScript: Enabling Video Autoplay within a Modal

Can anyone provide a solution in vanilla JavaScript to make a video autoplay within a popup modal? Is this even achievable? I have already included the autoplay element in the iframe (I believe it is standard in the embedded link from YouTube), but I stil ...

Assistance with offsetting a jQuery drop down menu

This is the third jQuery script that I've been working on. While parts of it have been inspired by other scripts, I'm now focusing on implementing a specific feature. I've dedicated 4 hours to solving the issue of displaying the submenu on ...