Sphinx-build generates empty content - python-sphinx

I have a documentation project in ReStructured text, which is built with sphinx-build. Among my rst files there is one that is technically correct (no warnings), added to toc, but for some reason sphinx-build generates an empty HTML from that rst. Other files are generated normally.
Attaching this file for experts to maybe advise something.
[1]: https://pastebin.com/LucB2bpC

It turned out that 'search' is a special name in Sphinx. You can't name your rst 'search'. When I renamed it to 'searchtab' everything worked.
See https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#special-names.

Related

How to link from a Sphinx document into a CHM file?

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.

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.

How to change extension of files generated by Jekyll?

How to generate not *.html files with Jekyll but files with another extension? I would like to patch it with rb plugin. Is it possible?
I tried this (googled this), but it doesn't work:
module Jekyll
# Extensions to the Jekyll Page class.
class Page
def output_ext(ext)
".myext"
end
end
end
If you want an output to _sites/ with your extension “from the box”, you can use only pages files — they're not using the permalink from the config, so those files would have the same extension you gave to them.
So, the smallest set is a file page.my-ext at the root of your project, having a YAML front matter (could be empty) like this:
---
---
Foo
Such file would be visible to the Jekyll, you could use any liquid markup inside, or use any layout for it, and then this file would be saved to the _sites/ with the same name it was before.
You can't use such file in /_posts/, 'cause when there is a permalink set, Jekyll saves files only as .html.
Custom plugin with converter works for me, but also only for simple pages — posts from /_posts/ are still getting .html, so it seems that it's hardcoded there.
So, the only way right now is to use simple pages instead of posts. And if you'd like to iterate through all such pages as you can do with posts, you should read on how the pages_list module from Jekyll Bootstrap is made — I think it's something like that.
EDITED:
Sollution found here:
http://jekyllrb.com/docs/permalinks/
You can specify the permalinks in the markup post. It will unfortunately not work if specified in _config.yml
According to my tests, if you enter:
permalink: /whatever/filename/with/arbitrary.xtension
in the markup post, your index file will be named "arbitrary.xtension" and placed in the folder:
/whatever/filename/with/
For other applications where the content of the file needs to be consistent to the extension, this plugin might perhaps help you:
https://github.com/fauno/jekyll-pandoc-multiple-formats

Image not showing up in README.md on GitHub

I am trying to add an image to the README.md in my repository using markdown below:
![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)
But the image is not showing when I visit my repository.
Instead the link to the image is showing up. Clicking the link will open the image in new window.
I have also tried using relative path:
![ScreenShot](screenshot.jpg)
But this is giving page not found error.
What is the correct markdown to display image in README.md
Both README.md and image file are in same path/directory.
What is the correct way to display an image in github README.md?
Complete content of README.md file is as below:
Voice-controlled-MP3-Player
===========================
A MP3 player which accept voice command like PLAY, PAUSE, FORWARD, etc. Using C# and Microsoft Speech API.
![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)
Updated content
Since January, 30th 2013, GitHub now supports relative links in markup documents.
This means that your code ![ScreenShot](screenshot.jpg) would now work flawlessly.
As pointed by #Brad, this may also ease a scenario where the images are different in two branches, but bear the same. In that case, switching from one branch to another, would dynamically switch the image in the rendered view, thus without requiring any change to the Readme content.
Blog post announcement
Help article
Previous answer when GitHub wasn't supporting relative links
You have to use the raw url format. In your case that would be https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg
This means that the correct markdown would be the following
![ScreenShot](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)
Using this in a .mdfile on github will display the following picture ;-)
Update following your comment
where is this officialy documented that we have to use raw...i couldn't find it anywhere
This URL format is an undocumented feature of the GitHub site. This means that it could change later. If that ever happens, in order to "rediscover" the new format, click the Raw button when displaying a image. This will "open" the image in your browser. Copy the URL and Voilà!
Note: Although the repository is no longer on hosted on GitHub, I've updated the urls to reflect the new GitHub policy regarding user content
You really should use relative urls. That way they'll work better for private repos as well.
![ScreenShot](/screenshots/latest.png)
supposing your repo has latest.png inside the screenshots folder.
~B
For relative URL's to work with images, wrap it inside the paragraph tag.
I was facing the problem, especially when working with the single image.
Example:
<p>
<img src="relativePath/file.png" width="220" height="240" />
</p>
An extension to previous answers...
The image would not show for me when the line:
![ScreenShot](/image.png)
Was directly below a <h2></h2> line and I needed to add an empty line between them.
Hopefully this saves someone some time!
Thought I would update this for 2019 as I had trouble figuring this out for myself. I uploaded my images to a repo on GitHub, and then used the raw url of the image to import it into my markdown file. To get the raw url, click on the specific image link in GitHub so you are on the page for that specific image. To the top right of the photo, there are two buttons, "Download" and "History". If you click "Download", it takes you to that raw url with the picture taking up the full screen. Copy that url, and then paste it like this in your markdown file:
![image description or alt text](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)
The button used to say "Raw" not "Download" so I hope this helps people find it.
This may not be relevant to previous answers. I have the same question as the OP - I was directed here and it didnt help me. I hope I can help add light to this question however - as it covers the possibilities of why images does not render in README.md file.
The issue I encountered is that the file name README.md file is written as readME
Not only its missing .md its also written differently.
Apparently, we should not rename the README.md file. It has to be the original name of that file in order to render the images or gifs you want to upload on github README.md page. Hope this helps someone, in rare of occasions, just like I did.
Check the file extensions because .png is not the same as .PNG.
Also use / instead of \ while specifying the file path.
Side note, when using reStructuredText use:
.. image:: /screenshots/latest.png?raw=true
I've tested with "Copy path" and in some locations this was working and in others it didn't.
In the cases it didn't, I copied the permalink and used it instead.
It doesn;t work when there are any html tags just above the line where image is being imported. You can try removing the html code or add some blank lines for the image to show on Readme.
This is just to help someone who is still having issues with image rendering in README.md:
If your image is named Some Name.png and you are trying to attach it in the README.md like ![Some Name](relative/path//res/Some Name.png), it won't work. The image has to be saved without any spaces in the file name.
So Some_Name.png with ![Some Name](relative/path//res/Some_Name.png) will work.
Make sure you check the case of the file extension. They have to match (either capital or lowercase). If you have my_image.PNG in your root directory and you add ![screenshot](/my_image.png) to your README file, it will not work. For some reason, Windows likes to capitalize file extensions sometimes. Unfortunately, Git does not recognize extension case so if you try to fix it by just changing the file name, you won't be able to commit the changes to the repo since Git will think everything is up to date. So you either have to update README.md or do some workaround like moving the file out of the directory, making a commit, then editing the file name then moving it back and doing another commit.
I had to add a <br> to return a line in order for the image to show on mine. This discovery was inspired by the comment in this thread to leave a blank line after a tag.

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