Skip to content

doc: tutorial refactor#18712

Merged
alalek merged 2 commits intoopencv:masterfrom
mshabunin:doc-update-2
Dec 9, 2020
Merged

doc: tutorial refactor#18712
alalek merged 2 commits intoopencv:masterfrom
mshabunin:doc-update-2

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

@mshabunin mshabunin commented Nov 1, 2020

  • compact lists of tutorials - moved information about original author and compatible OpenCV version into tutorial, removed brief description
  • combined videoio, highgui and imgcodecs into new app section (application utils), flattened content
  • combined photo, stitching, video, objedetect and ml into new other section, flattened content
  • flattened structure of imgproc tutorials
  • kept old pages for links compatibility
  • created script doc/tools/scan_tutorials.py which checks order in tutorial lists and prev/next navigation links for consistency (must be run in the doc folder)
  • 🆕 added tableofcontents to most tutorials

preview

Note: have not updated G-API tutorials yet to avoid possible conflicts

Note: USAC tutorial is not added to any list and have slightly different format than others, I think it would be better to fix it in separate PR

force_builders_only=docs

@asmorkalov asmorkalov added the category: documentation Documentation fix or update label Nov 12, 2020
@mshabunin mshabunin force-pushed the doc-update-2 branch 2 times, most recently from ba4c24c to 461e26b Compare December 4, 2020 22:57
@mshabunin mshabunin marked this pull request as ready for review December 4, 2020 23:15
@mshabunin
Copy link
Copy Markdown
Contributor Author

core section before:
image
...and after:
image

@mshabunin
Copy link
Copy Markdown
Contributor Author

Typical tutorial header...
image
I tried to combine prev/next links with author/version information, but didn't find nice variant.

@catree
Copy link
Copy Markdown
Contributor

catree commented Dec 6, 2020

Is it possible to have also previous/next tutorial links at the bottom of the page?

In my opinion, it is useful when you follow a tutorial to not have to scroll up to go to the next tutorial.

Some examples:

With the MoveIt tutorials, I like the previous/next buttons at the bottom of the page and the "address bar" at the top of the page, that could be used in OpenCV to navigate at the different levels of the tutorials hierarchy.

One issue with previous/next links is that it is not automatic. So if you want to add a tutorial, you have to update these links manually for two consecutive tutorials.


Maybe languages compatibility could be added also here?

image

There are already language buttons to select the sample code language in the page, so not sure if it is useful or not.


What about adding for each tutorial page a \tableofcontents?


Just an idea. What about keeping the extra tutorial description? Something like:

@subpage tutorial_mat_the_basic_image_container <br>You will learn how to store images in the memory and how to print out their content to the console.

@mshabunin
Copy link
Copy Markdown
Contributor Author

@catree , thank you for comments. I've added TOCs to most tutorials.

As for prev/next links at the bottom and better navigation, I don't see a convenient way to do it without manually copying this part from the top. We need to either extend tutorial-checking script added in this PR to be able to modify all tutorials, either some JS code which would transform contents at loading time. I'll try to experiment with the first approach later.

Languages information and tutorial description was removed in this PR, because in most cases this information is redundant and not very useful. I think maybe we can use longer titles if current one is not descriptive enough.

@alalek
Copy link
Copy Markdown
Member

alalek commented Dec 8, 2020

@tableofcontents

Looks like it doesn't work on public CI. Which doxygen version is required?

@sturkmen72
Copy link
Copy Markdown
Contributor

sturkmen72 commented Dec 8, 2020

i think updating doxigen version will be fine.

Last Release is 1.8.20

@catree
Copy link
Copy Markdown
Contributor

catree commented Dec 8, 2020

@alalek

It should work. There are already some pages that have table of contents:

In tutorial_transition_guide.html, @tableofcontents is after @prev_tutorial and @next_tutorial. So maybe that is the reason?

@mshabunin
Copy link
Copy Markdown
Contributor Author

I use latest doxygen 1.8.20 and TOCs work for me. However I do not recommend upgrading yet because language-switching buttons do not work in many tutorials because H2 headers have changed to H1 and our JS code does not handle it well and must be updated.

I suggest leaving them in this PR, because they do not harm and can be useful in future when we upgrade or find another solution.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you 👍


@prev_tutorial{tutorial_gapi_anisotropic_segmentation}

[TOC]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, Also there is another way to specify table of contents. Page

But I agree that we need to check/fix headers on problematic pages.

@alalek alalek merged commit 114848d into opencv:master Dec 9, 2020
@alalek alalek mentioned this pull request Apr 9, 2021
@mshabunin mshabunin deleted the doc-update-2 branch July 10, 2023 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: documentation Documentation fix or update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants