Cross-reference to another page with Python-Sphinx [duplicate] - python-sphinx

This question already has answers here:
Adding a cross-reference to a subheading or anchor in another page
(6 answers)
Closed 3 months ago.
Hi whoever will read this!
I am writing a documentation webpage with Sphinx, and though I have been able to create nice cross-referencing in the same page following what is found on this guide, I now want to add in page A the reference to a subsection in page B.
I know that I can do so with an explicit external link, like:
`Link name <https://my.documentation.domain/path/to/page-B#subsection>`_
but can I do so with a cross-reference as well? It would be neater in my opinion. I tried :
:doc:`page_B:subsection`
and
:doc:`page_B#subsection`
but it is not recognized. Sorry if this is a dummy question but I did not find the answer on the internet. Thank you :)

Thank you #bad_coder and #Steve Piercy! So this question's answer is what I was looking for, but was not formulated in a way I could find it. For anyone who would end up here, what worked for me is :
Define a target in page-B, by adding before the section title:
.. _target name:
Refer to this target in page-A, simply with:
:ref:`two phase simulations`
Note that you do not need to add page-A name, the reference will be automatically found.
It also works to use a relative html link, but this is far less robust (it would break if section names are changing, for instance):
`Link name <page_B.html#subsection>`_

Related

Table of contents in markdown for Nikola

I've been using Sphinx for my personal website for the past years and realized that I more have a blog with posts and few pages and did the conversion to Nikola in the past days. I also took the opportunity to switch to Markdown as I use it with R and Stack Overflow and everywhere else as well.
I have set in my Sphinx theme to have a local table of contents in the sidebar. There are a handful of very long (over 10k words) posts that would benefit from a local table of contents. I saw that the Nikola manual is written in reST and uses the contents directive. I would like to use that also in those posts.
I could convert these few posts back to reST and use the contents directive, but I'd like to avoid that. Can this be accomplished somehow?
Nikola uses Python-Markdown by default. It supports a TOC extension that one can enable in the conf.py. Then one can use a [TOC] marker anywhere in the document to get a local table of contents.
Updated
Using [TOC] which is a feature of an extension enabled by default. My firts answer was an misinterpretation of your question.
Firts answer
Using Nikola, may be you are interested in "archive" option. This is a default page that include all your posts (optional, this is grouped by date). Example in my blog: https://www.cosmoscalibur.com/archive.html .

Use of undeclared identifier Xcode

I always turn to stack overflow in order to clarify programming issues. I found a question which deals with creating PDF files in x code that I am trying to implement. The post can be found here Create PDF iOS7 My problem begins at the very las instruction for the completed answer (The one with the green check) that reads "Now import the PDf.h in the class and use something like this to create and draw your pdf:" I do not understand what the instructions mean when they say "Import the PDF.h class" Where would I import this?
I am providing the link to that questions so it is easier for anyone to find it.
thanks in advance!!
Link to question: Create PDF iOS7
Create the two files that were written in the answer you linked (PDFHelper.h and PDFHelper.m). Then in the class that needs to create a PDF add: #import "PDFHelper.h"
After doing this, you can access the PDFHelper class and its functions.

How to edit the original string column in poedit?

Hi I am using poedit editor and i am not able to edit the original string column. I want to edit few words on original string column. Thanks in Advance
(Oh well, I'll answer it here as well, for the benefit of the people who may find this post. But you won't like the answer any more than when I replied to you yesterday, when you asked on the Poedit mailing and in personal email to me.)
Short answer is: you can't. Read the introductory sections of the GNU gettext manual -- it explains the basic concepts of gettext translations very well, from both the programmer's and translator's perspectives, and it's clear you don't understand the concept of gettext.
Really, I mean it: please, please, read at the lest the intro part of the manual. The fine folks from the GNU gettext project put a lot of effort into it and if you've spent 5-10 minutes with it, you wouldn't need to ask this question.
Longer version:
Gettext uses text strings (typically in English) in the source code as translation keys. And it has tools to extract the strings and put them into a PO file. This ensures that only strings that are actually used are translated.
Changing the original string (called msgid -- it really is an ID) makes no sense. You would then have a translation of a string that is never used in the source code and so the translation would be guaranteed to never be used. Way to waste the translator's time, wouldn't it?
Want to "edit a few words"? Edit them in the source code. That's the only way that can ever work with gettext.
What Vaclav is saying is very true. If you change the actual source string, the system won't read it.
In Poedit, simply select the string from the long list that you want to edit then you will see that string in the Source Text at the bottom of the screen. Then in the Translation box, enter your preferred wording. Don't forget to include any variable aswell otherwise your change won't work.
What Vaclav is saying is very false.
You can change it. Open the file with notepad. Ctrl + F the original text that you want to change. Change it, and then save it. Then open the file with po edit again, and you will see the changed text.

Overflow after using "FillSampleValues()" in Teechart(VC++6.0,Teechart8.ocx environment)

I'm a very beginner of TeeChart.
When I add a member variable called m_chart for the chart,it looks okay.
Then I add "m_chart.Series(0).FillSampleValues(50);" in CMy312Dlg::OnInitDialog()......
and overflow ocurred.
What's wrong?
So sad to find that I don't describe my question well.(Well I'm a freshman on StackOverflow,and cannot add image for my poor reputation.)
But if you need more details,I will try to describe for you.:)
Before adding data to a series you must create this series and add it to the chart to access it the way you do. You'll find examples at the Visual C++ sections in the tutorials and examples folders. If the problem persists please send us an example project we can run "as-is" to reproduce the problem here.

Generating table of contents

I posted this one a couple of months ago on the Mathematica newsgroup, but got no usable response. I thought I'd give SO a try.
The question was: I don't seem to be able to find the method to generate the table of contents of a
Mathematica document I'm working on. Anyone knows this feauture's
hideout?
David Annetts pointed me in the direction of the AuthorTools, an old v5.1
utility package that's still hidden in Mathematica. However, it
doesn't work on my document (v7). Any clue?
Edit
The TOC should contain correct section numbers (if present in the stylesheet) and list page numbers (this requires taking page size settings into account).
Perhaps looking at the code of Yuri Kandrashkin's package, Sidebar, will be useful?

Resources