Setting title for code line in RStudio - rstudio

I use RStudio.
The default title of each line is "Untitled" as you can see in the first picture.
Today, I found that the title of each line can be modified. As we can see, the title in the second picture is different.
But I don't know how to set the title. Can anyone tell me how to do it? Thank you very much!! :-)

This is either the section name (if it has an orange #) or the function name (if it has a blue f).
You can define sections with
## Section name ----
or
## Section name ====
or
## Section name ####
See the documentation here.

Related

Invisible heading in sphinx

I'm trying to have the following kind of layout in a Sphinx document :
Title
Article 1
Section 1
Article 2
I already saw that no matter what symbols I use to underline or overline the headers, the first appearance of a given heading will determine its hierarchical relation to the others. I.e, the following won't work :
==========
Title
==========
Article 1
---------
---------
Section 1
---------
Article 2
---------
Is there a way to circumvent this, for example by defining an invisible "Section 0" heading between Title and Article 1 with dashes as underline and overline, so that sphinx understands that Sections are greater than Articles, without actually displaying a "Section 0" between the title and the first article ?
I'm trying to do something like this Skipping heading levels in reStructuredText - although I don't really understand the code example they give...
The only ugly solution I found is the following :
=====
Title
=====
-----
\
-----
Article 1
---------
...
The two issues are that it creates a blank gap in the resulting document, and that it inserts a title-less heading in the toctree at the index page (even though it does not do that in the local summary).

Hide single section in Sphinx documentation

I couldn't find a directive that handles this.
Suppose to have a single rst document and for some reason you want to hide a single section during the build (no matter if HTML, PDF..), like:
Visible section
===============
Here some example I want to show
Not visible section
===================
Some text that I have written but for the current build I want to hide from the final document
is there a .. hidden:: directive that handle this, I'm thinking of something like:
Visible section
================
Here some example I want to show
.. hidden::
Not visible section
===================
Some text that I have written but for the current build I want to hide from the final document
.. visible::
Another section
===============
Other visible section in both text and final document
You can use comment syntax: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#comments
The version of Sphinx I have got automatically generates an index.rst file that starts with a comment like this:
.. sphinx-quickstart on Sat Jun 22 15:48:19 2019.
You can adapt this file completely to your liking, etc
It does not show up in the documentation. You can start lines with two dots and a space followed by your own text and that does not show up either. You need to make sure that all the lines you create are indented the same as the first line. Then the whole section does not show up. Also make sure there is an empty line before the section and after it (unless it is the first section in the file or the last one)
Here is a solution to hide a section, so it doesn't show up in the HTML ouput.
However, this does not affect the build.
The idea is to use the class diretive and that way be able to assign a CSS class to the section(s). In CSS you can then define the class with display: none (or any other CSS).
For you example it would look like (note the identation):
Visible section
================
Here some example I want to show
.. class:: hidden
Not visible section
===================
Some text that I have written but for the current build I want to hide from the final document
Another section
===============
Other visible section in both text and final document
In your css you add the following styling:
.hidden { display: none }
Here is a link that explains how to add custom CSS to Sphinx.

Skipping heading levels in reStructuredText

Is it possible in some way to skip heading levels in RestructuredText? For example, given
####
PART
####
*******
Chapter
*******
Section
=======
Subsection
----------
Subsubsection
^^^^^^^^^^^^
Paragraph
"""""""""
Another section
===============
Another Paragraph
"""""""""""""""""
The above heading seems to be rendered as a subsection-level heading...
The last paragraph gets rendered as a subsection instead of as a paragraph. (I am using Sphinx as a renderer.) So it seems section-level detecting is local, although the RestructuredText documentation says it should be consistent:
All section title styles need not be used, nor need any specific
section title style be used. However, a document must be consistent in
its use of section titles: once a hierarchy of title styles is
established, sections must use that hierarchy.
When running Sphinx 1.3 on the document in the question, a warning is emitted:
C:\path\to\test.rst:24: SEVERE: Title level inconsistent:
"Another Paragraph" is on line 24 and it gets rendered as a subsection heading because that is what Sphinx expects at that position.
So no, you cannot skip heading levels. That is also how I interpret the meaning of the passage about consistency quoted in the question.

Can't use :ref: with a Label using Sphinx doc

I have a problem with using Sphinx-doc's :ref: role, I put a label above a paragraph and then I try to link to that label from another doc but inside the same project.
The label I use in one document:
.. _hal_1k_1p:
And the ref I try to use to link to that label:
:ref:`Link title hal_1k_1p`
But I only get this error message when building the doc:
WARNING: undefined label: link title hal_1k_1p (if the link has no
caption the label must precede a section header)
What am I doing wrong?
Okay, looking at :ref: you need to have this:
:ref:`Link title <ha1_1k_1p>`
to link to that label.
Ensure you have angle brackets surrounding your label like so: <label>
First make sure that your ref is in the format:
Label:
.. _yourlabel:
Reference:
This is a reference to :ref:`yourlabel`.
or (if you want to give it a custom name)
This is a reference to :ref:`my very own label <yourlabel>`.
The label definition contains the leading underscore (_) while the reference doesn't! Also make sure that you didn't accidentally copy the colons from the label definition (:) to the reference.
If that doesn't help try switching languages back to english temporarily in your conf.py:
language = 'en'
If you see that this works you can switch back. Somehow this solved my problem. Maybe related to: https://github.com/sphinx-doc/sphinx/issues/1300

How to change Related product title block in Magento

Want to know, how can i change the block title of Related product block in magento? I mean that, i want to replace the title named "Related product" with my own text.
Thanks
Mostaq
Hello check below file
app/design/frontend/base/default/template/catalog/product/list/related.phtml or
app/design/frontend/your_current_theme/default/template/catalog/product/list/related.phtml
Hope this help you.
After GO to Your related page and see the red line with book
icon to click on it and replace your text without Going To file System.
For Backend Related Product Tab Label Change for
1) direct change on core file:
app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php
find Related and replace
2)Create Module to dynamic :
http://stackoverflow.com/questions/16481564/where-to-change-magento-default-tabs-on-products

Resources