How to link from a Sphinx document into a CHM file? - python-sphinx

How can I link from a Sphinx document into a CHM file?
It seems that I could link from one chm file into another using a syntax like
<a href="ms-its:path+filename.chm::/pagename.htm">
Is it possible to transfer this into Sphinx commands?

You know, opening a topic compiled into a CHM is possible with Microsoft Internet Explorer only (!) by adding following code in a HTML file:
<p>Sample of CHM link to a topic in a compiled help file that is stored on a local computer</p>
<!-- To link to a topic in a compiled help file that is stored on a local computer, create a link using the following syntax: -->
Link to Garden topic here
I think, the reStructuredText parser cannot transfer these special kind of link from the source (reST).
But you can use the Replacement Text like shown below. Please note, the backslash is used twice:
================
Replacement Text
================
I recommend you try |HTMLHelp|_ and continue compiling help in CHM file format.
.. |HTMLHelp| replace:: CHM, *the* best help format around
.. _HTMLHelp: ms-its:D:\\UserData-Sphinx\\CHM-example.chm::/garden/garden.htm
The "replace" directive is used to indicate replacement text for a substitution reference. It may be used within substitution definitions only.
The resulting HTML file view:
The compiled help CHM:
The topic garden.htm is shown in the Help Viewer's topic pane after the link iswas clicked:
You may download the above used CHM-example.chm file from my HTMLHelp (HH) info site see download section or download CHM.
Please note, to open this CHM file right-click the saved file, click Properties, and then click Unblock.

Related

Why does this help file that I downloaded from the Internet only contain blank pages?

I'm trying to debug come code that uses WINIO, but unfortunately I can't find any good explanation on what it's supposed to be doing. The standard download comes with a CHM helpfile, but just to add insult to injury, every page of the helpfile is blank!
Is there something wrong with the help file, or is it really meant to be full of empty pages?
You've already got the documentation. It's that help file. But the help file was downloaded from the web and your computer knows this and doesn't want to show the HTML until you tell it to trust it.
Right click on the .chm file and select Properties.
Then click the Unblock button.
Then open the help file again and you can see the content.
Since this is stackoverflow, here's a programmatical solution, in Delphi (from FPC's winutils unit)
procedure UnBlockFile(const name:String);
var f : file;
begin
assignfile(f,name+':Zone.Identifier');
rewrite(f,1);
truncate(f);
closefile(f);
end;

Is there software I can use to view my Markdown files as a wiki, with relative links, on Windows

Our team has installed the Markdown Mode extension in Visual Studio on our Windows PCs, and we're happy with that as an editor for Markdown files, but we need a way to generate a wiki from those files where we can click on links that cross-link the files of the wiki. I've been trying to find something, but haven't had any success getting something running.
I tried creating an empty web application and pasting in the html file from here http://dynalon.github.io/mdwiki/#!index.md and naming it index.html, and adding a couple of md files to the same directory that I set to always copy to the build directory, but I got 404-3 errors when it tried to access the .md file.
I see a couple of tools that look possibly good but need Python or Ruby installed, which isn't ideal: http://markdoc.org/quickstart or http://helloform.com/projects/commonplace/
I see this ASP.NET control for embedding a Markdown file into a page http://wikicontrol.codeplex.com/ but the control is for VS 2010 so clearly is not being actively maintained, plus to use it I'll need to build something to take the relative links and find the related .md files and load them up in MVC - sounds like a hassle to get working, and it will require me to put MVC in my docs project.
Is there something that is just designed so that I can put an html file or similar in a directory with a root .md file and have it just immediately act like a wiki and allow navigation between them?
We have decided to use MarkdownDeep NuGet package and a single MVC controller to handle this. The MVC controller looks at the requested path, uses it to figure out the location of the Markdown file, reads that file and renders it to HTML and returns the HTML.

Why Microsoft OneNote can show a link to the contents are copied from?

When I copied some good information online and pasted them on Microsoft OneNote, it can tell that
Pasted from [website_address]
I have done some search, but hard to find how they did this. How to add this feature to a software?
According to the HTML clipboard format, there is an optional SourceURL property in the description section of the HTML clipboard data. You can also extract it from the BASE element in the HTML fragment.
Sometimes the website / web-page itself has javascript code that appends that text to anything copied from it. If this is the case you will see it when pasting into even notepad.exe
The main provider of such code is tynt.com and a lot of people find it annoying.

How can I create a download link in octopress

I'm using Octopress for my blog and need to create a link to download a text file.
There is a built in plugin called include_code that renders a link but also shows the file. I just want the link. Does anyone know how I can do this?
Put your text file under source/downloads/code
Then you can use the markdown syntax for showing links like this :
[link name](url for the txt file)
The url will be {your blog url}/downloads/code/{name of txt file}
This is derived from the include_code plugin which also shows a download link for each code listing.
UPDATE :
To do it from within HTML, you can use
Text File

Razor (MVC): Seeing razor files as normal HTML files in Dreamweaver 5.5 doesn't work

.CSHTML files doesn't show the SPLIT / Design tabs in DW 5.5
I followed a tutorial of how to add a file extension to DW 5.5 to allow me to open it and it treats it as HTML but it isn't functioning.
Here is the line I changed. notice the addtional of cshtml
<documenttype id="HTML" internaltype="HTML" winfileextension="html,htm,shtml,shtm,stm,tpl,lasso,xhtml,cshtml"
The file is stored here:
C:\Program Files (x86)\Adobe\Adobe Dreamweaver
CS5.5\configuration\DocumentTypes
What am I doing wrong?
My file type is basically a HTML file type with Divs etc etc but has some custom .NET code which its fine to treat as TEXT.
I open the file in Dreamweaver and it only shows the code tab, the DESIGN or SPLIT are still disabled.
And there is no color coding on, for example, a div tag...
Take a read here about adding file extensions:
http://kb2.adobe.com/cps/164/tn_16410.html
In particular make sure you edit the copy in the user configuration folder, not the one in the application folder. If there isn't a copy in the user folder, create a copy in the appropriate location. I just followed those directions adding a CSHTML file extension to the document types and extensions file, and once Dreamweaver is restarted, a .cshtml file opened with the ability to view in design view.

Resources