lvgl / docs_old

DEPRECATED: Documentation for LVGL is now located in the main repository: https://github.com/lvgl/lvgl
https://docs.lvgl.io/
42 stars 71 forks source link

How to rebuild? #158

Closed uraich closed 3 years ago

uraich commented 4 years ago

The description on how to rebuild the docs is wrong. What do I have to do to rebuild the docs?

embeddedt commented 4 years ago

It needs updating.. sorry.

You should be able to checkout latest and run make html to rebuild. Sphinx and the other mentioned dependencies are still required:

pip install -U sphinx recommonmark commonmark breathe sphinx-rtd-theme
uraich commented 4 years ago

Not much better! It is missing conf.py. I see that the sources are in latest/en/html/_sources and the Makefile says: SOURCEDIR = . sphinx looks for index.rst while this file is called index.md.txt. Unfortunately I have no experience with sphinx but I am willing to learn! How do you build the docs? Currently I am working with the micropython version of lvgl and I find the documentation unsatisfactory. In the meantime I ported most of the examples in the lvgl docs to micropython (I found that somebody has done this for V6, which was of great help). However, I think we should also have a micropython documentation.

embeddedt commented 4 years ago

You need to checkout the latest branch (or dev).

EDIT: Also make sure you have submodules checked out, otherwise it will probably fail when it looks for the examples.

uraich commented 4 years ago

I did: git checkout -b latest I have lv_examples on the same level as docs

uraich commented 4 years ago

I now cloned only the latest branch: git clone -b latest https://github.com/lvgl/docs.git docs then I added the lv_examples submodule: git submodule update --init --recursive Finally I had to install sphinx-markdown-tables: pip3 install sphinx-markdown-tables Now things look better!

Another question: I may be interested to help writing the lvgl docs for micropython. Is there already a project for this? I was thinking of documentation very similar to these docs but everything converted into micropython syntax. How should I go about this? Or is there already a project aiming at this?

embeddedt commented 4 years ago

(cc @amirgon)

Much of the C documentation also applies to MicroPython, so it seems like extra effort to have to maintain two copies of it. I know that many projects have a switch at the top of the page for choosing the language of functions and examples - maybe we need something similar.

amirgon commented 4 years ago

Another question: I may be interested to help writing the lvgl docs for micropython. Is there already a project for this? I was thinking of documentation very similar to these docs but everything converted into micropython syntax. How should I go about this? Or is there already a project aiming at this?

Hi @uraich !

I'm afraid that maintaining two versions of the docs might be too tedious and hard to sustain over time. On the other hand, providing Micropython examples side by side to the C examples could be very helpful.

We already had many Micropython examples in the docs of v6, but unfortunately they were not ported to v7. If you go to the docs and switch to v6 you could see them. For example: https://docs.lvgl.io/v6/en/html/object-types/btn.html#example

If you would like to help with v7 examples, the simplest way to start is with v6 examples and convert them to v7, using the C examples as a reference.

Here is the PR for the v6 examples: https://github.com/lvgl/lv_examples/pull/40 The related "help-wanted" issue: https://github.com/lvgl/lv_examples/issues/81

uraich commented 4 years ago

Hi amirgon Of course I see that maintaining 2 versions of the docs will be difficult. Only recently I started with lvgl. I wanted to use MicroPython and had quite some difficulties to understand how to go about it. I therefore decided to try and port the examples in the docs to Python. In fact I think that ~ 60-70% of the work is already done. There are a few calls where I had difficulties to figure out how to use the MicroPython equivalent but these are very few. Only after having understood the basic principle of how to convert the C version to Python I found the V6 examples. I wrote a small "init_gui.py" script, which figures out if we run on an ST7789 (LilyGo t-watch) an ILI9341 or SDL. When importing this script you can run the example programs on any of the 3 systems without modification I think, I will try to make a MicroPython version of the docs and put them up on a university server (just the html files). I don't promise to maintain it regularly but I think that even an outdated version would have helped me. embeddedt said that it might be possible to have a switch to produce a C or a Python version, but frankly I don't see how this could work. Having gone through just the quick-overview in get-started, I see how many modifications are needed.

amirgon commented 4 years ago

Only recently I started with lvgl. I wanted to use MicroPython and had quite some difficulties to understand how to go about it.

If you have any difficulties please feel free to contact us and ask questions in the forum! https://forum.lvgl.io/ We have a dedicated Micropython category and we encourage everyone to participate. From time to time problems that people bring up turn out to be real bugs, so this also helps us identify and solve bugs in the Micropython binding.

I therefore decided to try and port the examples in the docs to Python. In fact I think that ~ 60-70% of the work is already done.

Would you be willing to contribute your example to the official LVGL docs?

I wrote a small "init_gui.py" script, which figures out if we run on an ST7789 (LilyGo t-watch) an ILI9341 or SDL. When importing this script you can run the example programs on any of the 3 systems without modification

There is something similar called display_driver.py that selects between ili9341 and SDL. If you have something better you are welcome to open a Pull Request and add it to lv_binding_micropython.

Having gone through just the quick-overview in get-started, I see how many modifications are needed.

The Micropython binding is generated automatically from LVGL C API according to some rules.
I guess that with some work it's also possible to generate the documentation automatically, but I'm not sure that would be worth the effort.
Providing Micropython examples is much more important in my opinion.

kisvegabor commented 4 years ago

I've updated the build instructions in the README: https://github.com/lvgl/docs/blob/master/README.md


Regarding the examples, I think if we had a good amount of examples for MicroPython it could replace the need for a detailed docs for MicroPython.

I like the idea of @embeddedt to have tabs to select the language for the examples.

uraich commented 4 years ago

Hi Gabor, I just went through the procedure of your new README:

Enter to the docs folder and change branch:

$ cd docs $ git checkout latest -- $ git submodule update init # should read git submodule update --init (-- before init missing)

Next line: Upadte the API instead of Update the API

Maybe you should mention that lvgl/docs/apidoc is created by doxygen When running doxygen I get this error message: warning: Tag 'PERL_PATH' at line 2134 of file 'Doxyfile' has become obsolete. To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u" warning: Tag 'MSCGEN_PATH' at line 2156 of file 'Doxyfile' has become obsolete. To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u" I corrected as described with doxygen -u

make html complained that sphinx_sitemap was missing on my system. I installed it with pip

Concerning the examples, I am about to produce the Python version. In fact I do not only look into the widget examples but also the getting started, style, fonts ... As soon as I am done I will let you know. When starting to work on lv_micropython I had a hard time figuring out how the C types and calls had to be translated into Python. I had written C modules for MicroPython before, which helped quite a bit. I will try to produce my own Python doc and maybe put it up on a university server, including the examples. If interested I could try to produce a PR (have never done this yet!) to include the Python examples in the standard docs.

kisvegabor commented 4 years ago

Thanks, @uraich. I've updated the README again.

If there are parts with Micropython the wasn't straightforward for you, I think the common MicroPython docs can be updated as well to clarify those parts.

uraich commented 4 years ago

Oups, I forgot one thing: The HTML pages are in html (not _build/html)

kisvegabor commented 4 years ago

Fixed, thanks!

stale[bot] commented 3 years ago

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kisvegabor commented 3 years ago

Seemingly there were no other issues so I close it.

Please comment here if you find any other problems.