Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Triple Quote to variables-->diary.rst Section #12

Open
hadi-f90 opened this issue Jul 29, 2021 · 6 comments
Open

Add Triple Quote to variables-->diary.rst Section #12

hadi-f90 opened this issue Jul 29, 2021 · 6 comments

Comments

@hadi-f90
Copy link

What do you think of including a note about triple quote (""" and ''') that supports multiple lines string at {index:: ', ", \n, escape character, escape sequence} right before "Try it!"

@aroberge
Copy link
Owner

This seems like a good idea. Please feel free to add it to your version. I have little time to devote to this project at the moment. To properly produce the documentation (with menus to switch languages), an older/obsolete version of sphinx must be used, and it takes too much time for me to set it up for such a small change.

I am keeping this issue open and will try to do this at a later time.

@hadi-f90
Copy link
Author

Current version of Reeborg-doc still works fine with Sphinx 4.x.

@aroberge
Copy link
Owner

Can you check the following. Here's a page that I had compiled with Sphinx 1.5.6. Notice how there is a language selector on the right.

image

Here's a page that I had compiled after upgrading to Sphinx 1.8.1. Notice how there is no longer a language selector: the layout code I had written for this was ignored by Sphinx.

image

Years ago, I tried to see what changed with Sphinx between these two versions so that I could have the language selector again; I was never able to figure it out.

Can you see the language selector with Sphinx 4.x?

@hadi-f90
Copy link
Author

hadi-f90 commented Aug 1, 2021

Well, since I didn't have any other languages along with Farsi, I haven't faced such issue.
Anyhow, I gave it a try and it didn't have any:

English:

image


French:
image


Korean:

image

Following a few search queries, I found this:
sphinx-doc/sphinx-intl#26
in which shimizukawa says:

Sphinx and sphinx-intl doesn't provide "language switcher" mechanism.
However ReadTheDocs provides it.
Please refer https://docs.readthedocs.io/en/latest/guides/manage-translations.html.

In "readthedoc" theme I found a small button which is placed instead of all the other version, language, search, etc.
image

That expands to:
image

Readthedoc theme documentation considers a different folder structure and some extra files to have such capability. it uses gettext and .po file structure to do so -which can be used along with transifex.com translation platform. Here are some resources that I found:
https://stackoverflow.com/questions/49331914/enable-versions-in-sidebar-in-sphinx-read-the-docs-theme
https://www.sphinx-doc.org/en/master/usage/advanced/intl.html
https://docs.readthedocs.io/en/latest/guides/manage-translations.html

Multiversion on the same website:
https://holzhaus.github.io/sphinx-multiversion/master/configuration.html#configuration

Here's my own Sphinx log:
image
You can see it looks for translations.
By the way, using transifex.com and .po and .mo files are good for the main author. You know, Sphinx's documentations translations themselves are on transifex.com. The dark side of gettext and .po files is that it separates text from context and its cotext too much. I prefer a more WYSIWYG approach than a bare .po file.

@aroberge
Copy link
Owner

aroberge commented Aug 1, 2021

Thank you for finding out all of this information. At some point, I might upgrade to a newer version of sphinx, after figuring out how to have an easy way to switch between languages - without using po files.

While you have your own sites (which makes sense), if ever you wanted me to host the Farsi version as well on my site, available like the other language versions I already have, I would gladly do so. It is with this in mind that I was wondering about retaining the language "switcher".

@hadi-f90
Copy link
Author

hadi-f90 commented Aug 5, 2021

While you have your own sites (which makes sense), if ever you wanted me to host the Farsi version as well on my site, available like the other language versions I already have, I would gladly do so. It is with this in mind that I was wondering about retaining the language "switcher".

Thanks, for this, I'll submit a "pull request" as soon as I apply some bug fixes to the modified theme for its fonts and readability and remove any redundant files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants