Say I have a normal documentation part and additionally a glossar, both build in the same sphinx project.
Is there a way to link a word with let's say a headline on another page without using a normal static link?
If there is no other way than a static link, is there a possibility to introduce IDs?
You can create a link to any spot in your project using cross references. For example:
.. _my-reference-label:
Section to cross-reference
--------------------------
This is the text of the section.
It refers to the section itself, see :ref:`my-reference-label`.
Related
I'd like to add a simple warning directive at the top of every page on a Sphinx RTD site:
.. attention::
The next major release of this project will launch on X date.
In the meantime, we're looking for feedback.
If you'd like an early preview, please reach out at someemail#someaddress.com!
What's the simplest way to do this? I'm using the sphinx_rtd_theme.
I can see how to add a block using the extrabody block, but it appears outside the main content area and is positioned and styled totally independently.
Ideally, I'd want this block to show up at an attention directive just below the breadcrumbs on every page.
You could add this to the conf.py Sphinx configuration file:
rst_prolog = """.. attention::
The next major release is imminent.
"""
and it will be included at the beginning of every source file that is read ‒ see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-rst_prolog.
F-string literals work too, so f'This is release #{release}' will substitute that variable value.
I have just recently (yesterday) started using sphinx and read the docs for my project.
Till now I am happy with the Html documentation but the pdf version includes all the articles That appear in the index within the Contents heading. And the Documents orignal content/index is simply comprised of two links.
Please help.
The documentation is at http://todx.rtfd.io and the pdf is here.
When generating the PDF, Sphinx is always adding the content that is referenced via a .. toctree:: directive exactly where the directive is placed.
In contrast, when generating HTML, Sphinx is placing the content after the file that contains the toctree.
In this aspect, PDF generation and HTML generation are simply inconsistent.
Thus, you should place all content of the index page before the table of contents.
In case you want to provide an overview of the most important sections inline, you can use a list of references. Then, you might want to hide the toctree using the hidden property, for example like this:
Contents
--------
- :ref:`quickstart`
- :ref:`userguide`
Features
--------
- Fast
- Simple
- Inituitive
- Easy to Use
- Offline
- Open Source
.. toctree::
:hidden:
quickstart
userguide
To reference a section using reStructuredText in Sphinx, I can do:
.. _my-reference-label:
Section to cross-reference
--------------------------
This is the text of the section.
It refers to the section itself, see :ref:`my-reference-label`.
as explained here.
This results in the section being referenced by title, that is I get the line:
It refers to the section itself, see Section to cross-reference.
(where Section to cross-reference links to the beginning of the corresponding section)
I'd like to get instead:
It refers to the section itself, see 2.1.
where 2.1 is the section's number.
Is there a way to accomplish this using reStructuredText in Sphinx?
The numsec Sphinx extension does what you want. The source code is here: https://github.com/jterrace/sphinxtr/blob/master/extensions/numsec.py.
The extension is part of the "Sphinx Thesis Resource" package developed by Stack Overflow member jterrace. See https://github.com/jterrace/sphinxtr.
for a Application in Apex i want to create some links with the htp-class with the properties:
The link must refers to a internal page of the app.
If the Link is clicked, i want to set the value of a "hidden-item" in the refered page
Some ideas?
greetings
Please, read the following documentation chapter: Understanding URL Syntax. It will answer on both of your questions.
some links with the htp-class
I don't know what is htp-class. May be, you mean HTP package or HTML class attribute.
Just want to note that you can use built-in capabilities of such APEX components like Reports and Lists to generate links to the pages of your app including item values setting. Here are the links to the docs: Lists, Column Link in IR, Column Link in Classic Report.
Good luck,
Alex
I am a newbie coder. I have learned a lot in the few weeks. Now I am making my blog site.
What I want is , show the limited part of 6 or 8 articles in the content div and make a read more link to show the article.
Can you tell me a way to do it?
Load the string helper and use the word_limiter, character_limiter (google for docs)
Or, contain a paragraph called "Summary" (varchar(255)) different to your main "Content" field (TEXT).
Initially load string helper and do as follows
word_limiter("data",limit);
You can check it here