reStructuredText link to section with custom text - restructuredtext

I'm aware of the documentation regarding implicit hyperlinks in the reStructuredText manual, but I'm wondering if it is possible to reference a section without having to repeat the full section title. E.g. if I take the example from the documentation,
Titles are targets, too
=======================
Implict references, like `Titles are targets, too`_.
then I'd like to have a way to refer to the section by using a different link name (e.g `the target section`_). How can I do that?

You can refer to a section titled Titles are targets, too with:
`link text <Titles are targets, too_>`_
This creates a link whose text is link text but points to the section titled Titles are targets, too.

Related

Abbreviation (abbr) element in reStructuredText

How to generate an <abbr> abbreviation element in ReST?
<abbr title="Hypertext Markup Language">HTML</abbr>
The documentation indicates that "The abbreviation element is not exposed in default restructured text. It can only be accessed through custom roles." I'm not sure how to create such a custom role, and the rest of the documentation is a tad obscure to me.
For Sphinx users, an abbreviation can be added using the :abbr: role. For example,
This :abbr:`SDP (Software Development Plan)` defines ...
results in the following HTML
<p>This <abbr title="Software Development Plan">SDP</abbr> defines …</p>
I have solved it for now by adding this at the bottom of the document:
.. |HTMLabbr| raw:: html
<abbr title="Hypertext Markup Language">HTML</abbr>
Then in the document I've used this "tag"/custom role like this:
This document is written in |HTMLabbr| and renders nicely in a modern browser.
For each abbreviation you would have to define a new custom role, I'm wondering if there is a way to have a "tag" that would take the value and the title as parameters instead of having to hard-code it like this.
Creating custom docutils rst role is not hard (compared to other ways how to extension docutils). See rst roles howto, which contains all the details along with a full implementation of example RFC role. I was able to create custom bugzilla referencing role based on this document.

Is there an Atom plugin to add comment headers that are visible in a minimap?

I'm looking for a plugin that lets adding comment headers that are visible in minimaps, as illustrated in this image:
You can see the "TABS", "TREEVIEW", "CURSOR", etc. headers
You can try the following package: https://atom.io/packages/figlet
It will allow you to convert the selected text into ASCII art using FIGlet, allowing you to specify which font to use.
Then you just need to add the required comment characters at the beginning of each line.

Mediawiki Extension:RSS

The MediaWiki Extension:RSS (http://www.mediawiki.org/wiki/Extension:RSS) uses the plainlinks class to present the RSS feed link. I have tried all manner of searching, including trying to edit the MediaWiki:Rss-feed template to force the link to presented in non-bolded format.
Has anyone used this extension and can tell me how to change the fonts in the RSS link?
Thanks
As far as I can understand your question, you should be able to remove the boldface formatting from the RSS item titles by editing the page MediaWiki:Rss-item (not MediaWiki:Rss-feed) on your wiki.
What you need to do is two things:
remove the string ''' (MediaWiki markup for bold text) from either side of the title, and
remove the ; (MediaWiki markup for a list definition, which is also bolded by the default style sheet) from the beginning of the line.
That is, change the default content of the page:
; '''<span class='plainlinks'>[{{{link}}} {{{title}}}]</span>'''
: {{{description}}}
: {{{author}}} {{{date}}}<!-- don't use newline here -->
to this:
<span class='plainlinks'>[{{{link}}} {{{title}}}]</span>
: {{{description}}}
: {{{author}}} {{{date}}}<!-- don't use newline here -->

ipython notebook anchor link to refer a cell directly from outside

I am writing documentation for a notebook-based framework. When referring to important cells in a demo-notebook, can I point to a particular cell by using some sort of anchor?
For example if I have the demo-notebook at 127.0.0.1/mydemo, is it possible to refer to the input cell In[10] by some anchor tag like 127.0.0.1/mydemo#In10
Creating internal links within Markdown works quite well in practice for me. For example, you can make a table of contents by making a list in a markdown cell at the top of the page.
*[jump to code cell 2](#cell2)
*[jump to code cell 3](#cell3)
*[jump to code cell 4](#cell4)
Then you just insert a markdown cell right above the code cell you want to link to (say code cell 2). Just add one line of code:
<a id="cell2"></a>
See this tutorial for more explanation: http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/tutorials/table_of_contents_ipython.ipynb
I like to use headers to organize my notebooks, such as
#My title
in a markdown cell. In another location, I can then refer to this cell using
[Link to my title](#My-title)
in markdown (looks like you should replace spaces with hyphens).
I got this from a more complete answer here.
Not on stable, and only on Header(1-6) cell on master. Just click on the header cell and it will put the right anchor in the url bar, wich is usually #header_title_sanitized
Using the prompt number is not a good idea as it might change. It will be supported on nbviewer as well, we are working on it.

epydoc and reStructuredText change link name

I'm using reStructuredText with epydoc. How can I have the text of an internal link different than the target of the link? I have:
:todo: Figure out the `Product.manufacturer` relationship in `Product`.
The Product link looks fine and links to the Product object. The Product.manufacturer link goes to the proper member variable, but instead of the text being Product.manufacturer, I'd like to just be manufacturer.
I know this can be done if I use epytext, but we'd like to stick with reStructuredText so that we can switch documentation generators later if we want to.
I'm not familiar with epydoc myself, but the normal reStructuredText way would be this:
`manufacturer <Product.manufacturer>`_
Or, with Sphinx,
:attribute:`manufacturer <Product.manufacturer>`
Considering that epydoc seems to have overridden the default role to provide links, it will be being left to it. However, this is the most likely to work:
:todo: Figure out the `manufacturer <Product.manufacturer>` relationship in `Product`.

Resources